summaryrefslogtreecommitdiff
path: root/apt-pkg/edsp.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2016-06-03 13:09:13 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2016-06-27 11:57:12 +0200
commit4cdc3bf0e24a74b0af45e1cbabfcaebd9d0c3318 (patch)
tree1a4cf6874b23050e876dd093e8dd33efbba269ec /apt-pkg/edsp.cc
parentf74d99c6a78caafdc6e32d8cb135683b7154795c (diff)
eipp: make no difference between remove & purge
For the order there is no inherent difference between delete or purge, so we don't tell the planer about this and instead decide in apt if a package should be purged or not which also allows us to not tell the planer about rc-only purges as we can trivially do this on our on as there is no need to plan such purges.
Diffstat (limited to 'apt-pkg/edsp.cc')
-rw-r--r--apt-pkg/edsp.cc16
1 files changed, 11 insertions, 5 deletions
diff --git a/apt-pkg/edsp.cc b/apt-pkg/edsp.cc
index ae5c7a373..f2d728933 100644
--- a/apt-pkg/edsp.cc
+++ b/apt-pkg/edsp.cc
@@ -1094,6 +1094,14 @@ bool EIPP::OrderInstall(char const * const solver, pkgPackageManager * const PM,
if (Progress != NULL)
Progress->OverallProgress(25, 100, 75, _("Execute external planer"));
+
+ // we don't tell the external planers about boring things
+ for (auto Pkg = PM->Cache.PkgBegin(); Pkg.end() == false; ++Pkg)
+ {
+ if (Pkg->CurrentState == pkgCache::State::ConfigFiles && PM->Cache[Pkg].Purge() == true)
+ PM->Remove(Pkg, true);
+ }
+
if (Okay && EIPP::ReadResponse(solver_out, PM, Progress) == false)
return false;
@@ -1108,15 +1116,15 @@ bool EIPP::WriteRequest(pkgDepCache &Cache, FileFd &output, /*{{{*/
if (Progress != NULL)
Progress->SubProgress(Cache.Head().PackageCount, _("Send request to planer"));
unsigned long p = 0;
- string del, purge, inst, reinst;
+ string del, inst, reinst;
for (pkgCache::PkgIterator Pkg = Cache.PkgBegin(); Pkg.end() == false; ++Pkg, ++p)
{
if (Progress != NULL && p % 100 == 0)
Progress->Progress(p);
string* req;
pkgDepCache::StateCache &P = Cache[Pkg];
- if (P.Purge() == true)
- req = &purge;
+ if (P.Purge() == true && Pkg->CurrentState == pkgCache::State::ConfigFiles)
+ continue;
if (P.Delete() == true)
req = &del;
else if (P.NewInstall() == true || P.Upgrade() == true || P.Downgrade() == true)
@@ -1137,8 +1145,6 @@ bool EIPP::WriteRequest(pkgDepCache &Cache, FileFd &output, /*{{{*/
WriteOkay(Okay, output, " ", *a);
WriteOkay(Okay, output, "\n");
- if (purge.empty() == false)
- WriteOkay(Okay, output, "Purge:", purge, "\n");
if (del.empty() == false)
WriteOkay(Okay, output, "Remove:", del, "\n");
if (inst.empty() == false)