The following commit has been merged in the master branch:
commit 834f83e490eb1c2907adf67a2b43a04ccd900b9e
Author: Raphaël Hertzog <[email protected]>
Date:   Wed Dec 21 10:02:36 2011 +0100

    dpkg-mergechangelogs: do not error out on invalid versions
    
    The usage of version_compare() has the side effect of erroring out as
    soon as you encounter an invalid version. Replacing this call
    with a comparison operator invoked on Dpkg::Version objects fixes
    the issue.
    
    Closes: #651993
    Reported-by: Martin Packman <[email protected]>

diff --git a/debian/changelog b/debian/changelog
index 9410c49..3866df3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -62,6 +62,8 @@ dpkg (1.16.2) UNRELEASED; urgency=low
     it assumes all build dependencies must be satisfied on the listed
     architecture. Closes: #648180 Thanks to Colin Watson for the patch.
   * Error out if a dpkg database .list file is not a regular file. LP: #369898
+  * Fix dpkg-mergechangelogs to not error out on invalid versions.
+    Closes: #651993
 
   [ Jonathan Nieder ]
   * Bump po4a version in Build-Depends to 0.41, since earlier versions do
diff --git a/scripts/dpkg-mergechangelogs.pl b/scripts/dpkg-mergechangelogs.pl
index a3ddeec..1729368 100755
--- a/scripts/dpkg-mergechangelogs.pl
+++ b/scripts/dpkg-mergechangelogs.pl
@@ -179,7 +179,9 @@ sub compare_versions {
        $a =~ s/~[^~]*$//;
        $b =~ s/~[^~]*$//;
     }
-    return version_compare($a, $b);
+    $a = Dpkg::Version->new($a);
+    $b = Dpkg::Version->new($b);
+    return $a <=> $b;
 }
 
 # Merge changelog entries smartly by merging individually the different

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to