#include <apt-pkg/cmndline.h>
#include <apt-pkg/error.h>
#include <apt-pkg/init.h>
#include <apt-pkg/cmndline.h>
#include <apt-pkg/error.h>
#include <apt-pkg/init.h>
new pkgAcqFile(&Fetcher, download_uri, "", 0, "desc", "short-desc",
"dest-dir-ignored", targetfile);
Fetcher.Run();
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"));
- 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;
COMMON_ARCH,__DATE__,__TIME__);
if (_config->FindB("version") == true)
return true;