Bladeren bron

* merged from auto-remove

Michael Vogt 20 jaren geleden
bovenliggende
commit
455f831c3c
3 gewijzigde bestanden met toevoegingen van 19 en 7 verwijderingen
  1. 11 6
      cmdline/apt-get.cc
  2. 1 1
      configure.in
  3. 7 0
      debian/changelog

+ 11 - 6
cmdline/apt-get.cc

@@ -1420,14 +1420,20 @@ bool DoUpdate(CommandLine &CmdL)
 bool DoAutomaticRemove(CacheFile &Cache)
 {
    bool Debug = _config->FindI("Debug::pkgAutoRemove",false);
+   bool doAutoRemove = _config->FindB("APT::Get::AutomaticRemove");
    pkgDepCache::ActionGroup group(*Cache);
+   
 
    if(Debug)
       std::cout << "DoAutomaticRemove()" << std::endl;
 
-   if (_config->FindB("APT::Get::Remove",true) == false)
-      return _error->Error(_("We are not supposed to delete stuff, can't "
-			     "start AutoRemover"));
+   if (_config->FindB("APT::Get::Remove",true) == false &&
+       doAutoRemove == true)
+   {
+      c1out << _("We are not supposed to delete stuff, can't start "
+		 "AutoRemover") << std::endl;
+      doAutoRemove = false;
+   }
 
    string autoremovelist, autoremoveversions;
    // look over the cache to see what can be removed
@@ -1441,7 +1447,7 @@ bool DoAutomaticRemove(CacheFile &Cache)
 	   
 	 autoremovelist += string(Pkg.Name()) + " ";
 	 autoremoveversions += string(Cache[Pkg].CandVersion) + " ";
-	 if (_config->FindB("APT::Get::AutomaticRemove")) 
+	 if (doAutoRemove)
 	 {
 	    if(Pkg.CurrentVer() != 0 && 
 	       Pkg->CurrentState != pkgCache::State::ConfigFiles)
@@ -1452,8 +1458,7 @@ bool DoAutomaticRemove(CacheFile &Cache)
       }
    }
    ShowList(c1out, _("The following packages were automatically installed and are no longer required:"), autoremovelist, autoremoveversions);
-   if (!_config->FindB("APT::Get::AutomaticRemove") && 
-       autoremovelist.size() > 0)
+   if (!doAutoRemove && autoremovelist.size() > 0)
       c1out << _("Use 'apt-get autoremove' to remove them.") << std::endl;
 
    // Now see if we destroyed anything

+ 1 - 1
configure.in

@@ -18,7 +18,7 @@ AC_CONFIG_AUX_DIR(buildlib)
 AC_CONFIG_HEADER(include/config.h:buildlib/config.h.in include/apti18n.h:buildlib/apti18n.h.in)
 
 dnl -- SET THIS TO THE RELEASE VERSION --
-AC_DEFINE_UNQUOTED(VERSION,"0.6.45ubuntu8")
+AC_DEFINE_UNQUOTED(VERSION,"0.6.45ubuntu9")
 PACKAGE="apt"
 AC_DEFINE_UNQUOTED(PACKAGE,"$PACKAGE")
 AC_SUBST(PACKAGE)

+ 7 - 0
debian/changelog

@@ -1,3 +1,10 @@
+apt (0.6.45ubuntu9) edgy; urgency=low
+
+  * cmdline/apt-get.cc:
+    - if --no-remove is given, do not run the AutoRemove code 
+
+ -- Michael Vogt <michael.vogt@ubuntu.com>  Wed, 13 Sep 2006 11:54:20 +0200
+
 apt (0.6.45ubuntu8) edgy; urgency=low
 
   * apt-pkg/algorithm.cc: