summaryrefslogtreecommitdiff
path: root/cmdline/apt-get.cc
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2009-04-09 04:36:34 +0200
committerMichael Vogt <mvo@debian.org>2009-04-09 04:36:34 +0200
commit09fab2442c2ab9a503841d3dcd56b3c0c3efb502 (patch)
tree7473091ab3ea6685e2244fdddec31d79ebfe3fd7 /cmdline/apt-get.cc
parenta06f61bbb328ee218afbd367248f6f2338186e19 (diff)
* apt-pkg/contrib/strutl.cc:
- fix TimeToStr i18n (LP: #289807) * [ABI break] merge support for http redirects, thanks to Jeff Licquia and Anthony Towns * [ABI break] use int for the package IDs (thanks to Steve Cotton) * apt-pkg/pkgcache.cc: - do not run "dpkg --configure pkg" if pkg is in trigger-awaited state (LP: #322955) * methods/https.cc: - add Acquire::https::AllowRedirect support * Clarify the --help for 'purge' (LP: #243948) * cmdline/apt-get.cc - fix "apt-get source pkg" if there is a binary package and a source package of the same name but from different packages (LP: #330103) * cmdline/acqprogress.cc: - Call pkgAcquireStatus::Pulse even if quiet, so that we still get dlstatus messages on the status-fd (LP: #290234).
Diffstat (limited to 'cmdline/apt-get.cc')
-rw-r--r--cmdline/apt-get.cc25
1 files changed, 15 insertions, 10 deletions
diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc
index a7221d47d..ccf53ed25 100644
--- a/cmdline/apt-get.cc
+++ b/cmdline/apt-get.cc
@@ -1272,16 +1272,23 @@ pkgSrcRecords::Parser *FindSrc(const char *Name,pkgRecords &Recs,
}
}
}
-
- // No source package name..
- if (Src.empty() == true)
- Src = TmpSrc;
-
+
// The best hit
pkgSrcRecords::Parser *Last = 0;
unsigned long Offset = 0;
string Version;
bool IsMatch = false;
+ bool MatchSrcOnly = false;
+
+ // No source package name..
+ if (Src.empty() == true)
+ Src = TmpSrc;
+ else
+ // if we have a source pkg name, make sure to only search
+ // for srcpkg names, otherwise apt gets confused if there
+ // is a binary package "pkg1" and a source package "pkg1"
+ // with the same name but that comes from different packages
+ MatchSrcOnly = true;
// If we are matching by version then we need exact matches to be happy
if (VerTag.empty() == false)
@@ -1291,13 +1298,11 @@ pkgSrcRecords::Parser *FindSrc(const char *Name,pkgRecords &Recs,
binary packages in the search */
pkgSrcRecords::Parser *Parse;
SrcRecs.Restart();
- while ((Parse = SrcRecs.Find(Src.c_str(),false)) != 0)
+ while ((Parse = SrcRecs.Find(Src.c_str(), MatchSrcOnly)) != 0)
{
string Ver = Parse->Version();
- // Skip name mismatches
- if (IsMatch == true && Parse->Package() != Src)
- continue;
+ ioprintf(c1out, _("No source package '%s' picking '%s' instead\n"), Parse->Package().c_str(), Src.c_str());
if (VerTag.empty() == false)
{
@@ -2632,7 +2637,7 @@ bool ShowHelp(CommandLine &CmdL)
" install - Install new packages (pkg is libc6 not libc6.deb)\n"
" remove - Remove packages\n"
" autoremove - Remove automatically all unused packages\n"
- " purge - Remove and purge packages\n"
+ " purge - Remove packages and config files\n"
" source - Download source archives\n"
" build-dep - Configure build-dependencies for source packages\n"
" dist-upgrade - Distribution upgrade, see apt-get(8)\n"