From: DongHun Kwak Date: Tue, 10 Jan 2017 05:31:30 +0000 (+0900) Subject: Imported Upstream version 1.12.3 X-Git-Tag: upstream/1.12.3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F93%2F109393%2F1;p=platform%2Fupstream%2Fzypper.git Imported Upstream version 1.12.3 Change-Id: Iebab2f3a8970c9a78d15980727def6fdbea05db8 Signed-off-by: DongHun Kwak --- diff --git a/VERSION.cmake b/VERSION.cmake index c6da195..bffb5f0 100644 --- a/VERSION.cmake +++ b/VERSION.cmake @@ -34,7 +34,7 @@ # SET(VERSION_MAJOR "1") SET(VERSION_MINOR "12") -SET(VERSION_PATCH "2") +SET(VERSION_PATCH "3") -# LAST RELEASED: 1.12.2 +# LAST RELEASED: 1.12.3 #======= diff --git a/package/zypper.changes b/package/zypper.changes index 1bf0b44..817849c 100644 --- a/package/zypper.changes +++ b/package/zypper.changes @@ -1,4 +1,24 @@ ------------------------------------------------------------------- +Wed Jun 3 13:05:29 CEST 2015 - ma@suse.de + +- Tab completion for package names in install+remove+update + commands (bnc#928650) +- Adapt enterprise product detection (bnc#933277) +- removerepo: Warn user that deleting a service repo is a volatile + change (bnc#929990) +- version 1.12.3 + +------------------------------------------------------------------- +Sun May 31 01:13:12 CEST 2015 - ma@suse.de + +- Update zypper-po.tar.bz2 + +------------------------------------------------------------------- +Thu May 28 01:14:16 CEST 2015 - ma@suse.de + +- Update zypper-po.tar.bz2 + +------------------------------------------------------------------- Sun May 24 18:21:03 CEST 2015 - ma@suse.de - man: add section about GPG checks diff --git a/po/zypper-po.tar.bz2 b/po/zypper-po.tar.bz2 index d54c849..815e692 100644 Binary files a/po/zypper-po.tar.bz2 and b/po/zypper-po.tar.bz2 differ diff --git a/src/bash-completion.sh b/src/bash-completion.sh index 8744efc..5cc11f9 100644 --- a/src/bash-completion.sh +++ b/src/bash-completion.sh @@ -2,10 +2,9 @@ # # A hackweek gift from Marek Stopka # Major rewrite by Josef Reidinger -# 2009/02/19 Allow empty spaces in repos names, Werner Fink +# 2009-02-19 Allow empty spaces in repos names, Werner Fink +# 2015-04-26 add completion for install+remove+update commands, Bernhard M. Wiedemann # -# some TODOs: -# - complete package names for install/remove/update _strip() { @@ -23,8 +22,28 @@ _strip() fi } +_installed_packages() { + ! [[ $cur =~ / ]] || return + grep -s --no-filename "^$cur" "/var/cache/zypp/solv/@System/solv.idx" | cut -f1 +} + +_available_solvables2() { + local lcur=$1 + ! [[ $cur =~ / ]] || return # for installing local packages + set +o noglob + grep -s --no-filename "^$lcur" /var/cache/zypp/solv/*/solv.idx |\ + cut -f1 | sort --unique + set -o noglob +} +_available_solvables() { + _available_solvables2 "$1:$cur" | sed -e "s/^$1://" +} +_available_packages() { + [[ $cur ]] || return # this case is too slow with tenthousands of completions + _available_solvables2 $cur +} + _zypper() { - ZYPPER_CMDLIST=() ZYPPER="$(type -p zypper)" local noglob=$(shopt -po noglob) @@ -112,9 +131,12 @@ _zypper() { fi if test -n "$command" ; then - opts=$(LC_ALL=POSIX $ZYPPER -q help $command 2>&1 | sed -e "1,/$magic_string/d" -e 's/.*--/--/' -e 's/ .*//') + if ! [[ $cur =~ ^[^-] ]] ; then + opts=$(LC_ALL=POSIX $ZYPPER -q help $command 2>&1 | sed -e "1,/$magic_string/d" -e 's/.*--/--/' -e 's/ .*//') + fi #handling individual commands if they need more then we can dig from help + if ! [[ $cur =~ ^- ]] ; then case "$command" in help | \?) opts=(${ZYPPER_CMDLIST[@]}) @@ -146,7 +168,23 @@ _zypper() { p }')) ;; + product-info) + opts=(${opts[@]}$(echo; _available_solvables product )) + ;; + pattern-info) + opts=(${opts[@]}$(echo; _available_solvables pattern )) + ;; + patch-info ) + opts=(${opts[@]}$(echo; _available_solvables patch )) + ;; + remove | rm | update | up) + opts=(${opts[@]}$(echo; _installed_packages )) + ;; + install | in | source-install | si | download | info | if) + opts=(${opts[@]}$(echo; _available_packages )) + ;; esac + fi IFS=$'\n' COMPREPLY=($(compgen -W "${opts[*]}" -- ${cur})) _strip diff --git a/src/info.cc b/src/info.cc index 03b9159..53ab32c 100644 --- a/src/info.cc +++ b/src/info.cc @@ -204,8 +204,7 @@ void printPkgInfo(Zypper & zypper, const ui::Selectable & s) printNVA(theone.resolvable()); // if running on SUSE Linux Enterprise, report unsupported packages - Product::constPtr platform = God->target()->baseProduct(); - if (platform && platform->name().find("SUSE_SLE") != string::npos) + if ( runningOnEnterprise() ) { Package::constPtr pkg = asKind(theone.resolvable()); cout << _("Support Level: ") << asUserString(pkg->vendorSupport()) << endl; diff --git a/src/repos.cc b/src/repos.cc index 195a568..b4f9e01 100644 --- a/src/repos.cc +++ b/src/repos.cc @@ -46,6 +46,21 @@ static bool refresh_service(Zypper & zypper, const ServiceInfo & service); // ---------------------------------------------------------------------------- +inline std::string volatileTag() +{ + // translators: used as 'XYZ changed to SOMETHING [volatile]' to tag specific property changes. + return std::string( " [" + ColorString( ColorContext::MSG_WARNING, _("volatile") ).str() + "]" ); +} + +inline std::string volatileServiceRepoChange( const RepoInfo & repo_r ) +{ + return boost::str(format( + // translators: 'Volatile' refers to changes we previously tagged as 'XYZ changed to SOMETHING [volatile]' + _("Repo '%1%' is managed by service '%2%'. Volatile changes are reset by the next service refresh!") + ) % repo_r.alias() % repo_r.service() ); +} + + template void safe_lexical_cast (Source s, Target &tr) { try { @@ -1941,11 +1956,20 @@ ostream& operator << (ostream& s, const vector& v) { void remove_repo(Zypper & zypper, const RepoInfo & repoinfo) { + bool isServiceRepo = !repoinfo.service().empty(); + RepoManager & manager = zypper.repoManager(); manager.removeRepository(repoinfo); - zypper.out().info(boost::str( - format(_("Repository '%s' has been removed.")) % repoinfo.asUserString())); + + std::string msg(boost::str(format(_("Repository '%s' has been removed.")) % repoinfo.asUserString())); + if ( isServiceRepo ) + msg += volatileTag(); // '[volatile]' + + zypper.out().info( msg ); MIL << format("Repository '%s' has been removed.") % repoinfo.alias() << endl; + + if ( isServiceRepo ) + zypper.out().warning( volatileServiceRepoChange( repoinfo ) ); } @@ -2167,8 +2191,7 @@ void modify_repo(Zypper & zypper, const string & alias) std::string volatileNote; // service repos changes may be volatile if ( ! repo.service().empty() ) { - // translators: used as 'XYZ changed to SOMETHING [volatile]' to tag specific property changes. - volatileNote = std::string( " [" + ColorString( ColorContext::MSG_WARNING, _("volatile") ).str() + "]" ); + volatileNote = volatileTag(); // '[volatile]' } bool didVolatileChanges = false; @@ -2234,10 +2257,7 @@ void modify_repo(Zypper & zypper, const string & alias) if ( didVolatileChanges ) { - zypper.out().warning(boost::str(format( - // translators: 'Volatile' refers to changes we previously tagged as 'XYZ changed to SOMETHING [volatile]' - _("Repo '%1%' is managed by service '%2%'. Volatile changes are reset by the next service refresh!") - ) % alias % repo.service() )); + zypper.out().warning( volatileServiceRepoChange( repo ) ); } } else diff --git a/src/solve-commit.cc b/src/solve-commit.cc index 5611510..4f42062 100755 --- a/src/solve-commit.cc +++ b/src/solve-commit.cc @@ -580,8 +580,7 @@ void solve_and_commit (Zypper & zypper) } // if running on SUSE Linux Enterprise, report unsupported packages - Product::constPtr platform = God->target()->baseProduct(); - if (platform && platform->name().find("SUSE_SLE") != string::npos) + if ( runningOnEnterprise() ) summary.setViewOption(Summary::SHOW_UNSUPPORTED); else summary.unsetViewOption(Summary::SHOW_UNSUPPORTED); diff --git a/src/utils/misc.cc b/src/utils/misc.cc index 84801ed..86131e1 100644 --- a/src/utils/misc.cc +++ b/src/utils/misc.cc @@ -17,6 +17,8 @@ #include #include +#include +#include #include #include #include @@ -31,6 +33,21 @@ using namespace std; using namespace zypp; +extern ZYpp::Ptr God; + +bool runningOnEnterprise() +{ + bool ret = false; + if ( Target_Ptr target = God->getTarget() ) + if ( Product::constPtr platform = target->baseProduct() ) + { + static const CpeId enterprise( "cpe:/o:suse:sle%02" ); + if ( compare( platform->cpeId(), enterprise, SetRelation::subset ) ) + ret = true; + } + return ret; +} + // ---------------------------------------------------------------------------- bool is_changeable_media(const zypp::Url & url) diff --git a/src/utils/misc.h b/src/utils/misc.h index faa8672..300b592 100644 --- a/src/utils/misc.h +++ b/src/utils/misc.h @@ -32,6 +32,11 @@ using namespace zypp; typedef std::set ResKindSet; +/** Whether running on SLE. + * If so, report e.g. unsupported packages per default. + */ +bool runningOnEnterprise(); + bool is_changeable_media(const zypp::Url & url); /** Converts user-supplied kind to zypp::ResKind object. diff --git a/zypper.spec.cmake b/zypper.spec.cmake index a543269..9e3cb49 100644 --- a/zypper.spec.cmake +++ b/zypper.spec.cmake @@ -22,7 +22,7 @@ BuildRequires: boost-devel >= 1.33.1 BuildRequires: cmake >= 2.4.6 BuildRequires: gcc-c++ >= 4.7 BuildRequires: gettext-devel >= 0.15 -BuildRequires: libzypp-devel >= 15.3.0 +BuildRequires: libzypp-devel >= 15.3.1 BuildRequires: readline-devel >= 5.1 Requires: procps %if 0%{?suse_version}