summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2006-05-08 22:27:07 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2006-05-08 22:27:07 +0200
commit9373b9752db017bc8458720f330dc9594ac8de17 (patch)
treefd9362c5203d971afc65cab7e29471a099dc7202
parentfc5f54175a514c31c9400d9f9d08e6496cf63823 (diff)
* apt-pkg/deb/debversion.cc:
- applied patch from Lionel Elie Mamane to fix epoch handling (debian: #363358)
-rw-r--r--apt-pkg/deb/debversion.cc23
-rw-r--r--debian/changelog6
-rw-r--r--test/testdeb.cc2
-rw-r--r--test/versions.lst7
4 files changed, 35 insertions, 3 deletions
diff --git a/apt-pkg/deb/debversion.cc b/apt-pkg/deb/debversion.cc
index aeee61929..064d8fa5b 100644
--- a/apt-pkg/deb/debversion.cc
+++ b/apt-pkg/deb/debversion.cc
@@ -59,7 +59,7 @@ int debVersioningSystem::CmpFragment(const char *A,const char *AEnd,
}
/* Iterate over the whole string
- What this does is to spilt the whole string into groups of
+ What this does is to split the whole string into groups of
numeric and non numeric portions. For instance:
a67bhgs89
Has 4 portions 'a', '67', 'bhgs', '89'. A more normal:
@@ -140,6 +140,27 @@ int debVersioningSystem::DoCmpVersion(const char *A,const char *AEnd,
if (rhs == BEnd)
rhs = B;
+ // Special case: a zero epoch is the same as no epoch,
+ // so remove it.
+ if (lhs != A)
+ {
+ for (; *A == '0'; ++A);
+ if (A == lhs)
+ {
+ ++A;
+ ++lhs;
+ }
+ }
+ if (rhs != B)
+ {
+ for (; *B == '0'; ++B);
+ if (B == rhs)
+ {
+ ++B;
+ ++rhs;
+ }
+ }
+
// Compare the epoch
int Res = CmpFragment(A,lhs,B,rhs);
if (Res != 0)
diff --git a/debian/changelog b/debian/changelog
index 034702090..1412fe74e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -22,8 +22,12 @@ apt (0.6.44) unstable; urgency=low
* methods/ftp.cc:
- unlink empty file in partial if the download failed because
the file is missing on the server (closes: #316337)
+ * apt-pkg/deb/debversion.cc:
+ - treats a version string with explicit zero epoch equal
+ than the same without epoch (Policy 5.6.12, closes: #363358)
+ Thanks to Lionel Elie Mamane for the patch
- --
+ -- Michael Vogt <michael.vogt@ubuntu.com> Mon, 8 May 2006 22:04:43 +0200
apt (0.6.43.3) unstable; urgency=low
diff --git a/test/testdeb.cc b/test/testdeb.cc
index 5986621bb..d28f20114 100644
--- a/test/testdeb.cc
+++ b/test/testdeb.cc
@@ -23,7 +23,7 @@ bool Test(const char *File)
return false;
// Extract it.
- ExtractTar Tar(Deb.GetFile(),Member->Size);
+ ExtractTar Tar(Deb.GetFile(),Member->Size, "gzip");
NullStream Dir;
if (Tar.Go(Dir) == false)
return false;
diff --git a/test/versions.lst b/test/versions.lst
index 008a0f2d7..efc19c4f0 100644
--- a/test/versions.lst
+++ b/test/versions.lst
@@ -20,6 +20,13 @@ z . -1
# Epochs
1:0.4 10.3 1
1:1.25-4 1:1.25-8 -1
+0:1.18.36 1.18.36 0
+
+# Funky, but allowed, characters in upstream version
+9:1.18.36:5.4-20 10:0.5.1-22 -1
+9:1.18.36:5.4-20 9:1.18.36:5.5-1 -1
+9:1.18.36:5.4-20 9:1.18.37:4.3-22 -1
+1.18.36-0.17.35-18 1.18.36-19 1
# Junk
1:1.2.13-3 1:1.2.13-3.1 -1