The packages can be selected by their name or by a capability they provide.
-Capability is: NAME, or "NAME[OP<EDITION>]", where OP is <, <=, =, >=, or > and
-EDITION is VERSION[-RELEASE], for example: zypper=0.8.8-2.
+Capability is: NAME, or "NAME[.ARCH][OP<EDITION>]", where ARCH is architecture
+code, OP is <, <=, =, >=, or > and EDITION is VERSION[-RELEASE].
+For example: zypper=0.8.8-2.
The NAME component of a capability is not only a package name but any symbol
provided by packages: /bin/vi, libcurl.so.3, perl(Time::ParseDate).
This also means that if the package is already installed and newer versions
are available, it will get upgraded to the newest installable version.
+If ARCH is not specified, or the last dot of the capability name string is not
+followed by known architecture, the solver will treat the whole string
+as a capability name. If the ARCH is know, the solver will try to choose
+a package with the best compatible architecture to the one specified.
+
Zypper is also able to install plain RPM files while trying to satisfy their
dependencies using packages from defined repositories. You can install a plain
RPM file by specifying its location in the install command arguments either
_command_help = str::form(_(
// TranslatorExplanation the first %s = "package, patch, pattern, product"
// and the second %s = "package"
+ //! \todo A capability is NAME[.ARCH][OP<VERSION>] now,
+ //! the help text will be changed after release
"install (in) [options] <capability|rpm_file_uri> ...\n"
"\n"
"Install packages with specified capabilities or RPM files with"
if ((pos = str.rfind('.')) != string::npos)
{
arch = str.substr(pos + 1);
- str = str.substr(0, pos);
+ //str = str.substr(0, pos);
if (Arch(arch).isBuiltIn())
- force_by_name = true; // until there is a solver API for this
+ {
+ if (force_by_name)
+ {
+ zypper.out().error(
+ _("Specifying architecture when selecting packages by name"
+ " is not implemented."));
+ zypper.setExitCode(ZYPPER_EXIT_ERR_INVALID_ARGS);
+ throw ExitRequestException();
+ }
+
+ // name.arch is a valid capability since libzypp-4.15.0 (bnc #305445)
+ by_capability = true;
+ }
else
+ {
DBG << "Unknown arch (" << arch << ") in package " << str
- << ", will treat it like capability name." << endl;
+ << ", will treat it like part of the name" << endl;
+ /*
+ zypper.out().error(
+ str::form(_("Unknown architecture '%s'"), arch.c_str()),
+ _("When selecting packages by name, the last dot character must be followed\n"
+ "by a valid architecture code."));
+ zypper.setExitCode(ZYPPER_EXIT_ERR_INVALID_ARGS);
+ throw ExitRequestException();
+ */
+ }
}
// mark by name by force