]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/upgrade.cc
sanify API to get 'the' candidate version
[apt.git] / apt-pkg / upgrade.cc
index 20a38ecee189dfe42a9fd275f220027f15cad9c1..e7f2aae4012cf076a7145d29c848c581e58417f4 100644 (file)
@@ -24,7 +24,7 @@
    
    The problem resolver is used to resolve the problems.
  */
-bool pkgDistUpgrade(pkgDepCache &Cache, OpProgress * const Progress)
+static bool pkgDistUpgrade(pkgDepCache &Cache, OpProgress * const Progress)
 {
    std::string const solver = _config->Find("APT::Solver", "internal");
    if (solver != "internal")
@@ -119,6 +119,10 @@ bool pkgDistUpgrade(pkgDepCache &Cache, OpProgress * const Progress)
    if (Progress != NULL)
       Progress->Done();
    return success;
+}
+bool pkgDistUpgrade(pkgDepCache &Cache)
+{
+   return pkgDistUpgrade(Cache, NULL);
 }
                                                                        /*}}}*/
 // AllUpgradeNoNewPackages - Upgrade but no removals or new pkgs        /*{{{*/
@@ -229,9 +233,13 @@ static bool pkgAllUpgradeWithNewPackages(pkgDepCache &Cache, OpProgress * const
 /* Right now the system must be consistent before this can be called.
    It also will not change packages marked for install, it only tries
    to install packages not marked for install */
-bool pkgAllUpgrade(pkgDepCache &Cache, OpProgress * const Progress)
+static bool pkgAllUpgrade(pkgDepCache &Cache, OpProgress * const Progress)
 {
    return pkgAllUpgradeNoNewPackages(Cache, Progress);
+}
+bool pkgAllUpgrade(pkgDepCache &Cache)
+{
+   return pkgAllUpgrade(Cache, NULL);
 }
                                                                        /*}}}*/
 // MinimizeUpgrade - Minimizes the set of packages to be upgraded      /*{{{*/
@@ -282,7 +290,8 @@ bool pkgMinimizeUpgrade(pkgDepCache &Cache)
 // APT::Upgrade::Upgrade - Upgrade using a specific strategy           /*{{{*/
 bool APT::Upgrade::Upgrade(pkgDepCache &Cache, int mode, OpProgress * const Progress)
 {
-   if (mode == 0)
+APT_IGNORE_DEPRECATED_PUSH
+   if (mode == ALLOW_EVERYTHING)
       return pkgDistUpgrade(Cache, Progress);
    else if ((mode & ~FORBID_REMOVE_PACKAGES) == 0)
       return pkgAllUpgradeWithNewPackages(Cache, Progress);
@@ -290,7 +299,7 @@ bool APT::Upgrade::Upgrade(pkgDepCache &Cache, int mode, OpProgress * const Prog
       return pkgAllUpgradeNoNewPackages(Cache, Progress);
    else
       _error->Error("pkgAllUpgrade called with unsupported mode %i", mode);
-
+APT_IGNORE_DEPRECATED_POP
    return false;
 }
                                                                        /*}}}*/