#
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
#=======
-------------------------------------------------------------------
+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
#
# A hackweek gift from Marek Stopka <mstopka@opensuse.org>
# Major rewrite by Josef Reidinger <jreidinger@suse.cz>
-# 2009/02/19 Allow empty spaces in repos names, Werner Fink <werner@suse.de>
+# 2009-02-19 Allow empty spaces in repos names, Werner Fink <werner@suse.de>
+# 2015-04-26 add completion for install+remove+update commands, Bernhard M. Wiedemann <bwiedemann@suse.de>
#
-# some TODOs:
-# - complete package names for install/remove/update
_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)
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[@]})
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
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<Package>(theone.resolvable());
cout << _("Support Level: ") << asUserString(pkg->vendorSupport()) << endl;
// ----------------------------------------------------------------------------
+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 <typename Target, typename Source>
void safe_lexical_cast (Source s, Target &tr) {
try {
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 ) );
}
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;
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
}
// 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);
#include <zypp/misc/CheckAccessDeleted.h>
#include <zypp/ExternalProgram.h>
+#include <zypp/ZYpp.h>
+#include <zypp/Target.h>
#include <zypp/PoolItem.h>
#include <zypp/Product.h>
#include <zypp/Pattern.h>
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)
typedef std::set<zypp::ResKind> 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.
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}