Browse Source

Fixed apt-get source, dpkg/dpkg-hurd case
Author: jgg
Date: 1999-05-20 05:53:38 GMT
Fixed apt-get source, dpkg/dpkg-hurd case

Arch Librarian 22 years ago
parent
commit
73c2c61beb
2 changed files with 12 additions and 2 deletions
  1. 11 2
      cmdline/apt-get.cc
  2. 1 0
      debian/changelog

+ 11 - 2
cmdline/apt-get.cc

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
-// $Id: apt-get.cc,v 1.58 1999/05/13 03:09:33 jgg Exp $
+// $Id: apt-get.cc,v 1.59 1999/05/20 05:53:38 jgg Exp $
 /* ######################################################################
    
    apt-get - Cover for dpkg
@@ -1112,6 +1112,7 @@ bool DoSource(CommandLine &CmdL)
       pkgSrcRecords::Parser *Last = 0;
       unsigned long Offset = 0;
       string Version;
+      bool IsMatch = false;
 	 
       // Iterate over all of the hits
       pkgSrcRecords::Parser *Parse;
@@ -1119,8 +1120,16 @@ bool DoSource(CommandLine &CmdL)
       while ((Parse = SrcRecs.Find(Src.c_str(),false)) != 0)
       {
 	 string Ver = Parse->Version();
-	 if (Last == 0 || pkgVersionCompare(Version,Ver) < 0)
+	 
+	 // Skip name mismatches
+	 if (IsMatch == true && Parse->Package() != Src)
+	    continue;
+
+	 // Newer version or an exact match
+	 if (Last == 0 || pkgVersionCompare(Version,Ver) < 0 || 
+	     (Parse->Package() == Src && IsMatch == false))
 	 {
+	    IsMatch = Parse->Package() == Src;
 	    Last = Parse;
 	    Offset = Parse->Offset();
 	    Version = Ver;

+ 1 - 0
debian/changelog

@@ -7,6 +7,7 @@ apt (0.3.6.1) unstable; urgency=low
     Closes: #37499
   * Man page typo Closes: #37762
   * Fixed parsing of the Source: line. Closes: #37679
+  * Dpkg/dpkg-hurd source bug. Closes: #38004
   
  -- Jason Gunthorpe <jgg@debian.org>  Wed, 12 May 1999 09:18:49 -0700