X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/c1712b0b94c9cd3d404445fb55e37297c6a97913..0d29b9d4368284782862c7b507c47002b79ddb27:/apt-private/private-install.cc?ds=inline diff --git a/apt-private/private-install.cc b/apt-private/private-install.cc index 643a6b370..40165af31 100644 --- a/apt-private/private-install.cc +++ b/apt-private/private-install.cc @@ -1,55 +1,49 @@ // Include Files /*{{{*/ #include -#include -#include -#include -#include -#include -#include -#include +#include #include -#include -#include -#include -#include -#include +#include #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include #include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -#include -#include -#include -#include -#include -#include -#include +// FIXME: include of deb specific header +#include + +#include +#include +#include #include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include -#include "private-install.h" -#include "private-download.h" -#include "private-cachefile.h" -#include "private-output.h" -#include "private-cacheset.h" -#include "acqprogress.h" +#include +#include +#include +#include +#include +#include #include /*}}}*/ +class pkgSourceList; // InstallPackages - Actually download and install the packages /*{{{*/ // --------------------------------------------------------------------- @@ -103,8 +97,16 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask, bool Safety) if (_config->FindB("APT::Get::Simulate") == true) { pkgSimulate PM(Cache); + +#if (APT_PKG_MAJOR >= 4 && APT_PKG_MINOR >= 13) + APT::Progress::PackageManager *progress = APT::Progress::PackageManagerProgressFactory(); + pkgPackageManager::OrderResult Res = PM.DoInstall(progress); + delete progress; +#else int status_fd = _config->FindI("APT::Status-Fd",-1); pkgPackageManager::OrderResult Res = PM.DoInstall(status_fd); +#endif + if (Res == pkgPackageManager::Failed) return false; if (Res != pkgPackageManager::Completed) @@ -146,7 +148,7 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask, bool Safety) if (DebBytes != Cache->DebSize()) { c0out << DebBytes << ',' << Cache->DebSize() << std::endl; - c0out << _("How odd.. The sizes didn't match, email apt@packages.debian.org") << std::endl; + c0out << _("How odd... The sizes didn't match, email apt@packages.debian.org") << std::endl; } // Number of bytes @@ -332,8 +334,16 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask, bool Safety) } _system->UnLock(); - int status_fd = _config->FindI("APT::Status-Fd",-1); + +#if (APT_PKG_MAJOR >= 4 && APT_PKG_MINOR >= 13) + APT::Progress::PackageManager *progress = APT::Progress::PackageManagerProgressFactory(); + pkgPackageManager::OrderResult Res = PM->DoInstall(progress); + delete progress; +#else + int status_fd = _config->FindI("APT::Status-Fd", -1); pkgPackageManager::OrderResult Res = PM->DoInstall(status_fd); +#endif + if (Res == pkgPackageManager::Failed || _error->PendingError() == true) return false; if (Res == pkgPackageManager::Completed) @@ -368,7 +378,7 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask, bool Safety) // DoAutomaticRemove - Remove all automatic unused packages /*{{{*/ // --------------------------------------------------------------------- /* Remove unused automatic packages */ -bool DoAutomaticRemove(CacheFile &Cache) +static bool DoAutomaticRemove(CacheFile &Cache) { bool Debug = _config->FindI("Debug::pkgAutoRemove",false); bool doAutoRemove = _config->FindB("APT::Get::AutomaticRemove", false); @@ -663,10 +673,23 @@ bool DoCacheManipulationFromCommandLine(CommandLine &CmdL, CacheFile &Cache, bool DoInstall(CommandLine &CmdL) { CacheFile Cache; + // first check for local pkgs and add them to the cache + for (const char **I = CmdL.FileList; *I != 0; I++) + { + if(FileExists(*I)) + { + // FIMXE: direct usage of .deb specific stuff + metaIndex *mi = new debDebFileMetaIndex(*I); + pkgSourceList *sources = Cache.GetSourceList(); + sources->Add(mi); + } + } + + // then open the cache if (Cache.OpenForInstall() == false || Cache.CheckDeps(CmdL.FileSize() != 1) == false) return false; - + std::map verset; if(!DoCacheManipulationFromCommandLine(CmdL, Cache, verset))