summaryrefslogtreecommitdiff
path: root/cmdline
diff options
context:
space:
mode:
authorArch Librarian <arch@canonical.com>2004-09-20 16:53:45 +0000
committerArch Librarian <arch@canonical.com>2004-09-20 16:53:45 +0000
commit73c2c61beb6b2fb4a7685f04d2b0e17d5a934504 (patch)
tree3a57cf07b01e9cf93901a8614da2f69dda356b8c /cmdline
parent04f232fc729cabe3739fad8f107bb7bef674542b (diff)
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
Diffstat (limited to 'cmdline')
-rw-r--r--cmdline/apt-get.cc13
1 files changed, 11 insertions, 2 deletions
diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc
index f15766565..ea56e4c22 100644
--- a/cmdline/apt-get.cc
+++ b/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;