// --------------------------------------------------------------------------
Summary::Summary(const zypp::ResPool & pool, const ViewOptions options)
- : _viewop(options), _show_repo_alias(false), _wrap_width(80), _force_no_color(false)
+ : _viewop(options)
+ , _show_repo_alias(false)
+ , _wrap_width(80)
+ , _force_no_color(false)
+ , _download_only(false)
{
readPool(pool);
}
if (_todownload > 0)
s << format(_("Overall download size: %s.")) % _todownload << " ";
- // installed size change info
- if (_inst_size_change > 0)
- // TrasnlatorExplanation %s will be substituted by a byte count e.g. 212 K
- s << format(_("After the operation, additional %s will be used."))
- % _inst_size_change.asString(0,1,1);
- else if (_inst_size_change == 0)
- s << _("No additional space will be used or freed after the operation.");
+ if (_download_only)
+ s << _("Download only.");
else
{
- // get the absolute size
- ByteCount abs;
- abs = (-_inst_size_change);
- // TrasnlatorExplanation %s will be substituted by a byte count e.g. 212 K
- s << format(_("After the operation, %s will be freed.")) % abs.asString(0,1,1);
+ // installed size change info
+ if (_inst_size_change > 0)
+ // TrasnlatorExplanation %s will be substituted by a byte count e.g. 212 K
+ s << format(_("After the operation, additional %s will be used."))
+ % _inst_size_change.asString(0,1,1);
+ else if (_inst_size_change == 0)
+ s << _("No additional space will be used or freed after the operation.");
+ else
+ {
+ // get the absolute size
+ ByteCount abs;
+ abs = (-_inst_size_change);
+ // TrasnlatorExplanation %s will be substituted by a byte count e.g. 212 K
+ s << format(_("After the operation, %s will be freed.")) % abs.asString(0,1,1);
+ }
}
mbs_write_wrapped(out, s.str(), 0, _wrap_width);
{ _show_repo_alias = value; }
void setForceNoColor(bool value = true)
{ _force_no_color = value; }
+ void setDownloadOnly(bool value = true)
+ { _download_only = value; }
void writeNewlyInstalled(std::ostream & out);
void writeRemoved(std::ostream & out);
bool _show_repo_alias;
mutable unsigned _wrap_width;
bool _force_no_color;
+ bool _download_only;
bool _need_reboot;
bool _need_restart;
// ----------------------------------------------------------------------------
-DownloadMode get_download_option(Zypper & zypper)
+DownloadMode get_download_option(Zypper & zypper, bool quiet)
{
DownloadMode mode;
DownloadMode zconfig = ZConfig::instance().commit_downloadMode();
}
// warn about the override, both were specified
- if (!download.empty() &&
+ if (!quiet && !download.empty() &&
(zypper.cOpts().count("download-only") ||
zypper.cOpts().count("download-in-advance") ||
zypper.cOpts().count("download-in-heaps") ||
str::form(_("Option '%s' overrides '%s'."), "--download", "--download-*"));
}
+ if (quiet)
+ return mode;
+
MIL << "Download mode: ";
if (mode == DownloadInAdvance) MIL << "in-advance";
else if (mode == DownloadInHeaps) MIL << "in-heaps";