From 0d58c26ad7b2308f08f4e6002cbf218605c1c7cf Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 10 Mar 2014 14:15:45 +0100 Subject: improve debug output in case downloadfile fails Git-Dch: Ignore --- cmdline/apt-helper.cc | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'cmdline') diff --git a/cmdline/apt-helper.cc b/cmdline/apt-helper.cc index d66b3ffae..37279ec28 100644 --- a/cmdline/apt-helper.cc +++ b/cmdline/apt-helper.cc @@ -19,6 +19,7 @@ #include #include +#include #include #include @@ -27,7 +28,6 @@ #include /*}}}*/ -using namespace std; static bool DoDownloadFile(CommandLine &CmdL) { @@ -43,23 +43,22 @@ static bool DoDownloadFile(CommandLine &CmdL) new pkgAcqFile(&Fetcher, download_uri, "", 0, "desc", "short-desc", "dest-dir-ignored", targetfile); Fetcher.Run(); - if (!FileExists(targetfile)) - { - _error->Error(_("Download Failed")); - return false; - } + bool Failed = false; + if (AcquireRun(Fetcher, 0, &Failed, NULL) == false || Failed == false || + FileExists(targetfile) == false) + return _error->Error(_("Download Failed")); return true; } static bool ShowHelp(CommandLine &) { - ioprintf(cout,_("%s %s for %s compiled on %s %s\n"),PACKAGE,PACKAGE_VERSION, + ioprintf(std::cout,_("%s %s for %s compiled on %s %s\n"),PACKAGE,PACKAGE_VERSION, COMMON_ARCH,__DATE__,__TIME__); if (_config->FindB("version") == true) return true; - cout << + std::cout << _("Usage: apt-helper [options] command\n" " apt-helper [options] download-file uri target-path\n" "\n" -- cgit v1.2.3