.B install (in) <capability> ...
Install resolvables.
-Capability is: NAME, or "NAME OP EDITION", where OP is < <= = >= > and
-EDITION is VERSION[-RELEASE].
+Capability is: NAME, or "NAME[OP<EDITION>]", where OP is < <= = >= > and
+EDITION is VERSION[-RELEASE], for example: zypper-0.8.8-2.
Names are not only package names but any symbols provided by packages:
/bin/vi, libcurl.so.3, perl(Time::ParseDate). Just remember to quote to protect the
Capability safe_parse_cap (const ResObject::Kind &kind, const string & capstr) {
Capability cap;
try {
- cap = CapFactory().parse (kind, capstr);
+ // expect named caps as NAME[OP<EDITION>]
+ // transform to NAME[ OP <EDITION>] (add spaces)
+ string new_capstr = capstr;
+ cout_vv << "capstr: " << capstr << endl;
+ int op_pos = capstr.find_first_of("<>=");
+ if (op_pos != string::npos)
+ {
+ new_capstr.insert(op_pos, " ");
+ cout_vv << "new capstr: " << new_capstr << endl;
+ op_pos = new_capstr.find_first_not_of("<>=", op_pos + 1);
+ if (op_pos != string::npos && new_capstr.size() > op_pos)
+ {
+ new_capstr.insert(op_pos, " ");
+ cout_vv << "new capstr: " << new_capstr << endl;
+ }
+ }
+
+ cap = CapFactory().parse (kind, new_capstr);
}
catch (const Exception& e) {
ZYPP_CAUGHT(e);
"install (in) [options] <capability> ...\n"
"\n"
"Install resolvables with specified capabilities. A capability is"
- " NAME[ OP <VERSION>], where OP is one of <, <=, =, >=, >.\n"
+ " NAME[OP<VERSION>], where OP is one of <, <=, =, >=, >.\n"
"\n"
" Command options:\n"
"-r, --repo <alias> Install resolvables only from repository specified by alias.\n"
"remove (rm) [options] <capability> ...\n"
"\n"
"Remove resolvables with specified capabilities. A capability is"
- " NAME[ OP <VERSION>], where OP is one of <, <=, =, >=, >.\n"
+ " NAME[OP<VERSION>], where OP is one of <, <=, =, >=, >.\n"
"\n"
" Command options:\n"
"-r, --repo <alias> Operate only with resolvables from repository specified by alias.\n"