X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/4dc77823d360158d6870a5710cc8c17064f1308f..b2fd852459a6b9234255644730f48f071ccad64d:/apt-pkg/edsp.cc diff --git a/apt-pkg/edsp.cc b/apt-pkg/edsp.cc index 5c53581fe..59e8e7ab4 100644 --- a/apt-pkg/edsp.cc +++ b/apt-pkg/edsp.cc @@ -7,31 +7,25 @@ // Include Files /*{{{*/ #include -#include #include #include -#include -#include -#include -#include #include #include #include +#include +#include +#include +#include #include -#include #include #include #include -#include #include #include -#include #include -#include #include #include -#include #include /*}}}*/ @@ -54,6 +48,7 @@ static void WriteScenarioVersion(pkgDepCache &Cache, FILE* output, pkgCache::Pkg fprintf(output, "Source: %s\n", Ver.SourcePkgName()); fprintf(output, "Architecture: %s\n", Ver.Arch()); fprintf(output, "Version: %s\n", Ver.VerStr()); + fprintf(output, "Source-Version: %s\n", Ver.SourceVerStr()); if (Pkg.CurrentVer() == Ver) fprintf(output, "Installed: yes\n"); if (Pkg->SelectedState == pkgCache::State::Hold || @@ -89,7 +84,7 @@ static void WriteScenarioVersion(pkgDepCache &Cache, FILE* output, pkgCache::Pkg fprintf(output, " %s\n", R->c_str()); } fprintf(output, "APT-Pin: %d\n", Pin); - if (Cache.GetCandidateVer(Pkg) == Ver) + if (Cache.GetCandidateVersion(Pkg) == Ver) fprintf(output, "APT-Candidate: yes\n"); if ((Cache[Pkg].Flags & pkgCache::Flag::Auto) == pkgCache::Flag::Auto) fprintf(output, "APT-Automatic: yes\n"); @@ -102,7 +97,7 @@ static void WriteScenarioDependency( FILE* output, pkgCache::VerIterator const & bool orGroup = false; for (pkgCache::DepIterator Dep = Ver.DependsList(); Dep.end() == false; ++Dep) { - if (Dep.IsMultiArchImplicit() == true) + if (Dep.IsImplicit() == true) continue; if (orGroup == false) dependencies[Dep->Type].append(", "); @@ -126,6 +121,8 @@ static void WriteScenarioDependency( FILE* output, pkgCache::VerIterator const & if (Prv.IsMultiArchImplicit() == true) continue; provides.append(", ").append(Prv.Name()); + if (Prv->ProvideVersion != 0) + provides.append(" (= ").append(Prv.ProvideVersion()).append(")"); } if (provides.empty() == false) fprintf(output, "Provides: %s\n", provides.c_str()+2); @@ -140,7 +137,7 @@ static void WriteScenarioLimitedDependency(FILE* output, bool orGroup = false; for (pkgCache::DepIterator Dep = Ver.DependsList(); Dep.end() == false; ++Dep) { - if (Dep.IsMultiArchImplicit() == true) + if (Dep.IsImplicit() == true) continue; if (orGroup == false) { @@ -348,7 +345,11 @@ bool EDSP::ReadResponse(int const input, pkgDepCache &Cache, OpProgress *Progres pkgCache::VerIterator Ver(Cache.GetCache(), Cache.GetCache().VerP + VerIdx[id]); Cache.SetCandidateVersion(Ver); if (type == "Install") - Cache.MarkInstall(Ver.ParentPkg(), false, 0, false); + { + pkgCache::PkgIterator const P = Ver.ParentPkg(); + if (Cache[P].Mode != pkgDepCache::ModeInstall) + Cache.MarkInstall(P, false, 0, false); + } else if (type == "Remove") Cache.MarkDelete(Ver.ParentPkg(), false); else if (type == "Autoremove") { @@ -511,9 +512,10 @@ bool EDSP::WriteSolution(pkgDepCache &Cache, FILE* output) } else if (Cache[Pkg].NewInstall() == true || Cache[Pkg].Upgrade() == true) { - fprintf(output, "Install: %d\n", Cache.GetCandidateVer(Pkg)->ID); + pkgCache::VerIterator const CandVer = Cache.GetCandidateVersion(Pkg); + fprintf(output, "Install: %d\n", CandVer->ID); if (Debug == true) - fprintf(output, "Package: %s\nVersion: %s\n", Pkg.FullName().c_str(), Cache.GetCandidateVer(Pkg).VerStr()); + fprintf(output, "Package: %s\nVersion: %s\n", Pkg.FullName().c_str(), CandVer.VerStr()); } else if (Cache[Pkg].Garbage == true) {