Explorar o código

deprecate InstallProtect as a cpu-eating no-op

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.
David Kalnischkies %!s(int64=13) %!d(string=hai) anos
pai
achega
f3c736f9b6
Modificáronse 3 ficheiros con 9 adicións e 8 borrados
  1. 4 2
      apt-pkg/algorithms.cc
  2. 4 3
      apt-pkg/algorithms.h
  3. 1 3
      cmdline/apt-get.cc

+ 4 - 2
apt-pkg/algorithms.cc

@@ -1440,9 +1440,11 @@ bool pkgProblemResolver::ResolveByKeepInternal()
    return true;
    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()
 void pkgProblemResolver::InstallProtect()
 {
 {
    pkgDepCache::ActionGroup group(Cache);
    pkgDepCache::ActionGroup group(Cache);

+ 4 - 3
apt-pkg/algorithms.h

@@ -36,6 +36,8 @@
 
 
 #include <iostream>
 #include <iostream>
 
 
+#include <apt-pkg/macros.h>
+
 #ifndef APT_8_CLEANER_HEADERS
 #ifndef APT_8_CLEANER_HEADERS
 #include <apt-pkg/acquire.h>
 #include <apt-pkg/acquire.h>
 using std::ostream;
 using std::ostream;
@@ -132,9 +134,8 @@ class pkgProblemResolver						/*{{{*/
    // Try to resolve problems only by using keep
    // Try to resolve problems only by using keep
    bool ResolveByKeep();
    bool ResolveByKeep();
 
 
-   // Install all protected packages   
-   void InstallProtect();   
-   
+   __deprecated void InstallProtect();
+
    pkgProblemResolver(pkgDepCache *Cache);
    pkgProblemResolver(pkgDepCache *Cache);
    ~pkgProblemResolver();
    ~pkgProblemResolver();
 };
 };

+ 1 - 3
cmdline/apt-get.cc

@@ -1962,7 +1962,6 @@ bool DoInstall(CommandLine &CmdL)
       if (Fix != NULL)
       if (Fix != NULL)
       {
       {
 	 // Call the scored problem resolver
 	 // Call the scored problem resolver
-	 Fix->InstallProtect();
 	 Fix->Resolve(true);
 	 Fix->Resolve(true);
 	 delete Fix;
 	 delete Fix;
       }
       }
@@ -3123,8 +3122,7 @@ bool DoBuildDep(CommandLine &CmdL)
             }
             }
 	 }	       
 	 }	       
       }
       }
-      
-      Fix.InstallProtect();
+
       if (Fix.Resolve(true) == false)
       if (Fix.Resolve(true) == false)
 	 _error->Discard();
 	 _error->Discard();