diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2009-03-09 16:11:29 +0100 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2009-03-09 16:11:29 +0100 |
commit | 89ad8e7c1ad4aa6a90732ea5802a58c799ead189 (patch) | |
tree | 1da6f134daf1ecab39903746e56ea7a89d7f6f9c | |
parent | 51f07d3215a814cba98ed90f2ee4900ba2ba5780 (diff) |
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)
-rw-r--r-- | cmdline/apt-get.cc | 21 | ||||
-rw-r--r-- | debian/changelog | 3 |
2 files changed, 17 insertions, 7 deletions
diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 06fa41017..1c2c11689 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,13 @@ 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(), MarchSrcOnly)) != 0) { string Ver = Parse->Version(); // show name mismatches if (IsMatch == true && Parse->Package() != Src) - ioprintf(c1out, _("No source package '%s' picking '%s' instead"), Parse->Package().c_str(), Src.c_str()); + ioprintf(c1out, _("No source package '%s' picking '%s' instead\n"), Parse->Package().c_str(), Src.c_str()); if (VerTag.empty() == false) { diff --git a/debian/changelog b/debian/changelog index c0da66973..19c06b5e9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -31,6 +31,9 @@ apt (0.7.21) UNRELEASED; urgency=low * cmdline/apt-get.cc: - fix "apt-get source pkg=ver" if binary name != source name and show a message (LP: #202219) + - 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) * apt-pkg/deb/debsystem.cc: - make strings i18n able * apt-pkg/contrib/strutl.cc: |