You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

56 lines
1.5 KiB

  1. #include <apt-pkg/algorithms.h>
  2. #include "private-install.h"
  3. #include "private-cachefile.h"
  4. #include "private-upgrade.h"
  5. #include "private-output.h"
  6. // DoUpgradeNoNewPackages - Upgrade all packages /*{{{*/
  7. // ---------------------------------------------------------------------
  8. /* Upgrade all packages without installing new packages or erasing old
  9. packages */
  10. bool DoUpgradeNoNewPackages(CommandLine &CmdL)
  11. {
  12. CacheFile Cache;
  13. if (Cache.OpenForInstall() == false || Cache.CheckDeps() == false)
  14. return false;
  15. // Do the upgrade
  16. if (pkgAllUpgrade(Cache) == false)
  17. {
  18. ShowBroken(c1out,Cache,false);
  19. return _error->Error(_("Internal error, AllUpgrade broke stuff"));
  20. }
  21. // parse additional cmdline pkg manipulation switches
  22. if(!DoCacheManipulationFromCommandLine(CmdL, Cache))
  23. return false;
  24. return InstallPackages(Cache,true);
  25. }
  26. /*}}}*/
  27. // DoSafeUpgrade - Upgrade all packages with install but not remove /*{{{*/
  28. bool DoUpgradeWithAllowNewPackages(CommandLine &CmdL)
  29. {
  30. CacheFile Cache;
  31. if (Cache.OpenForInstall() == false || Cache.CheckDeps() == false)
  32. return false;
  33. // Do the upgrade
  34. if (pkgAllUpgradeNoDelete(Cache) == false)
  35. {
  36. ShowBroken(c1out,Cache,false);
  37. return _error->Error(_("Internal error, AllUpgrade broke stuff"));
  38. }
  39. // parse additional cmdline pkg manipulation switches
  40. if(!DoCacheManipulationFromCommandLine(CmdL, Cache))
  41. return false;
  42. return InstallPackages(Cache,true);
  43. }
  44. /*}}}*/