summaryrefslogtreecommitdiffstats
path: root/apt-private/private-show.cc
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-14 19:18:38 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-14 19:18:38 +0000
commitb81238fa02b2348f3fbb90e4d5e54a3ad8d78ac4 (patch)
treebf5624f8edc149dca9d78bfa8bcbf2d493c8b128 /apt-private/private-show.cc
parentAdding upstream version 2.9.2. (diff)
downloadapt-b81238fa02b2348f3fbb90e4d5e54a3ad8d78ac4.tar.xz
apt-b81238fa02b2348f3fbb90e4d5e54a3ad8d78ac4.zip
Adding upstream version 2.9.3.upstream/2.9.3
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'apt-private/private-show.cc')
-rw-r--r--apt-private/private-show.cc14
1 files changed, 11 insertions, 3 deletions
diff --git a/apt-private/private-show.cc b/apt-private/private-show.cc
index 4ae0430..ceef670 100644
--- a/apt-private/private-show.cc
+++ b/apt-private/private-show.cc
@@ -446,14 +446,22 @@ bool ShowSrcPackage(CommandLine &CmdL) /*{{{*/
std::set<std::string> seen;
for (const char **I = CmdL.FileList + 1; *I != 0; I++)
{
+ const char *pkgname = *I;
SrcRecs.Restart();
pkgSrcRecords::Parser *Parse;
bool found_this = false;
- while ((Parse = SrcRecs.Find(*I,false)) != 0) {
+ bool only_source = _config->FindB("APT::Cache::Only-Source", false);
+ if (APT::String::Startswith(pkgname, "src:"))
+ {
+ only_source = true;
+ pkgname += 4;
+ }
+ while ((Parse = SrcRecs.Find(pkgname, false)) != 0)
+ {
// SrcRecs.Find() will find both binary and source names
- if (_config->FindB("APT::Cache::Only-Source", false) == true)
- if (Parse->Package() != *I)
+ if (only_source)
+ if (Parse->Package() != pkgname)
continue;
std::string sha1str = Sha1FromString(Parse->AsStr());
if (std::find(seen.begin(), seen.end(), sha1str) == seen.end())