Browse Source

* apt-pkg/deb/debversion.cc:

- applied patch from Lionel Elie Mamane to fix epoch handling 
    (debian: #363358)
tags/debian/0.7.21
Michael Vogt 15 years ago
parent
commit
9373b9752d
4 changed files with 35 additions and 3 deletions
  1. +22
    -1
      apt-pkg/deb/debversion.cc
  2. +5
    -1
      debian/changelog
  3. +1
    -1
      test/testdeb.cc
  4. +7
    -0
      test/versions.lst

+ 22
- 1
apt-pkg/deb/debversion.cc View 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)


+ 5
- 1
debian/changelog View File

@@ -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



+ 1
- 1
test/testdeb.cc View 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;


+ 7
- 0
test/versions.lst View 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


Loading…
Cancel
Save