diff options
| author | наб <nabijaczleweli@nabijaczleweli.xyz> | 2025-01-23 20:50:39 +0100 |
|---|---|---|
| committer | Julian Andres Klode <julian.klode@canonical.com> | 2025-02-14 19:45:12 +0100 |
| commit | 729a5c8f4fb8c841497d26170e1a47c41617ecd9 (patch) | |
| tree | 3d9e97b68a2a9706ce7295e0b056a053449b39cc /apt-private | |
| parent | 384cfa1fe9dfd30b35d6f8b0ae87be643ab75d06 (diff) | |
string{=> _view} flNotDir(string{=> _view}). Configuration::{Cnd,}Set(Value: string{=> _view})
Diffstat (limited to 'apt-private')
| -rw-r--r-- | apt-private/private-cmndline.cc | 4 | ||||
| -rw-r--r-- | apt-private/private-download.cc | 3 | ||||
| -rw-r--r-- | apt-private/private-source.cc | 2 | ||||
| -rw-r--r-- | apt-private/private-sources.cc | 6 | ||||
| -rw-r--r-- | apt-private/private-update.cc | 2 |
5 files changed, 9 insertions, 8 deletions
diff --git a/apt-private/private-cmndline.cc b/apt-private/private-cmndline.cc index cbf787aa9..67a34a2c7 100644 --- a/apt-private/private-cmndline.cc +++ b/apt-private/private-cmndline.cc @@ -487,7 +487,7 @@ static bool ShowCommonHelp(APT_CMD const Binary, CommandLine &CmdL, std::vector< /*}}}*/ static void BinarySpecificConfiguration(char const * const Binary) /*{{{*/ { - std::string const binary = flNotDir(Binary); + auto const binary = flNotDir(Binary); if (binary == "apt-cdrom" || binary == "apt-config") { _config->CndSet("Binary::apt-cdrom::APT::Internal::OpProgress::EraseLines", false); @@ -522,7 +522,7 @@ static void BinarySpecificConfiguration(char const * const Binary) /*{{{*/ /*}}}*/ static void BinaryCommandSpecificConfiguration(char const * const Binary, char const * const Cmd)/*{{{*/ { - std::string const binary = flNotDir(Binary); + auto const binary = flNotDir(Binary); if ((binary == "apt" || binary == "apt-get") && CmdMatches("upgrade", "dist-upgrade", "full-upgrade")) { //FIXME: the option is documented to apply only for install/remove, so diff --git a/apt-private/private-download.cc b/apt-private/private-download.cc index 338ffae9b..e3d425283 100644 --- a/apt-private/private-download.cc +++ b/apt-private/private-download.cc @@ -197,7 +197,8 @@ bool DoDownload(CommandLine &CmdL) pkgAcquire::Item *I = new pkgAcqArchive(&Fetcher, SrcList, &Recs, *Ver, storefile[i]); if (storefile[i].empty()) continue; - std::string const filename = cwd + flNotDir(storefile[i]); + auto filename = cwd; + filename += flNotDir(storefile[i]); storefile[i].assign(filename); I->DestFile.assign(filename); } diff --git a/apt-private/private-source.cc b/apt-private/private-source.cc index 6280b9fff..ac52de9e9 100644 --- a/apt-private/private-source.cc +++ b/apt-private/private-source.cc @@ -423,7 +423,7 @@ bool DoSource(CommandLine &CmdL) queued.insert(Last->Index().ArchiveURI(I->Path)); // check if we have a file with that md5 sum already localy - std::string localFile = flNotDir(I->Path); + std::string localFile{flNotDir(I->Path)}; if (FileExists(localFile) == true) if(I->Hashes.VerifyFile(localFile) == true) { diff --git a/apt-private/private-sources.cc b/apt-private/private-sources.cc index b887efca5..9e6deb1ce 100644 --- a/apt-private/private-sources.cc +++ b/apt-private/private-sources.cc @@ -24,7 +24,7 @@ #include <apti18n.h> -using std::operator""sv; +using namespace std::literals; /* Interface discussion with donkult (for the future): apt [add-{archive,release,component}|edit|change-release|disable]-sources @@ -192,9 +192,9 @@ static bool Modernize(std::string const &filename) /*{{{*/ if (FileExists(dir + keyring)) e.signedBy = dir + keyring; } - if (auto k = _config->FindDir("Dir::Etc::trustedparts") + flNotDir(std::regex_replace(filename, std::regex("\\.list$"), ".gpg")); FileExists(k)) + if (auto k = _config->FindDir("Dir::Etc::trustedparts") += flNotDir(std::regex_replace(filename, std::regex("\\.list$"), ".gpg")); FileExists(k)) e.signedBy = k; - if (auto k = _config->FindDir("Dir::Etc::trustedparts") + flNotDir(std::regex_replace(filename, std::regex("\\.list$"), ".asc")); FileExists(k)) + if (auto k = _config->FindDir("Dir::Etc::trustedparts") += flNotDir(std::regex_replace(filename, std::regex("\\.list$"), ".asc")); FileExists(k)) e.signedBy = k; if (isMain && not meta->GetOrigin().empty()) diff --git a/apt-private/private-update.cc b/apt-private/private-update.cc index bd8823568..98961966e 100644 --- a/apt-private/private-update.cc +++ b/apt-private/private-update.cc @@ -58,7 +58,7 @@ bool DoUpdate() pkgAcquire::UriIterator I = Fetcher.UriBegin(); for (; I != Fetcher.UriEnd(); ++I) { - std::string FileName = flNotDir(I->Owner->DestFile); + auto FileName = flNotDir(I->Owner->DestFile); if(compExt.empty() == false && APT::String::Endswith(FileName, compExt)) FileName = FileName.substr(0, FileName.size() - compExt.size() - 1); |
