{"no-recommends", no_argument, 0, 0 },
{"recommends", no_argument, 0, 0 },
{"download-only", no_argument, 0, 'd'},
+ {"download", required_argument, 0, 0 },
// rug compatibility - will mark all packages for installation (like 'in *')
{"entire-catalog", required_argument, 0, 0 },
{"help", no_argument, 0, 'h'},
// rug uses -N shorthand
{"dry-run", no_argument, 0, 'N'},
{"download-only", no_argument, 0, 'd'},
+ {"download", required_argument, 0, 0},
{"repo", required_argument, 0, 'r'},
{"no-recommends", no_argument, 0, 0},
{"help", no_argument, 0, 'h'},
static struct option options[] = {
{"dry-run", no_argument, 0, 'D'},
{"download-only", no_argument, 0, 'd'},
+ {"download", required_argument, 0, 0},
{"repo", required_argument, 0, 'r'},
{"debug-solver", no_argument, 0, 0},
{"help", no_argument, 0, 'h'},
// rug uses -N shorthand
{"dry-run", no_argument, 0, 'N'},
{"download-only", no_argument, 0, 'd'},
+ {"download", required_argument, 0, 0 },
// rug-compatibility - dummy for now
//! \todo category can now be implemented in 'patch' using PoolQuery
{"category", no_argument, 0, 'g'},
{"recommends", no_argument, 0, 0 },
{"dry-run", no_argument, 0, 'D'},
{"download-only", no_argument, 0, 'd'},
+ {"download", required_argument, 0, 0 },
{"bz", required_argument, 0, 'b'},
{"bugzilla", required_argument, 0, 'b'},
{"cve", required_argument, 0, 0 },
// rug uses -N shorthand
{"dry-run", no_argument, 0, 'N'},
{"download-only", no_argument, 0, 'd'},
+ {"download", required_argument, 0, 0 },
{"help", no_argument, 0, 'h'},
{0, 0, 0, 0}
};
bool install_not_remove = command() == ZypperCommand::INSTALL;
+ // parse the download options to check for errors
+ get_download_option(*this);
+
initRepoManager();
// check for rpm files among the arguments
if (copts.count("no-confirm"))
_gopts.non_interactive = true;
+ // parse the download options to check for errors
+ get_download_option(*this);
+
initRepoManager();
init_repos(*this);
Out::HIGH);
}
+ // parse the download options to check for errors
+ get_download_option(*this);
+
init_target(*this);
initRepoManager();
return;
}
+ // parse the download options to check for errors
+ get_download_option(*this);
+
initRepoManager();
if (!copts.count("repo") && !copts.count("from")
"man zypper"));
}
}
+
+DownloadMode get_download_option(Zypper & zypper)
+{
+ if (!zypper.cOpts().count("download") &&
+ !zypper.cOpts().count("download-only"))
+ return DownloadDefault; //! \todo FIXME return ZConfig value
+
+ string download;
+ parsed_opts::const_iterator it = zypper.cOpts().find("download");
+ if (it != zypper.cOpts().end())
+ download = it->second.front();
+ if (zypper.cOpts().count("download-only") || download == "only")
+ return DownloadOnly;
+ else if (download == "in-advance")
+ return DownloadInAdvance;
+ else if (download == "in-heaps")
+ return DownloadInHeaps;
+ else if (download == "as-needed")
+ return DownloadAsNeeded;
+ else
+ {
+ zypper.out().error(str::form(_("Unknown download mode '%s'."), download.c_str()));
+ zypper.out().info(str::form(_("Available download modes: %s"),
+ "only, in-advance, in-heaps, as-needed"));
+ zypper.setExitCode(ZYPPER_EXIT_ERR_INVALID_ARGS);
+ throw ExitRequestException("Unknown download mode");
+ }
+}