Your message dated Tue, 25 Aug 2015 09:23:04 +0000
with message-id <[email protected]>
and subject line Bug#794628: fixed in piuparts 0.65
has caused the Debian Bug report #794628,
regarding piuparts should fail on multi-arch not pass
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
794628: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=794628
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: piuparts
Version: 0.64
Severity: wishlist
Tags: patch
User: [email protected]
Usertags: rebootstrap

During a partial archive cross rebuild, I discovered that many packages
failed to install. Being faced with many package installation failures
seems strange in the presence of piuparts, but then it occurred to me
that piuparts only tests native installation.

So I tried to test a foreign arch installation of libc6 with piuparts
and noticed that it succeeds despite failing to install the foreign arch
libc6. The initial dpkg --unpack fails, because the architecture is not
added to dpkg, but piuparts swallows that failure. I argue that in this
situation, piuparts should either actually perform the test or fail.

Being interested in actually testing stuff, I looked into extending
piuparts for this use case and I came up with the attached patch. It
makes both

    piuparts --arch amd64 libc6_2.19-19_i386.deb

and
    piuparts --arch amd64 -a libc6:i386

work in a meaningful way. I am not sure whether the new functionality
breaks aspects of piuparts that I did not test. It also is not clear
whether such liberal acceptance of packages and package names is desired
or whether piuparts would want to enforce explicit activation of foreign
arch testing via a new command line flag.

Still I hope that my patch can be a basis for adding this feature.

Helmut
diff -Nru piuparts-0.64/debian/changelog piuparts-0.64+nmu1/debian/changelog
--- piuparts-0.64/debian/changelog      2015-06-12 13:44:18.000000000 +0200
+++ piuparts-0.64+nmu1/debian/changelog 2015-08-04 16:59:28.000000000 +0200
@@ -1,3 +1,10 @@
+piuparts (0.64+nmu1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Support testing foreign arch installations. (Closes: #-1)
+
+ -- Helmut Grohne <[email protected]>  Tue, 04 Aug 2015 16:59:14 +0200
+
 piuparts (0.64) unstable; urgency=medium
 
   [ Holger Levsen ]
diff -Nru piuparts-0.64/piuparts.py piuparts-0.64+nmu1/piuparts.py
--- piuparts-0.64/piuparts.py   2015-06-12 13:43:13.000000000 +0200
+++ piuparts-0.64+nmu1/piuparts.py      2015-08-04 16:42:46.000000000 +0200
@@ -706,7 +706,7 @@
         os.chmod(self.name, 0o755)
         logging.debug("Created temporary directory %s" % self.name)
 
-    def create(self, temp_tgz=None):
+    def create(self, temp_tgz=None, architectures=()):
         """Create a chroot according to user's wishes."""
         self.panic_handler_id = do_on_panic(self.remove)
         if not settings.schroot:
@@ -728,6 +728,7 @@
         if not settings.schroot:
             self.mount_proc()
             self.mount_selinux()
+        self.add_architectures(architectures)
         self.configure_chroot()
 
         # Copy scripts dirs into the chroot, merging all dirs together,
@@ -892,6 +893,17 @@
                     "\n".join(lines) + "\n")
         logging.debug("sources.list:\n" + indent_string("\n".join(lines)))
 
+    def add_architectures(self, architectures):
+        """Ensure that dpkg accepts the given architectures."""
+        architectures = set(architectures)
+        if architectures:
+            _, native_arch = self.run(["dpkg", "--print-architecture"])
+            architectures.discard(native_arch.strip())
+            _, foreign_arches = self.run(["dpkg", 
"--print-foreign-architectures"])
+            architectures.difference_update(foreign_arches.splitlines())
+            for arch in architectures:
+                self.run(["dpkg", "--add-architecture", arch])
+
     def enable_testdebs_repo(self, update=True):
         if settings.testdebs_repo:
             if settings.testdebs_repo.startswith("deb"):
@@ -2152,18 +2164,33 @@
         (status, output) = run(["dpkg", "--info", filename])
         p = None
         v = None
+        a = None
         for line in [line.lstrip() for line in output.split("\n")]:
             if line.startswith("Package:"):
                 p = line.split(":", 1)[1].strip()
             if line.startswith("Version:"):
                 v = line.split(":", 1)[1].strip()
+            if line.startswith("Architecture:"):
+                a = line.split(":", 1)[1].strip()
         if p is not None:
+            if a is not None and a != "all":
+                p += ":" + a
             if v is not None:
-                vlist.append(p + "=" + v)
-            else:
-                vlist.append(p)
+                p += "=" + v
+            vlist.append(p)
     return vlist
 
+def collect_architectures(packages):
+    """Collect architecture names from a list of possibly arch qualified
+    package names."""
+    architectures = set()
+    for p in packages:
+        p = p.split("=", 1)[0]
+        p = p.split(":", 1)
+        if len(p) > 1:
+            architectures.add(p[1])
+    return architectures
+
 # Method to process a changes file, returning a list of all the .deb packages
 # from the 'Files' stanza.
 
@@ -2501,9 +2528,10 @@
     os.environ["PIUPARTS_TEST"] = "distupgrade"
 
     packages = unqualify(packages_qualified)
+    architectures = collect_architectures(packages_qualified)
 
     chroot = get_chroot()
-    chroot.create()
+    chroot.create(architectures=architectures)
 
     if settings.end_meta:
         # load root_info and selections
@@ -2537,9 +2565,9 @@
 
         chroot = get_chroot()
         if temp_tgz is None:
-            chroot.create()
+            chroot.create(architectures=architectures)
         else:
-            chroot.create(temp_tgz)
+            chroot.create(temp_tgz, architectures=architectures)
             chroot.remove_temp_tgz_file(temp_tgz)
             dont_do_on_panic(panic_handler_id)
 
@@ -3054,9 +3082,11 @@
         packages = package_list
         package_files = []
 
+    architectures = collect_architectures(packages)
+
     if len(settings.debian_distros) == 1:
         chroot = get_chroot()
-        chroot.create()
+        chroot.create(architectures=architectures)
 
         chroot_state = {}
         chroot_state["tree"] = chroot.save_meta_data()

--- End Message ---
--- Begin Message ---
Source: piuparts
Source-Version: 0.65

We believe that the bug you reported is fixed in the latest version of
piuparts, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Holger Levsen <[email protected]> (supplier of updated piuparts package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Tue, 25 Aug 2015 08:23:51 +0000
Source: piuparts
Binary: piuparts piuparts-master piuparts-slave piuparts-common
Architecture: source
Version: 0.65
Distribution: unstable
Urgency: medium
Maintainer: piuparts developers team <[email protected]>
Changed-By: Holger Levsen <[email protected]>
Description:
 piuparts   - .deb package installation, upgrading, and removal testing tool
 piuparts-common - common piuparts components
 piuparts-master - piuparts master components
 piuparts-slave - piuparts slave components
Closes: 794628
Changes:
 piuparts (0.65) unstable; urgency=medium
 .
   [ Andreas Beckmann ]
   * piuparts.py:
     - Ensure /etc/mtab exists in the chroot.
     - Create sources.list entries for --testdebs-repo with '[ trusted=yes ]'
       to avoid needing --do-not-verify-signatures which would act globally.
     - Add --fake-essential-packages option to include packages in the base
       chroot that are not removed after the test. These are available during
       purge and for checking against mistreatment.
     - 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
       but a dependency has been removed from the archive since then.
     - Prepare improvements for handling foreign arch dependencies.
   * piupartslib/open_packages_url(): Support xz-compressed and uncompressed
     Packages files.
   * piuparts-master-backend.py:
     - Catch URLError, log it and abort without backtrace.
   * piuparts-common: Add Depends: python-lzma.
   * scripts/post_distupgrade_exceptions:
     - Fix the /etc/nsswitch.conf wheezy -> jessie upgrade handling.
   * scripts/pre_remove_40_find_unowned_lib_links: Ignore some symlinks caused
     by mpi-default-dev and libglide2/libglide3.
   * Add/adjust some exceptions for ancient packages.
   * Add bug template for wheezy -> jessie -> stretch upgrades.
Checksums-Sha1:
 7daa8db215700a8f86a276d8cea9585972aeb841 1962 piuparts_0.65.dsc
 5555b1455bead40040ce0eb4160007f5ca3ff470 231448 piuparts_0.65.tar.gz
Checksums-Sha256:
 4ed6bf4fe28da012dc609ba82de231297fc5311c10c94543a47f209eac342c37 1962 
piuparts_0.65.dsc
 168bead4ea7055b222fba48393af5e671074db3098b4cbd7e0fc58f43df4d8f8 231448 
piuparts_0.65.tar.gz
Files:
 2d378a4c71ed6dce0d243e9078c0b5bc 1962 devel extra piuparts_0.65.dsc
 b63d368ba2fe9c4848a25d1a45c3878c 231448 devel extra piuparts_0.65.tar.gz

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iQIVAwUBVdwpGgkauFYGmqocAQpn5Q/7BZOf5aRqjt+SwNvAXLqIvGKyf8Yc3fn1
HptJj1g1yqCFelPf2AcKpPNZAFOMNjtQ50evM56dJxlPyAcGKMYsu+dctZ0KHMn5
IFUZT1GPJIcgATZiBLM1EZjTaJih4yoSuh28DwjnFCA2bbmaaFDYzjeiJth0ACM3
+9dQO05gaHOSyJ+rMpAlR5F1e58ZDryoKNBLnAv6iNj+s+DLpI9JO02q9ZlWKxfw
LdaeXP3wMPc+Dxd85625I24lWFGtlJpvwgCfE0eaMHqxyDeALf46Y51EoCPYnUce
2FboZwXRHy0hzKVXhnibP2ZPGg2z9skA0CfcWELHjpA9BEoDBq0vrxWjdbF6kOge
4szCXCWaW2qRUVSFWdxZ+xlQfqS+yZYnahtx/6OBtnsasFlXN66kzODZN3+EmAET
1VhQRhVeCUtmQXYw6my7OzJ3EfqRFxHuqIFgt5IxxuSBLWwFcpYhmttxLqd5fgg9
QW5cPHNb1biw12/Gb/Coc3eNKos5pWvnr6HrMG1kSrM6Vxg6jeF39mZLfwKMU/zL
DWhdDHq2y3+KGeMZjKhw1XGYztzQWLg4z2+/Rokf/062SXeZuszWZwpVZhKAVGl7
jCKeD0X1JkyAqq0koRVU80ZRBDEykLW6IY47mKbvJkNeAYZvgM4ZQgSfIEsNGWvg
D9jsOvIUubs=
=KCf1
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to