}
if (pattern[pattern.length() -1] != '^')
- return APT::PackageSet();
+ return APT::PackageSet(TASK);
pattern.erase(pattern.length()-1);
if (unlikely(Cache.GetPkgCache() == 0 || Cache.GetDepCache() == 0))
- return APT::PackageSet();
+ return APT::PackageSet(TASK);
- PackageSet pkgset;
+ PackageSet pkgset(TASK);
// get the records
pkgRecords Recs(Cache);
PackageSet PackageSet::FromRegEx(pkgCacheFile &Cache, std::string pattern, CacheSetHelper &helper) {
static const char * const isregex = ".?+*|[^$";
if (pattern.find_first_of(isregex) == std::string::npos)
- return PackageSet();
+ return PackageSet(REGEX);
size_t archfound = pattern.find_last_of(':');
std::string arch = "native";
char Error[300];
regerror(Res, &Pattern, Error, sizeof(Error));
_error->Error(_("Regex compilation error - %s"), Error);
- return PackageSet();
+ return PackageSet(REGEX);
}
if (unlikely(Cache.GetPkgCache() == 0))
- return PackageSet();
+ return PackageSet(REGEX);
- PackageSet pkgset;
+ PackageSet pkgset(REGEX);
for (pkgCache::GrpIterator Grp = Cache.GetPkgCache()->GrpBegin(); Grp.end() == false; ++Grp)
{
if (regexec(&Pattern, Grp.Name(), 0, 0, 0) != 0)
}
VersionSet verset;
+ bool errors = true;
+ if (pkgset.getConstructor() != PackageSet::UNKNOWN)
+ errors = helper.showErrors(false);
for (PackageSet::const_iterator P = pkgset.begin();
P != pkgset.end(); ++P) {
+ helper.canNotFindCandidateVer(Cache, P);
if (vertag == string::npos) {
verset.insert(VersionSet::FromPackage(Cache, P, fallback, helper));
continue;
helper.showSelectedVersion(P, V, ver, verIsRel);
verset.insert(V);
}
+ if (pkgset.getConstructor() != PackageSet::UNKNOWN)
+ helper.showErrors(errors);
return verset;
}
/*}}}*/
pkgCache::PkgIterator const &Pkg) {
if (ShowError == true)
_error->Error(_("Can't select newest version from package '%s' as it is purely virtual"), Pkg.FullName(true).c_str());
- return pkgCache::VerIterator(Cache);
+ return pkgCache::VerIterator(Cache, 0);
}
/*}}}*/
// canNotFindCandidateVer /*{{{*/
pkgCache::PkgIterator const &Pkg) {
if (ShowError == true)
_error->Error(_("Can't select candidate version from package %s as it has no candidate"), Pkg.FullName(true).c_str());
- return pkgCache::VerIterator(Cache);
+ return pkgCache::VerIterator(Cache, 0);
}
/*}}}*/
// canNotFindInstalledVer /*{{{*/
pkgCache::PkgIterator const &Pkg) {
if (ShowError == true)
_error->Error(_("Can't select installed version from package %s as it is not installed"), Pkg.FullName(true).c_str());
- return pkgCache::VerIterator(Cache);
+ return pkgCache::VerIterator(Cache, 0);
}
/*}}}*/
}