summaryrefslogtreecommitdiff
path: root/cmdline/apt-helper.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2014-09-27 19:45:30 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2014-09-27 19:45:30 +0200
commit43acd01979039b248cb7f033b82e36d778d0ebec (patch)
treea4270b97afceaf8b81c730d8501172773f79c5e5 /cmdline/apt-helper.cc
parentb7ed733f2e473da7f707865675247297cd8dc445 (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/apt-helper.cc')
-rw-r--r--cmdline/apt-helper.cc3
1 files changed, 2 insertions, 1 deletions
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;