summaryrefslogtreecommitdiff
path: root/apt-pkg/clean.cc
diff options
context:
space:
mode:
authorArch Librarian <arch@canonical.com>2004-09-20 16:54:49 +0000
committerArch Librarian <arch@canonical.com>2004-09-20 16:54:49 +0000
commitc98b1307f0e9c1712b8e36b825724966d9d40eec (patch)
tree43b74f157e7a3ccb1a525d5c5f6c3d4dca47bf16 /apt-pkg/clean.cc
parent4b1b89c5fe11c9977c55810cba26565e7ac66b36 (diff)
Added clean install code
Author: jgg Date: 1999-10-03 21:09:27 GMT Added clean install code
Diffstat (limited to 'apt-pkg/clean.cc')
-rw-r--r--apt-pkg/clean.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/apt-pkg/clean.cc b/apt-pkg/clean.cc
index b859e382b..bad824362 100644
--- a/apt-pkg/clean.cc
+++ b/apt-pkg/clean.cc
@@ -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;