diff options
Diffstat (limited to 'cmdline')
-rw-r--r-- | cmdline/apt-config.cc | 13 | ||||
-rw-r--r-- | cmdline/apt-get.cc | 2 |
2 files changed, 15 insertions, 0 deletions
diff --git a/cmdline/apt-config.cc b/cmdline/apt-config.cc index 9919a9c94..589ee7ada 100644 --- a/cmdline/apt-config.cc +++ b/cmdline/apt-config.cc @@ -20,6 +20,8 @@ #include <apt-pkg/error.h> #include <apt-pkg/init.h> #include <apt-pkg/strutl.h> +#include <apt-pkg/configuration.h> +#include <apt-pkg/aptconfiguration.h> #include <config.h> #include <apti18n.h> @@ -27,6 +29,7 @@ #include <locale.h> #include <iostream> #include <string> +#include <vector> /*}}}*/ using namespace std; @@ -119,6 +122,16 @@ int main(int argc,const char *argv[]) /*{{{*/ CmdL.FileSize() == 0) return ShowHelp(); + std::vector<std::string> const langs = APT::Configuration::getLanguages(true); + _config->Clear("Acquire::Languages"); + for (std::vector<std::string>::const_iterator l = langs.begin(); l != langs.end(); ++l) + _config->Set("Acquire::Languages::", *l); + + std::vector<std::string> const archs = APT::Configuration::getArchitectures(); + _config->Clear("APT::Architectures"); + for (std::vector<std::string>::const_iterator a = archs.begin(); a != archs.end(); ++a) + _config->Set("APT::Architectures::", *a); + // Match the operation CmdL.DispatchArg(Cmds); diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 65eaef0d8..66ebd30b8 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -2299,6 +2299,8 @@ bool DoDownload(CommandLine &CmdL) strprintf(descr, _("Downloading %s %s"), Pkg.Name(), Ver.VerStr()); // get the most appropriate hash HashString hash; + if (rec.SHA512Hash() != "") + hash = HashString("sha512", rec.SHA512Hash()); if (rec.SHA256Hash() != "") hash = HashString("sha256", rec.SHA256Hash()); else if (rec.SHA1Hash() != "") |