summaryrefslogtreecommitdiff
path: root/cmdline
diff options
context:
space:
mode:
authorMichael Vogt <egon@debian-devbox>2011-10-14 13:55:50 +0200
committerMichael Vogt <egon@debian-devbox>2011-10-14 13:55:50 +0200
commita1e68c33ac15be454984b00d62c7fc331bd0b32b (patch)
treeabf59def54f9df6bbf9aa380b1314364482d8b1c /cmdline
parent7be8c02360bdb9bd7f59b087da874f88af2a7206 (diff)
parent0e7c33134cd32410eb8b344c6b6577826238bbbc (diff)
merged lp:~donkult/apt/experimental
Diffstat (limited to 'cmdline')
-rw-r--r--cmdline/acqprogress.h4
-rw-r--r--cmdline/apt-cache.cc6
-rw-r--r--cmdline/apt-cdrom.cc2
-rw-r--r--cmdline/apt-config.cc1
-rw-r--r--cmdline/apt-dump-solver.cc1
-rw-r--r--cmdline/apt-extracttemplates.cc1
-rw-r--r--cmdline/apt-get.cc64
-rw-r--r--cmdline/apt-internal-solver.cc2
-rw-r--r--cmdline/apt-mark.cc1
-rw-r--r--cmdline/apt-sortpkgs.cc2
10 files changed, 57 insertions, 27 deletions
diff --git a/cmdline/acqprogress.h b/cmdline/acqprogress.h
index 48f90ae59..8f0903923 100644
--- a/cmdline/acqprogress.h
+++ b/cmdline/acqprogress.h
@@ -12,6 +12,8 @@
#include <apt-pkg/acquire.h>
+#include <string>
+
class AcqTextStatus : public pkgAcquireStatus
{
unsigned int &ScreenWidth;
@@ -21,7 +23,7 @@ class AcqTextStatus : public pkgAcquireStatus
public:
- virtual bool MediaChange(string Media,string Drive);
+ virtual bool MediaChange(std::string Media,std::string Drive);
virtual void IMSHit(pkgAcquire::ItemDesc &Itm);
virtual void Fetch(pkgAcquire::ItemDesc &Itm);
virtual void Done(pkgAcquire::ItemDesc &Itm);
diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc
index a4cdf784e..82a31c9b1 100644
--- a/cmdline/apt-cache.cc
+++ b/cmdline/apt-cache.cc
@@ -16,7 +16,6 @@
#include<config.h>
#include <apt-pkg/error.h>
-#include <apt-pkg/pkgcachegen.h>
#include <apt-pkg/cachefile.h>
#include <apt-pkg/cacheset.h>
#include <apt-pkg/init.h>
@@ -24,6 +23,7 @@
#include <apt-pkg/sourcelist.h>
#include <apt-pkg/cmndline.h>
#include <apt-pkg/strutl.h>
+#include <apt-pkg/fileutl.h>
#include <apt-pkg/pkgrecords.h>
#include <apt-pkg/srcrecords.h>
#include <apt-pkg/version.h>
@@ -31,6 +31,9 @@
#include <apt-pkg/tagfile.h>
#include <apt-pkg/algorithms.h>
#include <apt-pkg/sptr.h>
+#include <apt-pkg/pkgsystem.h>
+#include <apt-pkg/indexfile.h>
+#include <apt-pkg/metaindex.h>
#include <cassert>
#include <locale.h>
@@ -40,6 +43,7 @@
#include <regex.h>
#include <stdio.h>
#include <iomanip>
+#include <algorithm>
#include <apti18n.h>
/*}}}*/
diff --git a/cmdline/apt-cdrom.cc b/cmdline/apt-cdrom.cc
index 8608b1215..fa48debcd 100644
--- a/cmdline/apt-cdrom.cc
+++ b/cmdline/apt-cdrom.cc
@@ -23,6 +23,8 @@
#include <apt-pkg/acquire.h>
#include <apt-pkg/acquire-item.h>
#include <apt-pkg/cdrom.h>
+#include <apt-pkg/configuration.h>
+#include <apt-pkg/pkgsystem.h>
#include <locale.h>
#include <iostream>
diff --git a/cmdline/apt-config.cc b/cmdline/apt-config.cc
index df2958975..94f6ee9b0 100644
--- a/cmdline/apt-config.cc
+++ b/cmdline/apt-config.cc
@@ -24,6 +24,7 @@
#include <apt-pkg/strutl.h>
#include <apt-pkg/configuration.h>
#include <apt-pkg/aptconfiguration.h>
+#include <apt-pkg/pkgsystem.h>
#include <locale.h>
#include <iostream>
diff --git a/cmdline/apt-dump-solver.cc b/cmdline/apt-dump-solver.cc
index dab0cc6fd..e82e15c6e 100644
--- a/cmdline/apt-dump-solver.cc
+++ b/cmdline/apt-dump-solver.cc
@@ -12,6 +12,7 @@
#include <config.h>
#include <cstdio>
+#include <iostream>
/*}}}*/
// ShowHelp - Show a help screen /*{{{*/
diff --git a/cmdline/apt-extracttemplates.cc b/cmdline/apt-extracttemplates.cc
index 5d7b76c23..d5c1a3208 100644
--- a/cmdline/apt-extracttemplates.cc
+++ b/cmdline/apt-extracttemplates.cc
@@ -30,6 +30,7 @@
#include <apt-pkg/error.h>
#include <apt-pkg/strutl.h>
#include <apt-pkg/fileutl.h>
+#include <apt-pkg/pkgsystem.h>
#include <stdio.h>
#include <string.h>
diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc
index d8f207f0a..88e734697 100644
--- a/cmdline/apt-get.cc
+++ b/cmdline/apt-get.cc
@@ -36,6 +36,7 @@
#include <apt-pkg/algorithms.h>
#include <apt-pkg/acquire-item.h>
#include <apt-pkg/strutl.h>
+#include <apt-pkg/fileutl.h>
#include <apt-pkg/clean.h>
#include <apt-pkg/srcrecords.h>
#include <apt-pkg/version.h>
@@ -44,6 +45,10 @@
#include <apt-pkg/sptr.h>
#include <apt-pkg/md5.h>
#include <apt-pkg/versionmatch.h>
+#include <apt-pkg/progress.h>
+#include <apt-pkg/pkgsystem.h>
+#include <apt-pkg/pkgrecords.h>
+#include <apt-pkg/indexfile.h>
#include "acqprogress.h"
@@ -1684,8 +1689,9 @@ bool DoAutomaticRemove(CacheFile &Cache)
// install it in the first place, so nuke it instead of show it
if (Cache[Pkg].Install() == true && Pkg.CurrentVer() == 0)
{
+ if (Pkg.CandVersion() != 0)
+ tooMuch.insert(Pkg);
Cache->MarkDelete(Pkg, false);
- tooMuch.insert(Pkg);
}
// only show stuff in the list that is not yet marked for removal
else if(hideAutoRemove == false && Cache[Pkg].Delete() == false)
@@ -1709,33 +1715,41 @@ bool DoAutomaticRemove(CacheFile &Cache)
bool Changed;
do {
Changed = false;
- for (APT::PackageSet::const_iterator P = tooMuch.begin();
- P != tooMuch.end() && Changed == false; ++P)
+ for (APT::PackageSet::const_iterator Pkg = tooMuch.begin();
+ Pkg != tooMuch.end() && Changed == false; ++Pkg)
{
- for (pkgCache::DepIterator R = P.RevDependsList();
- R.end() == false; ++R)
- {
- if (R.IsNegative() == true ||
- Cache->IsImportantDep(R) == false)
- continue;
- pkgCache::PkgIterator N = R.ParentPkg();
- if (N.end() == true || (N->CurrentVer == 0 && (*Cache)[N].Install() == false))
- continue;
- if (Debug == true)
- std::clog << "Save " << P << " as another installed garbage package depends on it" << std::endl;
- Cache->MarkInstall(P, false);
- if(hideAutoRemove == false)
+ APT::PackageSet too;
+ too.insert(Pkg);
+ for (pkgCache::PrvIterator Prv = Cache[Pkg].CandidateVerIter(Cache).ProvidesList();
+ Prv.end() == false; ++Prv)
+ too.insert(Prv.ParentPkg());
+ for (APT::PackageSet::const_iterator P = too.begin();
+ P != too.end() && Changed == false; ++P) {
+ for (pkgCache::DepIterator R = P.RevDependsList();
+ R.end() == false; ++R)
{
- ++autoRemoveCount;
- if (smallList == false)
- {
- autoremovelist += P.FullName(true) + " ";
- autoremoveversions += string(Cache[P].CandVersion) + "\n";
- }
+ if (R.IsNegative() == true ||
+ Cache->IsImportantDep(R) == false)
+ continue;
+ pkgCache::PkgIterator N = R.ParentPkg();
+ if (N.end() == true || (N->CurrentVer == 0 && (*Cache)[N].Install() == false))
+ continue;
+ if (Debug == true)
+ std::clog << "Save " << Pkg << " as another installed garbage package depends on it" << std::endl;
+ Cache->MarkInstall(Pkg, false);
+ if (hideAutoRemove == false)
+ {
+ ++autoRemoveCount;
+ if (smallList == false)
+ {
+ autoremovelist += Pkg.FullName(true) + " ";
+ autoremoveversions += string(Cache[Pkg].CandVersion) + "\n";
+ }
+ }
+ tooMuch.erase(Pkg);
+ Changed = true;
+ break;
}
- tooMuch.erase(P);
- Changed = true;
- break;
}
}
} while (Changed == true);
diff --git a/cmdline/apt-internal-solver.cc b/cmdline/apt-internal-solver.cc
index ef6c688fe..1b636e4d5 100644
--- a/cmdline/apt-internal-solver.cc
+++ b/cmdline/apt-internal-solver.cc
@@ -11,10 +11,12 @@
#include <apt-pkg/cmndline.h>
#include <apt-pkg/init.h>
#include <apt-pkg/cachefile.h>
+#include <apt-pkg/cacheset.h>
#include <apt-pkg/strutl.h>
#include <apt-pkg/edsp.h>
#include <apt-pkg/algorithms.h>
#include <apt-pkg/fileutl.h>
+#include <apt-pkg/pkgsystem.h>
#include <config.h>
#include <apti18n.h>
diff --git a/cmdline/apt-mark.cc b/cmdline/apt-mark.cc
index 8c9a47913..339cbdf44 100644
--- a/cmdline/apt-mark.cc
+++ b/cmdline/apt-mark.cc
@@ -13,6 +13,7 @@
#include <apt-pkg/error.h>
#include <apt-pkg/init.h>
#include <apt-pkg/strutl.h>
+#include <apt-pkg/pkgsystem.h>
#include <algorithm>
diff --git a/cmdline/apt-sortpkgs.cc b/cmdline/apt-sortpkgs.cc
index 44b74cf6c..20ae14f2a 100644
--- a/cmdline/apt-sortpkgs.cc
+++ b/cmdline/apt-sortpkgs.cc
@@ -20,6 +20,8 @@
#include <apt-pkg/cmndline.h>
#include <apt-pkg/init.h>
#include <apt-pkg/strutl.h>
+#include <apt-pkg/fileutl.h>
+#include <apt-pkg/pkgsystem.h>
#include <vector>
#include <algorithm>