[Piuparts-commits] [SCM] piuparts git repository branch, master, updated. 0.48-79-gdf94975

Holger Levsen holger at layer-acht.org
Sat Jan 12 11:33:20 UTC 2013


The following commit has been merged in the master branch:
commit 0e8ea22519a37c399f0fb7a3333cadfa8604f731
Author: Andreas Beckmann <debian at abeckmann.de>
Date:   Sat Nov 3 18:02:17 2012 +0100

    p: qualify package names extracted from .debs with the package version
    
    Signed-off-by: Andreas Beckmann <debian at abeckmann.de>

diff --git a/debian/changelog b/debian/changelog
index f143be5..dc44c9d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -15,6 +15,7 @@ piuparts (0.49) UNRELEASED; urgency=low
       package sources, e.g. backports, security or local repositories.
       The argument must be a valid line (including whitespace) that is added
       to sources.list verbatim. The option may be repeated to add more lines.
+    - Qualify to the package names extracted from .debs with the version.
   * piuparts.conf:
   * piupartslib/conf.py:
     - Add get_final_distro() method.
diff --git a/piuparts.py b/piuparts.py
index c120f21..687d872 100644
--- a/piuparts.py
+++ b/piuparts.py
@@ -1959,9 +1959,18 @@ def get_package_names_from_package_files(package_files):
     vlist = []
     for filename in package_files:
         (status, output) = run(["dpkg", "--info", filename])
+        p = None
+        v = None
         for line in [line.lstrip() for line in output.split("\n")]:
-            if line[:len("Package:")] == "Package:":
-                vlist.append(line.split(":", 1)[1].strip())
+            if line.startswith("Package:"):
+                p = line.split(":", 1)[1].strip()
+            if line.startswith("Version:"):
+                v = line.split(":", 1)[1].strip()
+        if p is not None:
+            if v is not None:
+                vlist.append(p + "=" + v)
+            else:
+                vlist.append(p)
     return vlist
 
 # Method to process a changes file, returning a list of all the .deb packages

-- 
piuparts git repository



More information about the Piuparts-commits mailing list