* merged the zero epoch handling patch
authorMichael Vogt <egon@bottom>
Mon, 8 May 2006 20:33:59 +0000 (22:33 +0200)
committerMichael Vogt <egon@bottom>
Mon, 8 May 2006 20:33:59 +0000 (22:33 +0200)
apt-pkg/deb/debversion.cc
debian/changelog
test/testdeb.cc
test/versions.lst

index aeee619..064d8fa 100644 (file)
@@ -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)
index c9f4107..9632eda 100644 (file)
@@ -27,8 +27,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 <mvo@debian.org>  Mon,  8 May 2006 18:41:04 +0200
+ -- Michael Vogt <mvo@debian.org>  Mon,  8 May 2006 22:28:53 +0200
 
 apt (0.6.43.3) unstable; urgency=low
 
index 5986621..d28f201 100644 (file)
@@ -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;   
index 008a0f2..efc19c4 100644 (file)
@@ -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