[Piuparts-devel] Multi-arch leniency patch

Dave Steele dsteele at gmail.com
Sat Jun 21 03:51:31 UTC 2014


multiarch(1)

c266c77 dependencyparser.py: loosen the multiarch spec

===================================

>From c266c77b651915ce5a01dee38baea315e3243220 Mon Sep 17 00:00:00 2001
From: David Steele <dsteele at gmail.com>
Date: Fri, 20 Jun 2014 22:48:26 -0400
Subject: [PATCH] dependencyparser.py: loosen the multiarch spec

Per the Multi Arch spec, a package dependency may have an ":any" appended to
the package name in a Depends-type spec. The dependencyparser module detects
and strips any occurance of ":any".

https://wiki.ubuntu.com/MultiarchSpec#Extended_semantics_of_per-architecture_package_relationships

Per #748426, lsb-core has an ":i386" multiarch modifier on a package name,
causing the dependencyparser to crash in piuparts-report, disabling all p.d.o
reporting.

http://lists.alioth.debian.org/pipermail/piuparts-devel/2014-June/005468.html

Leaving the proper lsb-core behavior to another venue, this change modifies
dependencyparser to be lenient about the ":" modifiers it accepts and strips.
---
 debian/changelog                | 7 ++++++-
 piupartslib/dependencyparser.py | 4 +++-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 8766650..27ce883 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,6 @@
 piuparts (0.59) UNRELEASED; urgency=low

+  [ Holger Levsen ]
   * piuparts.py:
     - set scriptsdir to /etc/piuparts/scripts and run this scripts by default.
     - mount selinuxfs read-only and on new location when possible. Thanks to
@@ -33,7 +34,11 @@ piuparts (0.59) UNRELEASED; urgency=low
     Explicitly state what will break when using cdebootstrap with pbuilder.
     (Closes: #709348)
   * Update various custom-scripts (usually to workaround problems in other
-    packages).
+    packages).
+
+  [David Steele]
+  * dependencyparser.py - Be more lenient about the multi-arch modifiers
+    accepted and stripped by the parser.

  -- Holger Levsen <holger at debian.org>  Thu, 01 May 2014 00:42:23 +0200

diff --git a/piupartslib/dependencyparser.py b/piupartslib/dependencyparser.py
index bf90a22..91943ed 100644
--- a/piupartslib/dependencyparser.py
+++ b/piupartslib/dependencyparser.py
@@ -240,7 +240,9 @@ class DependencyParser:
         return SimpleDependency(name, op, version, arch)

     _name_pat = re.compile(r"[a-zA-Z0-9][a-zA-Z0-9+._-]+")
-    _any_suffix_pat = re.compile(r":any")
+    # The MultiArch spec supports an ":any" modifier. Loosen the
+    # accepted arch's, to avoid crashing.
+    _any_suffix_pat = re.compile(r":[a-zA-Z0-9-]+")

     def _parse_package_name(self):
         self._cursor.skip_whitespace()
-- 
2.0.0


-- 
"Le mieux est l'ennemi du bien" - Voltaire



More information about the Piuparts-devel mailing list