[Piuparts-commits] [piuparts] 05/06: p: arch of piuparts-depends-dummy needs to match package-to-be-tested

Holger Levsen holger at moszumanska.debian.org
Mon Aug 10 08:43:14 UTC 2015


This is an automated email from the git hooks/post-receive script.

holger pushed a commit to branch develop
in repository piuparts.

commit f3c508f30198df8d747dc0a8786adc2cfab0fbea
Author: Andreas Beckmann <anbe at debian.org>
Date:   Mon Aug 10 00:36:10 2015 +0200

    p: arch of piuparts-depends-dummy needs to match package-to-be-tested
    
    otherwise dependencies could be installed from the wrong architecture for
    multiarch tests
    
    Signed-off-by: Andreas Beckmann <anbe at debian.org>
---
 debian/changelog |  2 ++
 piuparts.py      | 13 ++++++++++---
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 29133c7..5e437d5 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -11,6 +11,8 @@ piuparts (0.65) UNRELEASED; urgency=medium
     - Increase permitted command output volume from 3 MB to 4 MB (for daptup).
     - Only ignore 'dpkg -i' failures that can be fixed by 'apt-get -f
       install'.  (Closes: #794628)
+    - Set Architecture of piuparts-depends-dummy to match the package to be
+      tested.
   * piuparts.conf.anbe: Add some more example sections.
   * piupartslib/packagesdb.py:
     - Put package in 'dependency-does-not-exist' state if a pass/ log exists
diff --git a/piuparts.py b/piuparts.py
index d1b2f25..f4b4bd1 100644
--- a/piuparts.py
+++ b/piuparts.py
@@ -571,7 +571,7 @@ def remove_files(filenames):
             panic()
 
 
-def make_metapackage(name, depends, conflicts):
+def make_metapackage(name, depends, conflicts, arch='all'):
     """Return the path to a .deb created just for satisfying dependencies
 
     Caller is responsible for removing the temporary directory containing the
@@ -588,7 +588,7 @@ def make_metapackage(name, depends, conflicts):
     control = deb822.Deb822()
     control['Package'] = name
     control['Version'] = '0.invalid.0'
-    control['Architecture'] = 'all'
+    control['Architecture'] = arch
     control['Maintainer'] = ('piuparts developers team '
                              '<piuparts-devel at lists.alioth.debian.org>')
     control['Description'] = ('Dummy package to satisfy dependencies - '
@@ -2344,6 +2344,7 @@ def install_purge_test(chroot, chroot_state, package_files, packages, extra_pack
         depends = []
         conflicts = []
         provides = []
+        arch = 'all'
         for control in control_infos:
             if control.get("pre-depends"):
                 depends.extend([x.strip() for x in control["pre-depends"].split(',')])
@@ -2353,13 +2354,19 @@ def install_purge_test(chroot, chroot_state, package_files, packages, extra_pack
                 conflicts.extend([x.strip() for x in control["conflicts"].split(',')])
             if control.get("provides"):
                 provides.extend([x.strip() for x in control["provides"].split(',')])
+            if control.get("architecture"):
+                a = control["architecture"]
+                if arch == 'all':
+                    arch = a
+                if arch != a:
+                    logging.info("architecture mismatch: %s != %s)" % (arch, a))
         for provided in provides:
             if provided in conflicts:
                 conflicts.remove(provided)
         all_depends = ", ".join(depends)
         all_conflicts = ", ".join(conflicts)
         metapackage = make_metapackage("piuparts-depends-dummy",
-                                       all_depends, all_conflicts)
+                                       depends=all_depends, conflicts=all_conflicts, arch=arch)
         cleanup_metapackage = lambda: shutil.rmtree(os.path.dirname(metapackage))
         panic_handler_id = do_on_panic(cleanup_metapackage)
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/piuparts/piuparts.git



More information about the Piuparts-commits mailing list