-
- if (modifierPresent == true) {
- bool const errors = helper.showErrors(false);
- VersionSet const vset = VersionSet::FromString(Cache, std::string(*I), select, helper, true);
- helper.showErrors(errors);
- if (vset.empty() == false) {
- versets[fallback].insert(vset);
+ modifierPresent = true;
+ break;
+ }
+ if (modifierPresent == true) {
+ bool const errors = helper.showErrors(false);
+ pkgCache::PkgIterator Pkg = FromName(Cache, cmdline, helper);
+ helper.showErrors(errors);
+ if (Pkg.end() == false) {
+ pci->insert(Pkg);
+ modID = fallback;
+ return true;
+ }
+ }
+ return FromString(pci, Cache, str, helper);
+}
+ /*}}}*/
+// FromModifierCommandLine - helper doing the work for VER:GroupedFromCommandLine /*{{{*/
+bool VersionContainerInterface::FromModifierCommandLine(unsigned short &modID,
+ VersionContainerInterface * const vci,
+ pkgCacheFile &Cache, const char * cmdline,
+ std::list<Modifier> const &mods,
+ CacheSetHelper &helper) {
+ Version select = NEWEST;
+ std::string str = cmdline;
+ bool modifierPresent = false;
+ unsigned short fallback = modID;
+ for (std::list<Modifier>::const_iterator mod = mods.begin();
+ mod != mods.end(); ++mod) {
+ if (modID == fallback && mod->ID == fallback)
+ select = mod->SelectVersion;
+ size_t const alength = strlen(mod->Alias);
+ switch(mod->Pos) {
+ case Modifier::POSTFIX:
+ if (str.compare(str.length() - alength, alength,
+ mod->Alias, 0, alength) != 0)