Work only with the repository specified by the alias, name, number, or URI. This
option can be used multiple times.
.TP
+.I \ \ \ \ \-\-download\-only
+Only download the packages, do not install.
+.TP
Examples:
Install build dependencies of dbus-1 source package:
static struct option src_install_options[] = {
{"build-deps-only", no_argument, 0, 'd'},
{"no-build-deps", no_argument, 0, 'D'},
+ {"download-only", no_argument, 0, 0},
{"repo", required_argument, 0, 'r'},
{"help", no_argument, 0, 'h'},
{0, 0, 0, 0}
"-d, --build-deps-only Install only build dependencies of specified packages.\n"
"-D, --no-build-deps Don't install build dependencies.\n"
"-r, --repo <alias|#|URI> Install packages only from specified repositories.\n"
+ " --download-only Only download the packages, do not install.\n"
);
break;
}
try
{
- God->installSrcPackage(srcpkg);
+ if (zypper.cOpts().find("download-only") != zypper.cOpts().end())
+ {
+ God->provideSrcPackage(srcpkg).resetDispose();
- zypper.out().info(boost::str(format(
- _("Source package %s-%s successfully installed."))
- % srcpkg->name() % srcpkg->edition()));
+ zypper.out().info(boost::str(format(
+ _("Source package %s-%s successfully retrieved."))
+ % srcpkg->name() % srcpkg->edition()));
+ }
+ else
+ {
+ God->installSrcPackage(srcpkg);
+
+ zypper.out().info(boost::str(format(
+ _("Source package %s-%s successfully installed."))
+ % srcpkg->name() % srcpkg->edition()));
+ }
}
catch (const Exception & ex)
{
ZYPP_CAUGHT(ex);
zypper.out().error(ex,
- boost::str(format(_("Problem installing source package %s-%s:"))
+ boost::str(format(_("Problem installing source package %s-%s:"))
% srcpkg->name() % srcpkg->edition()));
zypper.setExitCode(ZYPPER_EXIT_ERR_ZYPP);