diff options
| author | Julian Andres Klode <julian.klode@canonical.com> | 2024-04-29 15:14:24 +0200 |
|---|---|---|
| committer | Julian Andres Klode <julian.klode@canonical.com> | 2024-04-29 15:26:25 +0200 |
| commit | 84881c1914ca30435ff478b4138cd7559c35c8d1 (patch) | |
| tree | 732ef219ec2b41abbec6bfc6b9e37657af16f61a /apt-private/private-source.cc | |
| parent | 9a29aa8f61530aca8a46d0c6de08ea78c6e57f9e (diff) | |
source, build-dep: Allow specifying src:name
This has the same behavior as --only-source name.
Diffstat (limited to 'apt-private/private-source.cc')
| -rw-r--r-- | apt-private/private-source.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/apt-private/private-source.cc b/apt-private/private-source.cc index 9b9409c80..6280b9fff 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); |
