summaryrefslogtreecommitdiffstats
path: root/apt-private/private-source.cc
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-14 19:18:39 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-14 19:18:39 +0000
commit6b271185e965779bc07e68383204992b21f675e7 (patch)
treeb9f50ef851c4be5fa076284b72500dc70a7d2d5b /apt-private/private-source.cc
parentAdding debian version 2.9.2. (diff)
downloadapt-6b271185e965779bc07e68383204992b21f675e7.tar.xz
apt-6b271185e965779bc07e68383204992b21f675e7.zip
Merging upstream version 2.9.3.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--apt-private/private-source.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/apt-private/private-source.cc b/apt-private/private-source.cc
index 9b9409c..6280b9f 100644
--- a/apt-private/private-source.cc
+++ b/apt-private/private-source.cc
@@ -77,7 +77,14 @@ static pkgSrcRecords::Parser *FindSrc(const char *Name,
std::string ArchTag = "";
std::string RelTag = _config->Find("APT::Default-Release");
std::string TmpSrc = Name;
+ bool MatchSrcOnly = _config->FindB("APT::Get::Only-Source");
+ // Check if we should look by source package
+ if (APT::String::Startswith(TmpSrc, "src:"))
+ {
+ MatchSrcOnly = true;
+ TmpSrc = TmpSrc.substr(4);
+ }
// extract release
size_t found = TmpSrc.find_last_of("/");
if (found != std::string::npos)
@@ -103,7 +110,6 @@ static pkgSrcRecords::Parser *FindSrc(const char *Name,
/* Lookup the version of the package we would install if we were to
install a version and determine the source package name, then look
in the archive for a source package of the same name. */
- bool MatchSrcOnly = _config->FindB("APT::Get::Only-Source");
pkgCache::PkgIterator Pkg;
if (ArchTag != "")
Pkg = Cache.GetPkgCache()->FindPkg(TmpSrc, ArchTag);