summaryrefslogtreecommitdiff
path: root/apt-pkg/edsp.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2016-06-04 18:45:01 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2016-06-04 18:45:01 +0200
commit307d9eb2d13ee59191b86ffec2f36ba3fffc5c20 (patch)
tree33c362f9f5326fce81ccf8bce3ad30950629ad68 /apt-pkg/edsp.cc
parent0cfec3ab589c6309bf284438d2148c7742cdaf10 (diff)
edsp: use an ID mapping for the internal solver
Currently an EDSP solver gets send basically all versions which means the absolute count is the same, but that might not be true forever (and with the skipping of rc-only versions it kinda is already) and even if it were true, segfaulting on bad input seems wrong.
Diffstat (limited to 'apt-pkg/edsp.cc')
-rw-r--r--apt-pkg/edsp.cc13
1 files changed, 7 insertions, 6 deletions
diff --git a/apt-pkg/edsp.cc b/apt-pkg/edsp.cc
index 2aaffcfc7..f8925072e 100644
--- a/apt-pkg/edsp.cc
+++ b/apt-pkg/edsp.cc
@@ -17,6 +17,7 @@
#include <apt-pkg/edsp.h>
#include <apt-pkg/tagfile.h>
#include <apt-pkg/strutl.h>
+#include <apt-pkg/pkgsystem.h>
#include <ctype.h>
#include <stddef.h>
@@ -878,20 +879,20 @@ bool EDSP::WriteSolution(pkgDepCache &Cache, FILE* output)
{
if (Cache[Pkg].Delete() == true)
{
- fprintf(output, "Remove: %d\n", Pkg.CurrentVer()->ID);
+ fprintf(output, "Remove: %d\n", _system->GetVersionMapping(Pkg.CurrentVer()->ID));
if (Debug == true)
fprintf(output, "Package: %s\nVersion: %s\n", Pkg.FullName().c_str(), Pkg.CurrentVer().VerStr());
}
else if (Cache[Pkg].NewInstall() == true || Cache[Pkg].Upgrade() == true)
{
pkgCache::VerIterator const CandVer = Cache.GetCandidateVersion(Pkg);
- fprintf(output, "Install: %d\n", CandVer->ID);
+ fprintf(output, "Install: %d\n", _system->GetVersionMapping(CandVer->ID));
if (Debug == true)
fprintf(output, "Package: %s\nVersion: %s\n", Pkg.FullName().c_str(), CandVer.VerStr());
}
else if (Cache[Pkg].Garbage == true)
{
- fprintf(output, "Autoremove: %d\n", Pkg.CurrentVer()->ID);
+ fprintf(output, "Autoremove: %d\n", _system->GetVersionMapping(Pkg.CurrentVer()->ID));
if (Debug == true)
fprintf(output, "Package: %s\nVersion: %s\n", Pkg.FullName().c_str(), Pkg.CurrentVer().VerStr());
}
@@ -910,11 +911,11 @@ bool EDSP::WriteSolution(pkgDepCache &Cache, FileFd &output)
{
std::string action;
if (Cache[Pkg].Delete() == true)
- WriteOkay(Okay, output, "Remove: ", Pkg.CurrentVer()->ID, "\n");
+ WriteOkay(Okay, output, "Remove: ", _system->GetVersionMapping(Pkg.CurrentVer()->ID), "\n");
else if (Cache[Pkg].NewInstall() == true || Cache[Pkg].Upgrade() == true)
- WriteOkay(Okay, output, "Install: ", Cache.GetCandidateVersion(Pkg)->ID, "\n");
+ WriteOkay(Okay, output, "Install: ", _system->GetVersionMapping(Cache.GetCandidateVersion(Pkg)->ID), "\n");
else if (Cache[Pkg].Garbage == true)
- WriteOkay(Okay, output, "Autoremove: ", Pkg.CurrentVer()->ID, "\n");
+ WriteOkay(Okay, output, "Autoremove: ", _system->GetVersionMapping(Pkg.CurrentVer()->ID), "\n");
else
continue;