]>
git.saurik.com Git - apt.git/blob - apt-private/private-upgrade.cc
2 #include <apt-pkg/algorithms.h>
4 #include "private-install.h"
5 #include "private-cachefile.h"
6 #include "private-upgrade.h"
7 #include "private-output.h"
10 // DoUpgradeNoNewPackages - Upgrade all packages /*{{{*/
11 // ---------------------------------------------------------------------
12 /* Upgrade all packages without installing new packages or erasing old
14 bool DoUpgradeNoNewPackages(CommandLine
&CmdL
)
16 if (CmdL
.FileSize() != 1)
17 return _error
->Error(_("The upgrade command takes no arguments"));
20 if (Cache
.OpenForInstall() == false || Cache
.CheckDeps() == false)
24 if (pkgAllUpgrade(Cache
) == false)
26 ShowBroken(c1out
,Cache
,false);
27 return _error
->Error(_("Internal error, AllUpgrade broke stuff"));
30 return InstallPackages(Cache
,true);
34 // DoSafeUpgrade - Upgrade all packages with install but not remove /*{{{*/
35 bool DoUpgradeWithAllowNewPackages(CommandLine
&CmdL
)
37 if (CmdL
.FileSize() != 1)
38 return _error
->Error(_("The upgrade command takes no arguments"));
41 if (Cache
.OpenForInstall() == false || Cache
.CheckDeps() == false)
45 if (pkgAllUpgradeNoDelete(Cache
) == false)
47 ShowBroken(c1out
,Cache
,false);
48 return _error
->Error(_("Internal error, AllUpgrade broke stuff"));
51 return InstallPackages(Cache
,true);