summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmdline/apt-get.cc45
-rw-r--r--configure.in2
-rw-r--r--debian/apt.conf.autoremove8
-rw-r--r--debian/apt.dirs1
-rw-r--r--debian/changelog15
-rwxr-xr-xdebian/rules2
-rw-r--r--methods/http.cc2
7 files changed, 48 insertions, 27 deletions
diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc
index 4bd66383f..7b70de3bd 100644
--- a/cmdline/apt-get.cc
+++ b/cmdline/apt-get.cc
@@ -1419,31 +1419,42 @@ bool DoUpdate(CommandLine &CmdL)
/* Remove unused automatic packages */
bool DoAutomaticRemove(CacheFile &Cache)
{
- if(_config->FindI("Debug::pkgAutoRemove",false))
+ bool Debug = _config->FindI("Debug::pkgAutoRemove",false);
+ 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"));
+ string autoremovelist, autoremoveversions;
+ // look over the cache to see what can be removed
+ for (pkgCache::PkgIterator Pkg = Cache->PkgBegin(); ! Pkg.end(); ++Pkg)
{
- pkgDepCache::ActionGroup group(*Cache);
-
- // look over the cache to see what can be removed
- for (pkgCache::PkgIterator Pkg = Cache->PkgBegin(); ! Pkg.end(); ++Pkg)
- {
- if (Cache[Pkg].Garbage)
- {
- if(Pkg.CurrentVer() != 0 || Cache[Pkg].Install())
- fprintf(stdout,"We could delete %s\n", Pkg.Name());
-
- if(Pkg.CurrentVer() != 0 && Pkg->CurrentState != pkgCache::State::ConfigFiles)
+ if (Cache[Pkg].Garbage)
+ {
+ if(Pkg.CurrentVer() != 0 || Cache[Pkg].Install())
+ if(Debug)
+ std::cout << "We could delete %s" << Pkg.Name() << std::endl;
+
+ autoremovelist += string(Pkg.Name()) + " ";
+ autoremoveversions += string(Cache[Pkg].CandVersion) + " ";
+ if (_config->FindB("APT::Get::AutomaticRemove"))
+ {
+ if(Pkg.CurrentVer() != 0 &&
+ Pkg->CurrentState != pkgCache::State::ConfigFiles)
Cache->MarkDelete(Pkg, _config->FindB("APT::Get::Purge", false));
- else
+ else
Cache->MarkKeep(Pkg, false, false);
- }
- }
+ }
+ }
}
+ ShowList(c1out, _("The following packages where automatically installed and are no longer required:"), autoremovelist, autoremoveversions);
+ if (!_config->FindB("APT::Get::AutomaticRemove") &&
+ autoremovelist.size() > 0)
+ c1out << _("Use 'apt-get autoremove' to remove them.") << std::endl;
// Now see if we destroyed anything
if (Cache->BrokenCount() != 0)
@@ -1659,10 +1670,8 @@ bool DoInstall(CommandLine &CmdL)
return _error->Error(_("Broken packages"));
}
}
- if (_config->FindB("APT::Get::AutomaticRemove")) {
- if (!DoAutomaticRemove(Cache))
+ if (!DoAutomaticRemove(Cache))
return false;
- }
/* Print out a list of packages that are going to be installed extra
to what the user asked */
diff --git a/configure.in b/configure.in
index a0cd8080c..9fd92e84f 100644
--- a/configure.in
+++ b/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.45ubuntu5")
+AC_DEFINE_UNQUOTED(VERSION,"0.6.45ubuntu6")
PACKAGE="apt"
AC_DEFINE_UNQUOTED(PACKAGE,"$PACKAGE")
AC_SUBST(PACKAGE)
diff --git a/debian/apt.conf.autoremove b/debian/apt.conf.autoremove
new file mode 100644
index 000000000..98143ce9a
--- /dev/null
+++ b/debian/apt.conf.autoremove
@@ -0,0 +1,8 @@
+APT
+{
+ NeverAutoRemove
+ {
+ "^linux-image.*";
+ "^linux-restricted-modules.*";
+ };
+};
diff --git a/debian/apt.dirs b/debian/apt.dirs
index e1cb738fa..1543e8bb1 100644
--- a/debian/apt.dirs
+++ b/debian/apt.dirs
@@ -2,6 +2,7 @@ usr/bin
usr/lib/apt/methods
usr/lib/dpkg/methods/apt
etc/apt
+etc/apt/apt.conf.d
etc/apt/sources.list.d
var/cache/apt/archives/partial
var/lib/apt/lists/partial
diff --git a/debian/changelog b/debian/changelog
index 6dc69ba12..d8f90ba40 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,20 +1,23 @@
apt (0.6.45ubuntu6) edgy; urgency=low
+ [Michael Vogt]
+ * cmdline/apt-get.cc:
+ - always show auto-removable packages and give a hint how to remove
+ them
+ * debian/apt.conf.autoremove:
+ - exlucde linux-image and linux-restricted-modules from ever being
+ auto-removed
+ [Ian Jackson]
* Tests pass without code changes! Except that we need this:
* Bump cache file major version to force rebuild so that Breaks
dependencies are included.
* Don't depend on or suggest any particular dpkg or dpkg-dev versions;
--auto-deconfigure is very very old and dpkg-dev's Breaks support
is more or less orthogonal.
-
- -- Ian Jackson <iwj@ubuntu.com> Tue, 5 Sep 2006 19:50:02 +0100
-
-apt (0.6.45ubuntu6~iwj) unstable; urgency=low
-
* Initial draft of `Breaks' implementation. Appears to compile,
but as yet *completely untested*.
- -- Ian Jackson <ian@davenant.greenend.org.uk> Fri, 25 Aug 2006 15:39:07 +0100
+ --
apt (0.6.45ubuntu5) edgy; urgency=low
diff --git a/debian/rules b/debian/rules
index 333d4ad5b..ffc23402e 100755
--- a/debian/rules
+++ b/debian/rules
@@ -211,7 +211,7 @@ apt: build debian/shlibs.local
cp debian/bugscript debian/$@/usr/share/bug/apt/script
cp share/ubuntu-archive.gpg debian/$@/usr/share/$@
-
+ cp debian/apt.conf.autoremove debian/$@/etc/apt/apt.conf.d/01autoremove
# head -n 500 ChangeLog > debian/ChangeLog
# make rosetta happy and remove pot files in po/ (but leave stuff
diff --git a/methods/http.cc b/methods/http.cc
index 09dab8188..1833f41ef 100644
--- a/methods/http.cc
+++ b/methods/http.cc
@@ -657,7 +657,7 @@ void HttpMethod::SendReq(FetchItem *Itm,CircleBuf &Out)
will glitch HTTP/1.0 proxies because they do not filter it out and
pass it on, HTTP/1.1 says the connection should default to keep alive
and we expect the proxy to do this */
- if (Proxy.empty() == true)
+ if (Proxy.empty() == true || Proxy.Host.empty())
sprintf(Buf,"GET %s HTTP/1.1\r\nHost: %s\r\nConnection: keep-alive\r\n",
QuoteString(Uri.Path,"~").c_str(),ProperHost.c_str());
else