]> git.saurik.com Git - apt.git/blame - apt-private/private-upgrade.cc
install apt binary as well
[apt.git] / apt-private / private-upgrade.cc
CommitLineData
b9179170
MV
1
2#include <apt-pkg/algorithms.h>
3
4#include "private-install.h"
5#include "private-cachefile.h"
6#include "private-upgrade.h"
7#include "private-output.h"
8
9
10// DoUpgradeNoNewPackages - Upgrade all packages /*{{{*/
11// ---------------------------------------------------------------------
12/* Upgrade all packages without installing new packages or erasing old
13 packages */
14bool DoUpgradeNoNewPackages(CommandLine &CmdL)
15{
f49d103a
MV
16 if (CmdL.FileSize() != 1)
17 return _error->Error(_("The upgrade command takes no arguments"));
18
b9179170
MV
19 CacheFile Cache;
20 if (Cache.OpenForInstall() == false || Cache.CheckDeps() == false)
21 return false;
22
23 // Do the upgrade
24 if (pkgAllUpgrade(Cache) == false)
25 {
26 ShowBroken(c1out,Cache,false);
27 return _error->Error(_("Internal error, AllUpgrade broke stuff"));
28 }
29
30 return InstallPackages(Cache,true);
31}
32 /*}}}*/
33
34// DoSafeUpgrade - Upgrade all packages with install but not remove /*{{{*/
35bool DoUpgradeWithAllowNewPackages(CommandLine &CmdL)
36{
f49d103a
MV
37 if (CmdL.FileSize() != 1)
38 return _error->Error(_("The upgrade command takes no arguments"));
39
b9179170
MV
40 CacheFile Cache;
41 if (Cache.OpenForInstall() == false || Cache.CheckDeps() == false)
42 return false;
43
44 // Do the upgrade
45 if (pkgAllUpgradeNoDelete(Cache) == false)
46 {
47 ShowBroken(c1out,Cache,false);
48 return _error->Error(_("Internal error, AllUpgrade broke stuff"));
49 }
50
51 return InstallPackages(Cache,true);
52}
53 /*}}}*/