summaryrefslogtreecommitdiff
path: root/cmdline
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2010-04-09 15:38:48 +0200
committerDavid Kalnischkies <kalnischkies@gmail.com>2010-04-09 15:38:48 +0200
commita722b2c5c935768efbdd5b23eed7ce32ccd60908 (patch)
tree2b61b02e562ca7e36b498424caf653a9d90a468e /cmdline
parent1cd1c398d18b78f4aa9d882a5de5385f4538e0be (diff)
* apt-pkg/acquire-item.cc:
- Acquire::ForceHash to force method for expected hash - display MD5Sum in --print-uris if not forced to use another method instead of displaying the strongest available (Closes: #576420)
Diffstat (limited to 'cmdline')
-rw-r--r--cmdline/apt-get.cc13
1 files changed, 11 insertions, 2 deletions
diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc
index 416d316da..7c42e672d 100644
--- a/cmdline/apt-get.cc
+++ b/cmdline/apt-get.cc
@@ -815,8 +815,14 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask = true,
// Create the download object
pkgAcquire Fetcher;
AcqTextStatus Stat(ScreenWidth,_config->FindI("quiet",0));
- if (Fetcher.Setup(&Stat, _config->FindB("APT::Get::Print-URIs", false)
- ? "" : _config->FindDir("Dir::Cache::Archives")) == false)
+ if (_config->FindB("APT::Get::Print-URIs", false) == true)
+ {
+ // force a hashsum for compatibility reasons
+ _config->CndSet("Acquire::ForceHash", "md5sum");
+ if (Fetcher.Setup(&Stat, "") == false)
+ return false;
+ }
+ else if (Fetcher.Setup(&Stat, _config->FindDir("Dir::Cache::Archives")) == false)
return false;
// Read the source list
@@ -1441,6 +1447,9 @@ bool DoUpdate(CommandLine &CmdL)
// Just print out the uris an exit if the --print-uris flag was used
if (_config->FindB("APT::Get::Print-URIs") == true)
{
+ // force a hashsum for compatibility reasons
+ _config->CndSet("Acquire::ForceHash", "md5sum");
+
// get a fetcher
pkgAcquire Fetcher;
if (Fetcher.Setup(&Stat) == false)