From 285864bd031d9438638939282fe53805139cc999 Mon Sep 17 00:00:00 2001 From: Michael Andres Date: Tue, 10 Jun 2014 13:17:00 +0200 Subject: [PATCH] Add '--details' to show the detailed installation summary (bnc#721823) --- doc/zypper.8 | 21 +++++++++++++++++++++ src/Zypper.cc | 14 ++++++++++++++ src/solve-commit.cc | 4 +++- 3 files changed, 38 insertions(+), 1 deletion(-) diff --git a/doc/zypper.8 b/doc/zypper.8 index 1dc8170..81866be 100644 --- a/doc/zypper.8 +++ b/doc/zypper.8 @@ -359,6 +359,9 @@ non-interactive mode. If this option is specified, it takes the preference. Test the installation, do not actually install any package. This option will add the \-\-test option to the rpm commands run by the install command. .TP +.I \ \ \ \ \-\-details +Show the detailed installation summary. +.TP Download-and-install mode options: .TP .I \-d, \-\-download\-only @@ -458,6 +461,9 @@ required ones to be installed. .I \-D, \-\-dry-run Test the repair, do not actually do anything to the system. .TP +.I \ \ \ \ \-\-details +Show the detailed installation summary. +.TP \fI\-r, \-\-repo\fR Work only with the repository specified by the alias, name, number, or URI. This option can be used multiple times. @@ -479,6 +485,9 @@ option can be used multiple times. .I \-D, \-\-dry-run Test the installation, do not actually install anything. .TP +.I \ \ \ \ \-\-details +Show the detailed installation summary. +.TP .I \ \ \ \ \-\-debug\-solver Create solver test case for debugging. See the install command for details. .TP @@ -541,6 +550,9 @@ No automatic removal of unneeded dependencies. .I \-D, \-\-dry\-run Test the removal of packages, do not actually remove anything. This option will add the \-\-test option to the rpm commands run by the remove command. +.TP +.I \ \ \ \ \-\-details +Show the detailed installation summary. .SS Update Management Commands @@ -637,6 +649,9 @@ The default behavior is 'no-force'. If this option is specified, it takes the pr Test the update, do not actually install or update any package. This option will add the \-\-test option to the rpm commands run by the update command. .TP +.I \ \ \ \ \-\-details +Show the detailed installation summary. +.TP .I \ \ \ \ \-\-best\-effort Do a 'best effort' approach to update. This method does not explicitly select packages with best version and architecture, but instead requests installation @@ -750,6 +765,9 @@ Test the update, do not actually update. .TP This command also accepts the download-and-install mode options described in the \fBinstall\fR command description. +.TP +.I \ \ \ \ \-\-details +Show the detailed installation summary. .TP @@ -810,6 +828,9 @@ add the \-\-test option to the rpm commands run by the dist-upgrade command. This command also accepts the download-and-install mode options described in the \fBinstall\fR command description. .TP +.I \ \ \ \ \-\-details +Show the detailed installation summary. +.TP Examples: Upgrade the system using 'factory' and 'packman' repository: diff --git a/src/Zypper.cc b/src/Zypper.cc index cc54d17..65f141c 100644 --- a/src/Zypper.cc +++ b/src/Zypper.cc @@ -1058,6 +1058,7 @@ void Zypper::processCommandOptions() {"dry-run", no_argument, 0, 'N'}, {"no-recommends", no_argument, 0, 0 }, {"recommends", no_argument, 0, 0 }, + {"details", no_argument, 0, 0 }, {"download", required_argument, 0, 0 }, // aliases for --download // in --download-only, -d must be kept for backward and rug compatibility @@ -1109,6 +1110,7 @@ void Zypper::processCommandOptions() " --force-resolution Force the solver to find a solution (even\n" " an aggressive one).\n" "-D, --dry-run Test the installation, do not actually install.\n" + " --details Show the detailed installation summary.\n" " --download Set the download-install mode. Available modes:\n" " %s\n" "-d, --download-only Only download the packages, do not install.\n" @@ -1136,6 +1138,7 @@ void Zypper::processCommandOptions() {"clean-deps", no_argument, 0, 'u'}, {"no-clean-deps", no_argument, 0, 'U'}, {"dry-run", no_argument, 0, 'D'}, + {"details", no_argument, 0, 0 }, // rug uses -N shorthand {"dry-run", no_argument, 0, 'N'}, {"help", no_argument, 0, 'h'}, @@ -1165,6 +1168,7 @@ void Zypper::processCommandOptions() "-u, --clean-deps Automatically remove unneeded dependencies.\n" "-U, --no-clean-deps No automatic removal of unneeded dependencies.\n" "-D, --dry-run Test the removal, do not actually remove.\n" + " --details Show the detailed installation summary.\n" ), "package, patch, pattern, product", "package"); break; } @@ -1202,6 +1206,7 @@ void Zypper::processCommandOptions() {"dry-run", no_argument, 0, 'D'}, // rug uses -N shorthand {"dry-run", no_argument, 0, 'N'}, + {"details", no_argument, 0, 0 }, {"download", required_argument, 0, 0 }, // aliases for --download // in --download-only, -d must be kept for backward and rug compatibility @@ -1230,6 +1235,7 @@ void Zypper::processCommandOptions() " to the required.\n" "-D, --dry-run Test the repair, do not actually do anything to\n" " the system.\n" + " --details Show the detailed installation summary.\n" " --download Set the download-install mode. Available modes:\n" " %s\n" "-d, --download-only Only download the packages, do not install.\n" @@ -1241,6 +1247,7 @@ void Zypper::processCommandOptions() { static struct option options[] = { {"dry-run", no_argument, 0, 'D'}, + {"details", no_argument, 0, 0 }, {"download", required_argument, 0, 0 }, // aliases for --download // in --download-only, -d must be kept for backward and rug compatibility @@ -1264,6 +1271,7 @@ void Zypper::processCommandOptions() " Command options:\n" "-r, --repo Load only the specified repositories.\n" "-D, --dry-run Test the installation, do not actually install.\n" + " --details Show the detailed installation summary.\n" " --download Set the download-install mode. Available modes:\n" " %s\n" "-d, --download-only Only download the packages, do not install.\n" @@ -1737,6 +1745,7 @@ void Zypper::processCommandOptions() {"dry-run", no_argument, 0, 'D'}, // rug uses -N shorthand {"dry-run", no_argument, 0, 'N'}, + {"details", no_argument, 0, 0 }, {"download", required_argument, 0, 0 }, // aliases for --download // in --download-only, -d must be kept for backward and rug compatibility @@ -1785,6 +1794,7 @@ void Zypper::processCommandOptions() " --force-resolution Force the solver to find a solution (even\n" " an aggressive one).\n" "-D, --dry-run Test the update, do not actually update.\n" + " --details Show the detailed installation summary.\n" " --download Set the download-install mode. Available modes:\n" " %s\n" "-d, --download-only Only download the packages, do not install.\n" @@ -1806,6 +1816,7 @@ void Zypper::processCommandOptions() {"recommends", no_argument, 0, 0 }, {"replacefiles", no_argument, 0, 0 }, {"dry-run", no_argument, 0, 'D'}, + {"details", no_argument, 0, 0 }, {"download", required_argument, 0, 0 }, // aliases for --download // in --download-only, -d must be kept for backward and rug compatibility @@ -1848,6 +1859,7 @@ void Zypper::processCommandOptions() " as an error. --download-as-needed disables the fileconflict check.\n" "-r, --repo Load only the specified repository.\n" "-D, --dry-run Test the update, do not actually update.\n" + " --details Show the detailed installation summary.\n" " --download Set the download-install mode. Available modes:\n" " %s\n" "-d, --download-only Only download the packages, do not install.\n" @@ -1900,6 +1912,7 @@ void Zypper::processCommandOptions() {"dry-run", no_argument, 0, 'D'}, // rug uses -N shorthand {"dry-run", no_argument, 0, 'N'}, + {"details", no_argument, 0, 0 }, {"download", required_argument, 0, 0 }, // aliases for --download // in --download-only, -d must be kept for backward and rug compatibility @@ -1932,6 +1945,7 @@ void Zypper::processCommandOptions() " already installed, packages. Default is to treat file conflicts\n" " as an error. --download-as-needed disables the fileconflict check.\n" "-D, --dry-run Test the upgrade, do not actually upgrade\n" + " --details Show the detailed installation summary.\n" " --download Set the download-install mode. Available modes:\n" " %s\n" "-d, --download-only Only download the packages, do not install.\n" diff --git a/src/solve-commit.cc b/src/solve-commit.cc index 98d2602..5611510 100755 --- a/src/solve-commit.cc +++ b/src/solve-commit.cc @@ -559,7 +559,9 @@ void solve_and_commit (Zypper & zypper) Summary summary(God->pool()); - if (zypper.out().verbosity() == Out::HIGH) + if ( zypper.cOpts().count("details") ) + summary.setViewOption(Summary::DETAILS); + else if (zypper.out().verbosity() == Out::HIGH) summary.setViewOption(Summary::SHOW_VERSION); else if (zypper.out().verbosity() == Out::DEBUG) summary.setViewOption(Summary::SHOW_ALL); -- 2.7.4