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 ||
fprintf(output, "Multi-Arch: foreign\n");
else if ((Ver->MultiArch & pkgCache::Version::Same) == pkgCache::Version::Same)
fprintf(output, "Multi-Arch: same\n");
- signed short Pin = std::numeric_limits<signed short>::min();
std::set<string> Releases;
for (pkgCache::VerFileIterator I = Ver.FileList(); I.end() == false; ++I) {
pkgCache::PkgFileIterator File = I.File();
- signed short const p = Cache.GetPolicy().GetPriority(File);
- if (Pin < p)
- Pin = p;
if (File.Flagged(pkgCache::Flag::NotSource) == false) {
string Release = File.RelStr();
if (!Release.empty())
for (std::set<string>::iterator R = Releases.begin(); R != Releases.end(); ++R)
fprintf(output, " %s\n", R->c_str());
}
- fprintf(output, "APT-Pin: %d\n", Pin);
- if (Cache.GetCandidateVer(Pkg) == Ver)
+ fprintf(output, "APT-Pin: %d\n", Cache.GetPolicy().GetPriority(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");
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);
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") {
}
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)
{