summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apt-pkg/acquire-item.cc3
-rw-r--r--cmdline/apt-get.cc26
-rw-r--r--doc/apt-get.8.yo6
-rw-r--r--doc/examples/apt.conf4
4 files changed, 32 insertions, 7 deletions
diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc
index 5863fcfb4..25839f85c 100644
--- a/apt-pkg/acquire-item.cc
+++ b/apt-pkg/acquire-item.cc
@@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: acquire-item.cc,v 1.32 1999/06/06 06:58:36 jgg Exp $
+// $Id: acquire-item.cc,v 1.33 1999/07/10 05:32:25 jgg Exp $
/* ######################################################################
Acquire Item - Item to acquire
@@ -323,7 +323,6 @@ void pkgAcqIndexRel::Done(string Message,unsigned long Size,string MD5)
/* */
void pkgAcqIndexRel::Failed(string Message,pkgAcquire::MethodConfig *Cnf)
{
- // This is the retry counter
if (Cnf->LocalOnly == true ||
StringToBool(LookupTag(Message,"Transient-Failure"),false) == false)
{
diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc
index 67352c868..75424926d 100644
--- a/cmdline/apt-get.cc
+++ b/cmdline/apt-get.cc
@@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: apt-get.cc,v 1.69 1999/07/10 04:58:42 jgg Exp $
+// $Id: apt-get.cc,v 1.70 1999/07/10 05:32:26 jgg Exp $
/* ######################################################################
apt-get - Cover for dpkg
@@ -719,16 +719,32 @@ bool DoUpdate(CommandLine &)
if (Fetcher.Run() == pkgAcquire::Failed)
return false;
+ bool Failed = false;
+ for (pkgAcquire::Item **I = Fetcher.ItemsBegin(); I != Fetcher.ItemsEnd(); I++)
+ {
+ if ((*I)->Status == pkgAcquire::Item::StatDone)
+ continue;
+
+ (*I)->Finished();
+
+ Failed = true;
+ }
+
// Clean out any old list files
- if (Fetcher.Clean(_config->FindDir("Dir::State::lists")) == false ||
- Fetcher.Clean(_config->FindDir("Dir::State::lists") + "partial/") == false)
- return false;
+ if (_config->FindB("APT::Get::List-Cleanup",false) == false)
+ {
+ if (Fetcher.Clean(_config->FindDir("Dir::State::lists")) == false ||
+ Fetcher.Clean(_config->FindDir("Dir::State::lists") + "partial/") == false)
+ return false;
+ }
// Prepare the cache.
CacheFile Cache;
if (Cache.Open() == false)
return false;
+ if (Failed == true)
+ return _error->Error("Some index files failed to download, they have been ignored, or old ones used instead.");
return true;
}
/*}}}*/
@@ -1408,6 +1424,7 @@ void GetInitialize()
_config->Set("APT::Get::Assume-Yes",false);
_config->Set("APT::Get::Fix-Broken",false);
_config->Set("APT::Get::Force-Yes",false);
+ _config->Set("APT::Get::APT::Get::No-List-Cleanup",true);
}
/*}}}*/
// SigWinch - Window size change signal handler /*{{{*/
@@ -1451,6 +1468,7 @@ int main(int argc,const char *argv[])
{0,"force-yes","APT::Get::force-yes",0},
{0,"print-uris","APT::Get::Print-URIs",0},
{0,"purge","APT::Get::Purge",0},
+ {0,"list-cleanup","APT::Get::List-Cleanup",0},
{'c',"config-file",0,CommandLine::ConfigFile},
{'o',"option",0,CommandLine::ArbItem},
{0,0,0,0}};
diff --git a/doc/apt-get.8.yo b/doc/apt-get.8.yo
index 4f399ac31..a0a871722 100644
--- a/doc/apt-get.8.yo
+++ b/doc/apt-get.8.yo
@@ -210,6 +210,12 @@ command See bf(APT::Get::Print-URIs).
dit(bf(--purge))
Use purge instead of remove for anything that would be removed.
+dit(bf(--list-cleanup))
+This option defaults to on, use bf(--no-list-cleanup) to turn it off.
+When on apt-get will automatically manage the contents of
+/var/state/apt/lists to ensure that obsolete files are erased. The only
+reason to turn it off is if you frequently change your source list.
+
dit(bf(-c, --config-file))
Configuration File; Specify a configuration file to use. bf(apt-get) will
read the default configuration file and then this configuration file. See
diff --git a/doc/examples/apt.conf b/doc/examples/apt.conf
index affe5d8be..da9bc1d96 100644
--- a/doc/examples/apt.conf
+++ b/doc/examples/apt.conf
@@ -1,4 +1,4 @@
-// $Id: apt.conf,v 1.33 1999/05/24 03:39:37 jgg Exp $
+// $Id: apt.conf,v 1.34 1999/07/10 05:32:26 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.
@@ -34,6 +34,8 @@ APT
Print-URIs "false";
Compile "false";
No-Download "false";
+ Purge "false";
+ List-Cleanup "true";
};
Cache