Просмотр исходного кода

* cmdline/apt-get.cc:
- do not call Mark{Install,Delete} from the autoremove code with
the FromUser bit set to avoid modifying the auto-installed bit

David Kalnischkies лет назад: 13
Родитель
Сommit
b29c448254

+ 3 - 3
cmdline/apt-get.cc

@@ -1736,7 +1736,7 @@ bool DoAutomaticRemove(CacheFile &Cache)
 	 {
 	    if(Pkg.CurrentVer() != 0 && 
 	       Pkg->CurrentState != pkgCache::State::ConfigFiles)
-	       Cache->MarkDelete(Pkg, purgePkgs);
+	       Cache->MarkDelete(Pkg, purgePkgs, 0, false);
 	    else
 	       Cache->MarkKeep(Pkg, false, false);
 	 }
@@ -1750,7 +1750,7 @@ bool DoAutomaticRemove(CacheFile &Cache)
 	    {
 	       if (Pkg.CandVersion() != 0)
 	          tooMuch.insert(Pkg);
-	       Cache->MarkDelete(Pkg, false);
+	       Cache->MarkDelete(Pkg, false, 0, false);
 	    }
 	    // only show stuff in the list that is not yet marked for removal
 	    else if(hideAutoRemove == false && Cache[Pkg].Delete() == false)
@@ -1787,7 +1787,7 @@ bool DoAutomaticRemove(CacheFile &Cache)
 		    continue;
 		 if (Debug == true)
 		    std::clog << "Save " << Pkg << " as another installed garbage package depends on it" << std::endl;
-		 Cache->MarkInstall(Pkg, false);
+		 Cache->MarkInstall(Pkg, false, 0, false);
 		 if (hideAutoRemove == false)
 		    ++autoRemoveCount;
 		 tooMuch.erase(Pkg);

+ 3 - 0
debian/changelog

@@ -14,6 +14,9 @@ apt (0.9.7.7) UNRELEASED; urgency=low
     - don't call MarkInstall with the FromUser flag set for packages
       which are dependencies of APT::Never-MarkAuto-Sections matchers
     - no mode changes should obviously be ok for pkgDepCache::IsModeChangeOk
+  * cmdline/apt-get.cc:
+    - do not call Mark{Install,Delete} from the autoremove code with
+      the FromUser bit set to avoid modifying the auto-installed bit
 
  -- Jordi Mallach <jordi@debian.org>  Thu, 18 Oct 2012 23:30:46 +0200
 

+ 1 - 1
test/integration/test-bug-604222-new-and-autoremove

@@ -51,7 +51,7 @@ Building dependency tree...
       MarkInstall libvtk5.4 [ i386 ] < none -> 5.4.2-8 > ( libs ) FU=0
   MarkKeep libvtk5-dev [ i386 ] < none -> 5.4.2-8 > ( libdevel ) FU=0
   MarkKeep libvtk5-dev [ i386 ] < none -> 5.4.2-8 > ( libdevel ) FU=0
-  MarkDelete libvtk5.4 [ i386 ] < none -> 5.4.2-8 > ( libs ) FU=1
+  MarkDelete libvtk5.4 [ i386 ] < none -> 5.4.2-8 > ( libs ) FU=0
 The following extra packages will be installed:
   libavcodec52 libopenal-dev
 The following NEW packages will be installed:

+ 2 - 2
test/integration/test-bug-618848-always-respect-user-requests

@@ -16,11 +16,11 @@ setupaptarchive
 testequal 'Reading package lists...
 Building dependency tree...
   MarkDelete libdb4.8 [ i386 ] < 1.0 > ( other ) FU=1
-  MarkDelete exim4-daemon-light [ i386 ] < 1.0 > ( other ) FU=1
+  MarkDelete exim4-daemon-light [ i386 ] < 1.0 > ( other ) FU=0
     MarkInstall exim4-daemon-heavy [ i386 ] < none -> 1.0 > ( other ) FU=0
       Ignore MarkInstall of libdb4.8 [ i386 ] < 1.0 > ( other ) as its mode (Delete) is protected
     MarkDelete exim4-daemon-heavy [ i386 ] < none -> 1.0 > ( other ) FU=0
-  MarkDelete exim4 [ i386 ] < 1.0 > ( other ) FU=1
+  MarkDelete exim4 [ i386 ] < 1.0 > ( other ) FU=0
 The following packages will be REMOVED:
   exim4 exim4-daemon-light libdb4.8
   MarkDelete exim4 [ i386 ] < 1.0 > ( other ) FU=1