summaryrefslogtreecommitdiff
path: root/cmdline
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2014-03-10 14:15:45 +0100
committerDavid Kalnischkies <david@kalnischkies.de>2014-03-13 13:58:46 +0100
commit0d58c26ad7b2308f08f4e6002cbf218605c1c7cf (patch)
tree845c46e158a857831ae75fcda5609da9791fc4cf /cmdline
parent1166ea79889ecd6c88380f7988182647cf787f8f (diff)
improve debug output in case downloadfile fails
Git-Dch: Ignore
Diffstat (limited to 'cmdline')
-rw-r--r--cmdline/apt-helper.cc15
1 files changed, 7 insertions, 8 deletions
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 <apt-private/acqprogress.h>
#include <apt-private/private-output.h>
+#include <apt-private/private-download.h>
#include <apt-private/private-cmndline.h>
#include <iostream>
@@ -27,7 +28,6 @@
#include <apti18n.h>
/*}}}*/
-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"