[llvm-commits] [zorg] r103623 - /zorg/trunk/zorg/buildbot/builders/ChrootSetup.py

Daniel Dunbar daniel at zuster.org
Wed May 12 10:12:44 PDT 2010


Author: ddunbar
Date: Wed May 12 12:12:44 2010
New Revision: 103623

URL: http://llvm.org/viewvc/llvm-project?rev=103623&view=rev
Log:
buildbot/ChrootSetup: Add support for images which contain packages to install.

Modified:
    zorg/trunk/zorg/buildbot/builders/ChrootSetup.py

Modified: zorg/trunk/zorg/buildbot/builders/ChrootSetup.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/buildbot/builders/ChrootSetup.py?rev=103623&r1=103622&r2=103623&view=diff
==============================================================================
--- zorg/trunk/zorg/buildbot/builders/ChrootSetup.py (original)
+++ zorg/trunk/zorg/buildbot/builders/ChrootSetup.py Wed May 12 12:12:44 2010
@@ -33,7 +33,14 @@
                            workdir=build_root_name))
 
     # For each image...
-    for i,image in enumerate(build_root_images):
+    for i,image_info in enumerate(build_root_images):
+        # If this image is (image, package name) then assume this is a dmg with
+        # a package inside, which we should install.
+        if isinstance(image_info, tuple):
+            image,package_to_install = image_info
+        else:
+            image,package_to_install = image_info,None
+
         # Setup the build root we will build projects in.
         f.addStep(ShellCommand(
                 name="attach.buildroot",
@@ -60,17 +67,26 @@
                 haltOnFailure=True,
                 workdir="mounts"))
 
-        # Restore the build root.
-        cmd = ["sudo", "rsync", "-arv"]
-        if i == 0:
-            cmd.append("--delete")
-        cmd.extend([WithProperties("%%(%s)s/" % mount_point_property), "./"])
+        # Check whether we are install the package, or restoring the disk
+        # directly.
+        if package_to_install:
+            cmd = ["sudo", "installer", "-verboseR", "-pkg",
+                   WithProperties("%%(%s)s/%s" % (mount_point_property,
+                                                  package_to_install)),
+                   "-target",
+                   WithProperties("%%(builddir)s/%s" % build_root_name)]
+        else:
+            # Restore the build root.
+            cmd = ["sudo", "rsync", "-arv"]
+            if i == 0:
+                cmd.append("--delete")
+            cmd.extend(["--exclude", "/dev"])
+            cmd.extend([WithProperties("%%(%s)s/" % mount_point_property),
+                        "./"])
         f.addStep(ShellCommand(
                 name="init.buildroot.%d" % i,
                 command=cmd,
-                warnOnFailure=True,
-                flunkOnFailure=False,
-                haltOnFailure=False,
+                haltOnFailure=True,
                 description="init build root",
                 workdir=build_root_name))
 





More information about the llvm-commits mailing list