diff options
Diffstat (limited to 'cmdline')
-rw-r--r-- | cmdline/CMakeLists.txt | 8 | ||||
-rw-r--r-- | cmdline/apt-cache.cc | 9 | ||||
-rw-r--r-- | cmdline/apt-get.cc | 1 | ||||
-rw-r--r-- | cmdline/apt-helper.cc | 34 | ||||
-rw-r--r-- | cmdline/apt-mark.cc | 4 |
5 files changed, 38 insertions, 18 deletions
diff --git a/cmdline/CMakeLists.txt b/cmdline/CMakeLists.txt index 8977b45d1..d82239bee 100644 --- a/cmdline/CMakeLists.txt +++ b/cmdline/CMakeLists.txt @@ -29,10 +29,10 @@ target_link_libraries(apt-cdrom apt-pkg apt-private) target_link_libraries(apt-helper apt-pkg apt-private) target_link_libraries(apt-mark apt-pkg apt-private) target_link_libraries(apt-sortpkgs apt-pkg apt-private) -target_link_libraries(apt-extracttemplates apt-pkg apt-inst apt-private) -target_link_libraries(apt-internal-solver apt-pkg apt-inst apt-private) -target_link_libraries(apt-dump-solver apt-pkg apt-inst apt-private) -target_link_libraries(apt-internal-planner apt-pkg apt-inst apt-private) +target_link_libraries(apt-extracttemplates apt-pkg apt-private) +target_link_libraries(apt-internal-solver apt-pkg apt-private) +target_link_libraries(apt-dump-solver apt-pkg apt-private) +target_link_libraries(apt-internal-planner apt-pkg apt-private) set_target_properties(apt-dump-solver PROPERTIES RUNTIME_OUTPUT_DIRECTORY solvers diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc index 3c0e477b1..499c9edc9 100644 --- a/cmdline/apt-cache.cc +++ b/cmdline/apt-cache.cc @@ -33,7 +33,6 @@ #include <apt-pkg/policy.h> #include <apt-pkg/progress.h> #include <apt-pkg/sourcelist.h> -#include <apt-pkg/sptr.h> #include <apt-pkg/srcrecords.h> #include <apt-pkg/strutl.h> #include <apt-pkg/tagfile.h> @@ -596,8 +595,8 @@ static bool XVcg(CommandLine &CmdL) // Load the list of packages from the command line into the show list APT::CacheSetHelper helper(true, GlobalError::NOTICE); std::list<APT::CacheSetHelper::PkgModifier> mods; - mods.push_back(APT::CacheSetHelper::PkgModifier(0, ",", APT::PackageSet::Modifier::POSTFIX)); - mods.push_back(APT::CacheSetHelper::PkgModifier(1, "^", APT::PackageSet::Modifier::POSTFIX)); + mods.push_back(APT::CacheSetHelper::PkgModifier(0, ",", APT::CacheSetHelper::PkgModifier::POSTFIX)); + mods.push_back(APT::CacheSetHelper::PkgModifier(1, "^", APT::CacheSetHelper::PkgModifier::POSTFIX)); std::map<unsigned short, APT::PackageSet> pkgsets = APT::PackageSet::GroupedFromCommandLine(CacheFile, CmdL.FileList + 1, mods, 0, helper); @@ -809,8 +808,8 @@ static bool Dotty(CommandLine &CmdL) // Load the list of packages from the command line into the show list APT::CacheSetHelper helper(true, GlobalError::NOTICE); std::list<APT::CacheSetHelper::PkgModifier> mods; - mods.push_back(APT::CacheSetHelper::PkgModifier(0, ",", APT::PackageSet::Modifier::POSTFIX)); - mods.push_back(APT::CacheSetHelper::PkgModifier(1, "^", APT::PackageSet::Modifier::POSTFIX)); + mods.push_back(APT::CacheSetHelper::PkgModifier(0, ",", APT::CacheSetHelper::PkgModifier::POSTFIX)); + mods.push_back(APT::CacheSetHelper::PkgModifier(1, "^", APT::CacheSetHelper::PkgModifier::POSTFIX)); std::map<unsigned short, APT::PackageSet> pkgsets = APT::PackageSet::GroupedFromCommandLine(CacheFile, CmdL.FileList + 1, mods, 0, helper); diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index da18d2d19..fe6e22d81 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -49,7 +49,6 @@ #include <apt-pkg/pkgsystem.h> #include <apt-pkg/progress.h> #include <apt-pkg/sourcelist.h> -#include <apt-pkg/sptr.h> #include <apt-pkg/srcrecords.h> #include <apt-pkg/strutl.h> #include <apt-pkg/upgrade.h> diff --git a/cmdline/apt-helper.cc b/cmdline/apt-helper.cc index beac0efba..119cbc4c8 100644 --- a/cmdline/apt-helper.cc +++ b/cmdline/apt-helper.cc @@ -63,14 +63,36 @@ static bool DoDownloadFile(CommandLine &CmdL) /*{{{*/ { std::string download_uri = CmdL.FileList[fileind + 1]; std::string targetfile = CmdL.FileList[fileind + 2]; - std::string hash; - if (CmdL.FileSize() > fileind + 3) - hash = CmdL.FileList[fileind + 3]; + HashStringList hashes; + + fileind += 2; + + // An empty string counts as a hash for compatability reasons + if (CmdL.FileSize() > fileind + 1 && *CmdL.FileList[fileind + 1] == '\0') + fileind++; + + /* Let's start looking for hashes */ + for (auto i = fileind + 1; CmdL.FileSize() > i; i++) + { + bool isAHash = false; + + for (auto HashP = HashString::SupportedHashes(); *HashP != nullptr; HashP++) + { + if (APT::String::Startswith(CmdL.FileList[i], *HashP)) + isAHash = true; + } + + if (!isAHash) + break; + + hashes.push_back(HashString(CmdL.FileList[i])); + fileind++; + } + // we use download_uri as descr and targetfile as short-descr - new pkgAcqFile(&Fetcher, download_uri, hash, 0, download_uri, targetfile, - "dest-dir-ignored", targetfile); + new pkgAcqFile(&Fetcher, download_uri, hashes, 0, download_uri, targetfile, + "dest-dir-ignored", targetfile); targetfiles.push_back(targetfile); - fileind += 3; } bool Failed = false; diff --git a/cmdline/apt-mark.cc b/cmdline/apt-mark.cc index 161845b53..942f58f0f 100644 --- a/cmdline/apt-mark.cc +++ b/cmdline/apt-mark.cc @@ -365,7 +365,7 @@ static bool ShowSelection(CommandLine &CmdL) /*{{{*/ else if (strncasecmp(CmdL.FileList[0], "showdeinstall", strlen("showdeinstall")) == 0 || strncasecmp(CmdL.FileList[0], "showremove", strlen("showremove")) == 0) selector = pkgCache::State::DeInstall; - else if (strncasecmp(CmdL.FileList[0], "showhold", strlen("showhold")) == 0) + else if (strncasecmp(CmdL.FileList[0], "showhold", strlen("showhold")) == 0 || strncasecmp(CmdL.FileList[0], "showheld", strlen("showheld")) == 0) selector = pkgCache::State::Hold; else //if (strcasecmp(CmdL.FileList[0], "showinstall", strlen("showinstall")) == 0) selector = pkgCache::State::Install; @@ -423,7 +423,7 @@ static std::vector<aptDispatchWithHelp> GetCommands() /*{{{*/ {"purge",&DoSelection, nullptr}, {"showauto",&ShowAuto, _("Print the list of automatically installed packages")}, {"showmanual",&ShowAuto, _("Print the list of manually installed packages")}, - {"showhold",&ShowSelection, _("Print the list of packages on hold")}, {"showholds",&ShowSelection, nullptr}, + {"showhold",&ShowSelection, _("Print the list of packages on hold")}, {"showholds",&ShowSelection, nullptr}, {"showheld",&ShowSelection, nullptr}, {"showinstall",&ShowSelection, nullptr}, {"showinstalls",&ShowSelection, nullptr}, {"showdeinstall",&ShowSelection, nullptr}, {"showdeinstalls",&ShowSelection, nullptr}, {"showremove",&ShowSelection, nullptr}, {"showremoves",&ShowSelection, nullptr}, |