Преглед изворни кода

do not discard new manual-bits while applying EDSP solutions

In private-install.cc we call MarkInstall with FromUser=true, which sets
the bit accordingly, but while applying the EDSP solution we call mark
install on all packages with FromUser=false, so MarkInstall believes
this install is an automatic one and sets it to auto – so that a new package
which is explicitely installed via an external solver is marked as auto
and is hence also up for garbage collection in a following call.

Ideally MarkInstall wouldn't reset it, but the detection is hard to do
without regressing in other cases – and ideally ideally MarkInstall
wouldn't deal with the autobit at all – so we work around this on the
calling side for now.
David Kalnischkies пре 10 година
родитељ
комит
9777639ef8
3 измењених фајлова са 13 додато и 8 уклоњено
  1. 5 1
      apt-pkg/edsp.cc
  2. 2 7
      apt-private/private-install.cc
  3. 6 0
      test/integration/test-apt-get-autoremove

+ 5 - 1
apt-pkg/edsp.cc

@@ -343,7 +343,11 @@ bool EDSP::ReadResponse(int const input, pkgDepCache &Cache, OpProgress *Progres
 		pkgCache::VerIterator Ver(Cache.GetCache(), Cache.GetCache().VerP + VerIdx[id]);
 		Cache.SetCandidateVersion(Ver);
 		if (type == "Install")
-			Cache.MarkInstall(Ver.ParentPkg(), false, 0, false);
+		{
+			pkgCache::PkgIterator const P = Ver.ParentPkg();
+			if (Cache[P].Mode != pkgDepCache::ModeInstall)
+				Cache.MarkInstall(P, false, 0, false);
+		}
 		else if (type == "Remove")
 			Cache.MarkDelete(Ver.ParentPkg(), false);
 		else if (type == "Autoremove") {

+ 2 - 7
apt-private/private-install.cc

@@ -560,13 +560,8 @@ bool DoCacheManipulationFromCommandLine(CommandLine &CmdL, CacheFile &Cache,
 
       if (Fix != NULL && _config->FindB("APT::Get::AutoSolving", true) == true)
       {
-         for (unsigned short i = 0; order[i] != 0; ++i)
-         {
-	    if (order[i] != MOD_INSTALL)
-	       continue;
-	    InstallAction.propergateReleaseCandiateSwitching(helper.selectedByRelease, c0out);
-	    InstallAction.doAutoInstall();
-	 }
+	 InstallAction.propergateReleaseCandiateSwitching(helper.selectedByRelease, c0out);
+	 InstallAction.doAutoInstall();
       }
 
       if (_error->PendingError() == true)

+ 6 - 0
test/integration/test-apt-get-autoremove

@@ -95,3 +95,9 @@ testsuccessequal 'Reading package lists...
 Building dependency tree...
 Reading state information...
 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget autoremove -s
+
+testsuccess aptget autoremove debhelper -y --allow-change-held-packages
+testdpkgnotinstalled 'po-debconf' 'debhelper'
+testmarkedauto
+testsuccess aptget install debhelper --solver apt -y -o Debug::pkgDepCache::Marker=1
+testmarkedauto 'po-debconf'