Author: jkupec Date: Mon Aug 6 18:04:26 2007 New Revision: 6497 URL: http://svn.opensuse.org/viewcvs/zypp?rev=6497&view=rev Log: - changed the versioned capability to be expected as NAME[OP<EDITION>] (without spaces) Modified: trunk/zypper/doc/zypper.8 trunk/zypper/src/zypper-misc.cc trunk/zypper/src/zypper.cc Modified: trunk/zypper/doc/zypper.8 URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/doc/zypper.8?rev=6497&r1=6496&r2=6497&view=diff ============================================================================== --- trunk/zypper/doc/zypper.8 (original) +++ trunk/zypper/doc/zypper.8 Mon Aug 6 18:04:26 2007 @@ -50,8 +50,8 @@ .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 Modified: trunk/zypper/src/zypper-misc.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-misc.cc?rev=6497&r1=6496&r2=6497&view=diff ============================================================================== --- trunk/zypper/src/zypper-misc.cc (original) +++ trunk/zypper/src/zypper-misc.cc Mon Aug 6 18:04:26 2007 @@ -136,7 +136,24 @@ 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); Modified: trunk/zypper/src/zypper.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper.cc?rev=6497&r1=6496&r2=6497&view=diff ============================================================================== --- trunk/zypper/src/zypper.cc (original) +++ trunk/zypper/src/zypper.cc Mon Aug 6 18:04:26 2007 @@ -284,7 +284,7 @@ "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" @@ -313,7 +313,7 @@ "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" -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org