]> git.saurik.com Git - apt.git/commitdiff
deprecate InstallProtect as a cpu-eating no-op
authorDavid Kalnischkies <kalnischkies@gmail.com>
Fri, 24 May 2013 08:20:38 +0000 (10:20 +0200)
committerDavid Kalnischkies <kalnischkies@gmail.com>
Sun, 9 Jun 2013 13:12:07 +0000 (15:12 +0200)
In the past packages were flagged "Protected" so that install/
remove markings where issued before the ProblemResolver.
Nowadays, the marking methods check if they are allowed to modify
the marking of a package instead, so that markings set by FromUser
calls are not overwritten anymore by automatic calls which elimates
the need for InstallProtect which just eats CPU now.

The method itself is left untouched for now in case frontend needs it
still for some wierd usecase, but they should be eliminated.

apt-pkg/algorithms.cc
apt-pkg/algorithms.h
cmdline/apt-get.cc

index 6cde4d6cc1ddcc5a8ae0da730db74f270c513789..d19783983c04dcbbe4dedc41a9a7d7a0ac402518 100644 (file)
@@ -1440,9 +1440,11 @@ bool pkgProblemResolver::ResolveByKeepInternal()
    return true;
 }
                                                                        /*}}}*/
-// ProblemResolver::InstallProtect - Install all protected packages    /*{{{*/
+// ProblemResolver::InstallProtect - deprecated cpu-eating no-op       /*{{{*/
 // ---------------------------------------------------------------------
-/* This is used to make sure protected packages are installed */
+/* Actions issued with FromUser bit set are protected from further
+   modification (expect by other calls with FromUser set) nowadays , so we
+   don't need to reissue actions here, they are already set in stone. */
 void pkgProblemResolver::InstallProtect()
 {
    pkgDepCache::ActionGroup group(Cache);
index aff8a68f2ce1a2691660bfd35db5bc29b01e795c..7f58c8eedb12ce281d8af8df120eeda3be6d3013 100644 (file)
@@ -36,6 +36,8 @@
 
 #include <iostream>
 
+#include <apt-pkg/macros.h>
+
 #ifndef APT_8_CLEANER_HEADERS
 #include <apt-pkg/acquire.h>
 using std::ostream;
@@ -132,9 +134,8 @@ class pkgProblemResolver                                            /*{{{*/
    // Try to resolve problems only by using keep
    bool ResolveByKeep();
 
-   // Install all protected packages   
-   void InstallProtect();   
-   
+   __deprecated void InstallProtect();
+
    pkgProblemResolver(pkgDepCache *Cache);
    ~pkgProblemResolver();
 };
index 999f2a6a7e3fd39ed649be42df6bb57d970e71a8..85ed80a9586a86248de03dde16eef52603c1f56f 100644 (file)
@@ -1962,7 +1962,6 @@ bool DoInstall(CommandLine &CmdL)
       if (Fix != NULL)
       {
         // Call the scored problem resolver
-        Fix->InstallProtect();
         Fix->Resolve(true);
         delete Fix;
       }
@@ -3123,8 +3122,7 @@ bool DoBuildDep(CommandLine &CmdL)
             }
         }             
       }
-      
-      Fix.InstallProtect();
+
       if (Fix.Resolve(true) == false)
         _error->Discard();