summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2005-10-19 13:51:20 +0000
committerMichael Vogt <michael.vogt@ubuntu.com>2005-10-19 13:51:20 +0000
commitce6162bed91fd2e508d751d3d88dd16f3d97c8d3 (patch)
treeb12bd5bf9ebdb58d760f7eeb9efb81708d08a82d
parentd87116efb8c7382cc463f5208277470fce129d12 (diff)
* don't get candidate release as version tag for FindSrc by default. because it break for bin-NMUs :/ (e.g. dpkg source is 1.13.11, but i386 version string is 1.13.11.0.1)
-rw-r--r--cmdline/apt-get.cc18
1 files changed, 5 insertions, 13 deletions
diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc
index 3ffb740a6..6e17611cb 100644
--- a/cmdline/apt-get.cc
+++ b/cmdline/apt-get.cc
@@ -1191,15 +1191,9 @@ pkgSrcRecords::Parser *FindSrc(const char *Name,pkgRecords &Recs,
string TmpSrc = Name;
string::size_type Slash = TmpSrc.rfind('=');
- // honor pining and default release
+ // honor default release
string DefRel = _config->Find("APT::Default-Release");
-
pkgCache::PkgIterator Pkg = Cache.FindPkg(TmpSrc);
- pkgCache::VerIterator CandVer = Cache.GetCandidateVer(Pkg);
- if(Pkg.end() == false)
- {
- VerTag = CandVer.VerStr();
- }
if (Slash != string::npos)
{
@@ -1243,9 +1237,10 @@ pkgSrcRecords::Parser *FindSrc(const char *Name,pkgRecords &Recs,
{
if (Pkg.end() == false)
{
- if (CandVer.end() == false)
+ pkgCache::VerIterator Ver = Cache.GetCandidateVer(Pkg);
+ if (Ver.end() == false)
{
- pkgRecords::Parser &Parse = Recs.Lookup(CandVer.FileList());
+ pkgRecords::Parser &Parse = Recs.Lookup(Ver.FileList());
Src = Parse.SourcePkg();
}
}
@@ -1300,10 +1295,7 @@ pkgSrcRecords::Parser *FindSrc(const char *Name,pkgRecords &Recs,
}
}
- if (Last == 0)
- return 0;
-
- if (Last->Jump(Offset) == false)
+ if (Last == 0 || Last->Jump(Offset) == false)
return 0;
return Last;