diff options
author | David Kalnischkies <david@kalnischkies.de> | 2014-09-27 19:45:30 +0200 |
---|---|---|
committer | David Kalnischkies <david@kalnischkies.de> | 2014-09-27 19:45:30 +0200 |
commit | 43acd01979039b248cb7f033b82e36d778d0ebec (patch) | |
tree | a4270b97afceaf8b81c730d8501172773f79c5e5 /cmdline | |
parent | b7ed733f2e473da7f707865675247297cd8dc445 (diff) |
allow fetcher setup without directory creation
apt-get download and changelog as well as apt-helper reuse the acquire
system for their own proposes without requiring the directories the
fetcher wants to create, which is a problem if you run them as non-root
and the directories do not exist as it greets you with:
E: Archives directory /var/cache/apt/archives/partial is missing. -
Acquire (13: Permission denied)
Closes: 762898
Diffstat (limited to 'cmdline')
-rw-r--r-- | cmdline/apt-get.cc | 9 | ||||
-rw-r--r-- | cmdline/apt-helper.cc | 3 |
2 files changed, 7 insertions, 5 deletions
diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index a5cafc39d..6d03c7eec 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -626,14 +626,14 @@ static bool DoDownload(CommandLine &CmdL) APT::CacheSetHelper helper(c0out); APT::VersionSet verset = APT::VersionSet::FromCommandLine(Cache, - CmdL.FileList + 1, APT::VersionSet::CANDIDATE, helper); + CmdL.FileList + 1, APT::CacheSetHelper::CANDIDATE, helper); if (verset.empty() == true) return false; AcqTextStatus Stat(ScreenWidth, _config->FindI("quiet", 0)); pkgAcquire Fetcher; - if (Fetcher.Setup(&Stat) == false) + if (Fetcher.Setup(&Stat, "", false) == false) return false; pkgRecords Recs(Cache); @@ -1536,7 +1536,7 @@ static bool DoChangelog(CommandLine &CmdL) APT::CacheSetHelper helper(c0out); APT::VersionList verset = APT::VersionList::FromCommandLine(Cache, - CmdL.FileList + 1, APT::VersionList::CANDIDATE, helper); + CmdL.FileList + 1, APT::CacheSetHelper::CANDIDATE, helper); if (verset.empty() == true) return false; pkgAcquire Fetcher; @@ -1551,7 +1551,8 @@ static bool DoChangelog(CommandLine &CmdL) } AcqTextStatus Stat(ScreenWidth, _config->FindI("quiet",0)); - Fetcher.Setup(&Stat); + if (Fetcher.Setup(&Stat, "",false) == false) + return false; bool const downOnly = _config->FindB("APT::Get::Download-Only", false); diff --git a/cmdline/apt-helper.cc b/cmdline/apt-helper.cc index dd43ea1bc..b89df61d6 100644 --- a/cmdline/apt-helper.cc +++ b/cmdline/apt-helper.cc @@ -51,7 +51,8 @@ static bool DoDownloadFile(CommandLine &CmdL) pkgAcquire Fetcher; AcqTextStatus Stat(ScreenWidth, _config->FindI("quiet",0)); - Fetcher.Setup(&Stat); + if (Fetcher.Setup(&Stat, "", false) == false) + return false; std::string download_uri = CmdL.FileList[1]; std::string targetfile = CmdL.FileList[2]; std::string hash; |