X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/258b9e512c4001e806c5c0966acecd3d742ec6e9..ee02b5b3949372a178d37cadaa08db0bfd5b991f:/apt-private/private-install.cc diff --git a/apt-private/private-install.cc b/apt-private/private-install.cc index 74a2424c5..73aebaf2f 100644 --- a/apt-private/private-install.cc +++ b/apt-private/private-install.cc @@ -346,6 +346,18 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask, bool Safety) c0out << _("Note: This is done automatically and on purpose by dpkg.") << std::endl; } + // cleanup downloaded debs + if (_config->FindB("APT::Keep-Downloaded-Packages", true) == false) + { + std::string const archivedir = _config->FindDir("Dir::Cache::archives"); + for (auto I = Fetcher.ItemsBegin(); I != Fetcher.ItemsEnd(); ++I) + { + if (flNotFile((*I)->DestFile) != archivedir || (*I)->Local) + continue; + RemoveFile("Keep-Downloaded-Packages=false", (*I)->DestFile); + } + } + return true; } /*}}}*/