From c3ccac9232c2684b15f75fa8622a9a290aeca123 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 27 Feb 2014 03:11:54 +0100 Subject: warning: no previous declaration for foobar() [-Wmissing-declarations] Git-Dch: Ignore Reported-By: gcc -Wmissing-declarations --- cmdline/apt-helper.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cmdline/apt-helper.cc') diff --git a/cmdline/apt-helper.cc b/cmdline/apt-helper.cc index c1c8b2178..d8ea0435a 100644 --- a/cmdline/apt-helper.cc +++ b/cmdline/apt-helper.cc @@ -33,7 +33,7 @@ /*}}}*/ using namespace std; -bool DoDownloadFile(CommandLine &CmdL) +static bool DoDownloadFile(CommandLine &CmdL) { if (CmdL.FileSize() <= 2) return _error->Error(_("Must specify at least one pair url/filename")); @@ -55,7 +55,7 @@ bool DoDownloadFile(CommandLine &CmdL) return true; } -bool ShowHelp(CommandLine &CmdL) +static bool ShowHelp(CommandLine &CmdL) { ioprintf(cout,_("%s %s for %s compiled on %s %s\n"),PACKAGE,PACKAGE_VERSION, COMMON_ARCH,__DATE__,__TIME__); -- cgit v1.2.3 From 655122418d714f342b5d9789f45f8035f3fe8b9a Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 1 Mar 2014 15:11:42 +0100 Subject: =?UTF-8?q?warning:=20unused=20parameter=20=E2=80=98foo=E2=80=99?= =?UTF-8?q?=20[-Wunused-parameter]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reported-By: gcc -Wunused-parameter Git-Dch: Ignore --- cmdline/apt-helper.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmdline/apt-helper.cc') diff --git a/cmdline/apt-helper.cc b/cmdline/apt-helper.cc index d8ea0435a..8ff2fa037 100644 --- a/cmdline/apt-helper.cc +++ b/cmdline/apt-helper.cc @@ -55,7 +55,7 @@ static bool DoDownloadFile(CommandLine &CmdL) return true; } -static bool ShowHelp(CommandLine &CmdL) +static bool ShowHelp(CommandLine &) { ioprintf(cout,_("%s %s for %s compiled on %s %s\n"),PACKAGE,PACKAGE_VERSION, COMMON_ARCH,__DATE__,__TIME__); -- cgit v1.2.3 From 453b82a388013e522b3a1b9fcd6ed0810dab1f4f Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 5 Mar 2014 22:11:25 +0100 Subject: cleanup headers and especially #includes everywhere Beside being a bit cleaner it hopefully also resolves oddball problems I have with high levels of parallel jobs. Git-Dch: Ignore Reported-By: iwyu (include-what-you-use) --- cmdline/apt-helper.cc | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'cmdline/apt-helper.cc') diff --git a/cmdline/apt-helper.cc b/cmdline/apt-helper.cc index 8ff2fa037..d66b3ffae 100644 --- a/cmdline/apt-helper.cc +++ b/cmdline/apt-helper.cc @@ -7,6 +7,7 @@ // Include Files /*{{{*/ #include +#include #include #include #include @@ -20,14 +21,9 @@ #include #include -#include -#include -#include -#include -#include -#include - - +#include +#include +#include #include /*}}}*/ -- cgit v1.2.3 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/apt-helper.cc') 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