]> git.donarmstrong.com Git - dsa-puppet.git/commitdiff
teach dd-schroot-cmd apt-get build-dep about --arch-only
authorHelmut Grohne <helmut@subdivi.de>
Mon, 8 Jul 2013 12:19:28 +0000 (14:19 +0200)
committerHéctor Orón Martínez <zumbi@debian.org>
Mon, 8 Jul 2013 13:12:44 +0000 (15:12 +0200)
Signed-off-by: Héctor Orón Martínez <zumbi@debian.org>
modules/porterbox/files/dd-schroot-cmd

index 76f3c9d113d62253554764432da9bf2b57fd3518..e2d2111efe0aaad20297200856966787c8846e39 100755 (executable)
@@ -154,7 +154,12 @@ class AptSchroot:
         elif op == "install":
             self.apt_install(args)
         elif op == "build-dep":
-            self.apt_build_dep(args)
+            try:
+                args.remove("--arch-only")
+                archonly = True
+            except ValueError:
+                archonly = False
+            self.apt_build_dep(args, archonly)
         else:
             die("Invalid operation %s"%(op,))
 
@@ -174,8 +179,9 @@ class AptSchroot:
     def apt_install(self, packages):
         self.apt_simulate_and_ask(['install', '--'] + packages)
 
-    def apt_build_dep(self, packages):
-        self.apt_simulate_and_ask(['build-dep', '--'] + packages)
+    def apt_build_dep(self, packages, archonly=False):
+        cmd = ['build-dep'] + (['--arch-only'] if archonly else []) + ['--']
+        self.apt_simulate_and_ask(cmd + packages)
 
     def apt_simulate_and_ask(self, cmd, split_download=True, run_clean=True):
         if not self.assume_yes: