Added clean install code
authorArch Librarian <arch@canonical.com>
Mon, 20 Sep 2004 16:54:49 +0000 (16:54 +0000)
committerArch Librarian <arch@canonical.com>
Mon, 20 Sep 2004 16:54:49 +0000 (16:54 +0000)
Author: jgg
Date: 1999-10-03 21:09:27 GMT
Added clean install code

apt-pkg/clean.cc
debian/changelog
doc/apt.conf.5.yo
doc/examples/apt.conf
methods/http.cc

index b859e38..bad8243 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
-// $Id: clean.cc,v 1.2 1999/06/24 04:06:30 jgg Exp $
+// $Id: clean.cc,v 1.3 1999/10/03 21:09:27 jgg Exp $
 /* ######################################################################
 
    Clean - Clean out downloaded directories
@@ -15,6 +15,7 @@
 #include <apt-pkg/clean.h>
 #include <apt-pkg/strutl.h>
 #include <apt-pkg/error.h>
+#include <apt-pkg/configuration.h>
 
 #include <dirent.h>
 #include <sys/stat.h>
@@ -27,6 +28,8 @@
    against our database to see if it is interesting */
 bool pkgArchiveCleaner::Go(string Dir,pkgCache &Cache)
 {
+   bool CleanInstalled = _config->FindB("APT::Clean-Installed",true);
+   
    DIR *D = opendir(Dir.c_str());   
    if (D == 0)
       return _error->Errno("opendir","Unable to read %s",Dir.c_str());
@@ -84,7 +87,8 @@ bool pkgArchiveCleaner::Go(string Dir,pkgCache &Cache)
            for (pkgCache::VerFileIterator J = V.FileList(); 
                 J.end() == false; J++)
            {
-              if ((J.File()->Flags & pkgCache::Flag::NotSource) != 0)
+              if (CleanInstalled == true &&
+                  (J.File()->Flags & pkgCache::Flag::NotSource) != 0)
                  continue;
               IsFetchable = true;
               break;
index 2ac8113..73da827 100644 (file)
@@ -5,8 +5,9 @@ apt (0.3.13.1) unstable; urgency=low
   * Make unparsable priorities non-fatal Closes: #46266, #46267, #46293, #46298  
   * Fix handling of '/' for the dist name. Closes: #43830, #45640, #45692
   * Fixed 'Method gave a blank filename' error from IMS queries onto CDs.
-    Closes: #45034, #45695
+    Closes: #45034, #45695, #46537
   * Made OR group handling in the problem resolver more elaborate. Closes: #45646
+  * Added APT::Clean-Installed option. Closes: #45973
   
  -- Jason Gunthorpe <jgg@debian.org>  Fri,  3 Sep 1999 09:04:28 -0700
  
index 9c4c0e4..4d3f3fd 100644 (file)
@@ -55,6 +55,12 @@ dit(bf(Ignore-Hold))
 Ignore Held packages; This global options causes the problem resolver to
 ignore held packages in its decision making. 
 
+dit(bf(Clean-Installed))
+Defaults to on. When turned on the autoclean feature will remove any pacakge
+which can no longer be downloaded from the cache. If turned off then
+packages that are locally installed are also excluded from cleaning - but
+note that APT provides no direct means to reinstall them.
+
 dit(bf(Immediate-Configure))
 Disable Immedate Configuration; This dangerous option disables some
 of APT's ordering code to cause it to make fewer dpkg calls. Doing
index dabdab3..452e9c6 100644 (file)
@@ -1,4 +1,4 @@
-// $Id: apt.conf,v 1.37 1999/08/28 03:22:45 jgg Exp $
+// $Id: apt.conf,v 1.38 1999/10/03 21:09:27 jgg Exp $
 /* This file is an index of all APT configuration directives. It should
    NOT actually be used as a real config file, though it is a completely
    valid file.
@@ -53,6 +53,7 @@ APT
 
   // Some general options
   Ignore-Hold "false";
+  Clean-Installed "true";
   Immediate-Configure "true";      // DO NOT turn this off, see the man page
   Force-LoopBreak "false";         // DO NOT turn this on, see the man page
 };
@@ -192,5 +193,10 @@ Debug
   pkgInitialize "false";   // This one will dump the configuration space
   NoLocking "false";
   Acquire::Ftp "false";    // Show ftp command traffic
+  Acquire::Http "false";   // Show http command traffic
   aptcdrom "false";        // Show found package files
 }
+
+/* Whatever you do, do not use this configuration file!! Take out ONLY
+   the portions you need */
+ThisIsNotAValidConfigFile
index ae7646a..c4a3f16 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
-// $Id: http.cc,v 1.37 1999/08/03 06:08:23 jgg Exp $
+// $Id: http.cc,v 1.38 1999/10/03 21:09:27 jgg Exp $
 /* ######################################################################
 
    HTTP Aquire Method - This is the HTTP aquire method for APT.
@@ -54,6 +54,7 @@ int HttpMethod::FailFd = -1;
 time_t HttpMethod::FailTime = 0;
 unsigned long PipelineDepth = 10;
 unsigned long TimeOut = 120;
+bool Debug = false;
 
 // CircleBuf::CircleBuf - Circular input buffer                                /*{{{*/
 // ---------------------------------------------------------------------
@@ -631,7 +632,9 @@ void HttpMethod::SendReq(FetchItem *Itm,CircleBuf &Out)
           Base64Encode(Proxy.User + ":" + Proxy.Password) + "\r\n";
 
    Req += "User-Agent: Debian APT-HTTP/1.2\r\n\r\n";
-//   cerr << Req << endl;
+   
+   if (Debug == true)
+      cerr << Req << endl;
 
    Out.Read(Req);
 }
@@ -939,6 +942,7 @@ bool HttpMethod::Configuration(string Message)
    TimeOut = _config->FindI("Acquire::http::Timeout",TimeOut);
    PipelineDepth = _config->FindI("Acquire::http::Pipeline-Depth",
                                  PipelineDepth);
+   Debug = _config->FindB("Debug::Acquire::http",false);
    
    return true;
 }