+ /* If this is the status file, and the current version is not the
+ version in the status file (ie it is not installed, or somesuch)
+ then it is not a candidate for installation, ever. This weeds
+ out bogus entries that may be due to config-file states, or
+ other. */
+ if ((VF.File()->Flags & pkgCache::Flag::NotSource) ==
+ pkgCache::Flag::NotSource && Pkg.CurrentVer() != Ver)
+ continue;
+
+ // We match against a concrete version (or a part of this version)
+ if (VerTag.empty() == false && strncmp(VerTag.c_str(), Ver.VerStr(), VerTag.size()) != 0)
+ continue;
+
+ // or we match against a release
+ if(VerTag.empty() == false ||
+ (VF.File().Archive() != 0 && VF.File().Archive() == DefRel) ||
+ (VF.File().Codename() != 0 && VF.File().Codename() == DefRel))
+ {
+ pkgRecords::Parser &Parse = Recs.Lookup(VF);
+ Src = Parse.SourcePkg();
+ if (VerTag.empty() == true)
+ VerTag = Parse.SourceVer();
+ break;
+ }