From e782ab4bf7f6afcaa06af6e0a275cc36ea126e61 Mon Sep 17 00:00:00 2001 From: DongHun Kwak Date: Tue, 10 Jan 2017 14:44:38 +0900 Subject: [PATCH] Imported Upstream version 1.12.15 Change-Id: I778ea80b89a86fa25c39910f62ba8d9725c8f07d Signed-off-by: DongHun Kwak --- VERSION.cmake | 4 ++-- doc/zypper.8 | 9 +++++++-- doc/zypper.8.txt | 3 +++ package/zypper.changes | 7 +++++++ src/Zypper.cc | 18 ++++++++++++++++-- src/update.cc | 15 ++++++++++----- 6 files changed, 45 insertions(+), 11 deletions(-) diff --git a/VERSION.cmake b/VERSION.cmake index 5734f5c..7f78c44 100644 --- a/VERSION.cmake +++ b/VERSION.cmake @@ -34,7 +34,7 @@ # SET(VERSION_MAJOR "1") SET(VERSION_MINOR "12") -SET(VERSION_PATCH "14") +SET(VERSION_PATCH "15") -# LAST RELEASED: 1.12.14 +# LAST RELEASED: 1.12.15 #======= diff --git a/doc/zypper.8 b/doc/zypper.8 index fed8c6f..6d0aadb 100644 --- a/doc/zypper.8 +++ b/doc/zypper.8 @@ -2,12 +2,12 @@ .\" Title: zypper .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 09/08/2015 +.\" Date: 09/09/2015 .\" Manual: ZYPPER .\" Source: SUSE Linux .\" Language: English .\" -.TH "ZYPPER" "8" "09/08/2015" "SUSE Linux" "ZYPPER" +.TH "ZYPPER" "8" "09/09/2015" "SUSE Linux" "ZYPPER" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -939,6 +939,11 @@ section for details on exit status of \fB101\fR returned by this command\&. .PP +\fB\-\-updatestack\-only\fR +.RS 4 +Check only for patches which affect the package management itself\&. +.RE +.PP \fB\-r\fR, \fB\-\-repo\fR \fIalias\fR|\fIname\fR|\fI#\fR|\fIURI\fR .RS 4 Check for patches only in the repository specified by the alias, name, number, or URI\&. This option can be used multiple times\&. diff --git a/doc/zypper.8.txt b/doc/zypper.8.txt index e92c97d..69f68ce 100644 --- a/doc/zypper.8.txt +++ b/doc/zypper.8.txt @@ -523,6 +523,9 @@ Update Management Commands See also the *EXIT CODES* section for details on exit status of *0*, *100*, and *101* returned by this command. + -- + *--updatestack-only*:: + Check only for patches which affect the package management itself. + *-r*, *--repo* 'alias'|'name'|'#'|'URI':: Check for patches only in the repository specified by the alias, name, number, or URI. This option can be used multiple times. -- diff --git a/package/zypper.changes b/package/zypper.changes index 5eda12a..7532118 100644 --- a/package/zypper.changes +++ b/package/zypper.changes @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Wed Sep 9 16:04:54 CEST 2015 - ma@suse.de + +- patch-check --updatestack-only: Check only for patches which + affect the package management itself (FATE#319407) +- version 1.12.15 + +------------------------------------------------------------------- Tue Sep 8 19:01:25 CEST 2015 - ma@suse.de - patch --updatestack-only: Install only patches which affect the diff --git a/src/Zypper.cc b/src/Zypper.cc index bb31b83..db02e5b 100644 --- a/src/Zypper.cc +++ b/src/Zypper.cc @@ -160,6 +160,12 @@ namespace CommandHelpFormater & optionSection( boost::string_ref text_r ) { _mww.gotoNextPar(); _mww.writePar( text_r, 2 ); _mww.gotoNextPar(); return *this; } + CommandHelpFormater & optionSectionCommandOptions() + { return optionSection(_("Command options:") ); } + + CommandHelpFormater & optionSectionExpertOptions() + { return optionSection(_("Expert options:") ); } + /** Option definition * \code * "123456789012345678901234567890123456789 @@ -170,6 +176,10 @@ namespace CommandHelpFormater & option( boost::string_ref option_r, boost::string_ref text_r ) { _mww.writeDefinition( option_r , text_r, (option_r.starts_with( "--" )?4:0), 28 ); return *this; } + /** \todo eliminate legacy indentation */ + CommandHelpFormater & option26( boost::string_ref option_r, boost::string_ref text_r ) + { _mww.writeDefinition( option_r , text_r, (option_r.starts_with( "--" )?4:0), 26 ); return *this; } + private: std::ostringstream _str; mbs::MbsWriteWrapped _mww; @@ -2261,11 +2271,13 @@ void Zypper::processCommandOptions() {"repo", required_argument, 0, 'r'}, // rug compatibility option, we have --repo {"catalog", required_argument, 0, 'c'}, + {"updatestack-only", no_argument, 0, 0 }, {"help", no_argument, 0, 'h'}, {0, 0, 0, 0} }; specific_options = patch_check_options; - _command_help = _( + _command_help = ( CommandHelpFormater() + << _( "patch-check (pchk) [options]\n" "\n" "Check for available patches.\n" @@ -2273,7 +2285,9 @@ void Zypper::processCommandOptions() " Command options:\n" "\n" "-r, --repo Check for patches only in the specified repository.\n" - ); + ) ) + .option26("--updatestack-only", _("Check only for patches which affect the package management itself.") ) + ; break; } diff --git a/src/update.cc b/src/update.cc index 7128343..0455414 100755 --- a/src/update.cc +++ b/src/update.cc @@ -151,15 +151,20 @@ void patch_check () RuntimeData & gData = Zypper::instance()->runtimeData(); DBG << "patch check" << endl; gData.patches_count = gData.security_patches_count = 0; + bool updatestackOnly = Zypper::instance()->cOpts().count("updatestack-only"); for_( it, God->pool().byKindBegin(ResKind::patch), God->pool().byKindEnd(ResKind::patch) ) { const PoolItem & pi( *it ); - if ( pi.isRelevant() && !pi.isSatisfied()) + if ( pi.isBroken() ) { - gData.patches_count++; - if (pi->asKind()->categoryEnum() == Patch::CAT_SECURITY) - gData.security_patches_count++; + Patch::constPtr patch( pi->asKind() ); + if ( !updatestackOnly || patch->restartSuggested() ) + { + ++gData.patches_count; + if ( patch->categoryEnum() == Patch::CAT_SECURITY ) + ++gData.security_patches_count; + } } } @@ -203,7 +208,7 @@ static bool xml_list_patches (Zypper & zypper) { const PoolItem & pi( *it ); - if ( pi.isRelevant() && !pi.isSatisfied() && pi->asKind()->restartSuggested() ) + if ( pi.isBroken() && pi->asKind()->restartSuggested() ) { pkg_mgr_available = true; break; -- 2.7.4