#
SET(VERSION_MAJOR "1")
SET(VERSION_MINOR "12")
-SET(VERSION_PATCH "24")
+SET(VERSION_PATCH "25")
-# LAST RELEASED: 1.12.24
+# LAST RELEASED: 1.12.25
#=======
.\" Title: zypper
.\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 10/26/2015
+.\" Date: 10/29/2015
.\" Manual: ZYPPER
.\" Source: SUSE Linux
.\" Language: English
.\"
-.TH "ZYPPER" "8" "10/26/2015" "SUSE Linux" "ZYPPER"
+.TH "ZYPPER" "8" "10/29/2015" "SUSE Linux" "ZYPPER"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
Probe given URI\&.
.RE
.PP
-\fB\-C\fR, \fB\-\-nocheck\fR
+\fB\-C\fR, \fB\-\-no\-check\fR
.RS 4
Don\(cqt probe URI, probe later during refresh\&.
.RE
.PP
-\fB\-n\fR, \fB\-\-name\fR
+\fB\-n\fR, \fB\-\-name\fR \fIname\fR
.RS 4
Specify descriptive name for the repository\&.
.RE
.PP
+\fB\-p\fR, \fB\-\-priority\fR \fIpositive\-integer\fR
+.RS 4
+Set the priority of the repository\&. Priority of
+\fB1\fR
+is the highest, the higher the number the lower the priority\&.
+\fB\-p 0\fR
+will set the priority back to the default (\fB99\fR)\&. Packages from repositories with higher priority will be preferred even in case there is a higher installable version available in the repository with a lower priority\&.
+.RE
+.PP
\fB\-k\fR, \fB\-\-keep\-packages\fR
.RS 4
Enable RPM files caching for the repository\&.
Disable RPM files caching\&.
.RE
.PP
+\fB\-g\fR, \fB\-\-gpgcheck\fR
+.RS 4
+Enable GPG check for this repository\&.
+.RE
+.PP
+\fB\-G\fR, \fB\-\-no\-gpgcheck\fR
+.RS 4
+Disable GPG check for this repository\&.
+.RE
+.PP
\fB\-f\fR, \fB\-\-refresh\fR
.RS 4
Enable autorefresh of the repository\&. The autorefresh is disabled by default when adding new repositories\&.
Disable auto\-refresh for the repository\&.
.RE
.PP
-\fB\-p\fR, \fB\-\-priority\fR \fIpositive\-integer\fR
+\fB\-n\fR, \fB\-\-name\fR
.RS 4
-Set priority of the repository\&. Priority of 1 is the highest, the higher the number the lower the priority\&. Default priority is 99\&. Packages from repositories with higher priority will be preferred even in case there is a higher installable version available in the repository with a lower priority\&.
+Set a descriptive name for the repository\&.
.RE
.PP
-\fB\-n\fR, \fB\-\-name\fR
+\fB\-p\fR, \fB\-\-priority\fR \fIpositive\-integer\fR
.RS 4
-Set a descriptive name for the repository\&.
+Set the priority of the repository\&. Priority of
+\fB1\fR
+is the highest, the higher the number the lower the priority\&.
+\fB\-p 0\fR
+will set the priority back to the default (\fB99\fR)\&. Packages from repositories with higher priority will be preferred even in case there is a higher installable version available in the repository with a lower priority\&.
.RE
.PP
\fB\-k\fR, \fB\-\-keep\-packages\fR
Disable RPM files caching\&.
.RE
.PP
+\fB\-g\fR, \fB\-\-gpgcheck\fR
+.RS 4
+Enable GPG check for this repository\&.
+.RE
+.PP
+\fB\-G\fR, \fB\-\-no\-gpgcheck\fR
+.RS 4
+Disable GPG check for this repository\&.
+.RE
+.PP
\fB\-a\fR, \fB\-\-all\fR
.RS 4
Apply changes to all repositories\&.
*-c*, *--check*::
Probe given URI.
- *-C*, *--nocheck*::
+ *-C*, *--no-check*::
Don't probe URI, probe later during refresh.
- *-n*, *--name*::
+ *-n*, *--name* 'name'::
Specify descriptive name for the repository.
+ *-p*, *--priority* 'positive-integer'::
+ Set the priority of the repository. Priority of *1* is the highest, the higher the number the lower the priority. *-p 0* will set the priority back to the default (*99*). Packages from repositories with higher priority will be preferred even in case there is a higher installable version available in the repository with a lower priority.
+
*-k*, *--keep-packages*::
Enable RPM files caching for the repository.
*-K*, *--no-keep-packages*::
Disable RPM files caching.
+ *-g*, *--gpgcheck*::
+ Enable GPG check for this repository.
+
+ *-G*, *--no-gpgcheck*::
+ Disable GPG check for this repository.
+
*-f*, *--refresh*::
Enable autorefresh of the repository. The autorefresh is disabled by default when adding new repositories.
*-R*, *--no-refresh*::
Disable auto-refresh for the repository.
- *-p*, *--priority* 'positive-integer'::
- Set priority of the repository. Priority of 1 is the highest, the higher the number the lower the priority. Default priority is 99. Packages from repositories with higher priority will be preferred even in case there is a higher installable version available in the repository with a lower priority.
-
*-n*, *--name*::
Set a descriptive name for the repository.
+ *-p*, *--priority* 'positive-integer'::
+ Set the priority of the repository. Priority of *1* is the highest, the higher the number the lower the priority. *-p 0* will set the priority back to the default (*99*). Packages from repositories with higher priority will be preferred even in case there is a higher installable version available in the repository with a lower priority.
+
*-k*, *--keep-packages*::
Enable RPM files caching.
*-K*, *--no-keep-packages*::
Disable RPM files caching.
+ *-g*, *--gpgcheck*::
+ Enable GPG check for this repository.
+
+ *-G*, *--no-gpgcheck*::
+ Disable GPG check for this repository.
+
*-a*, *--all*::
Apply changes to all repositories.
-------------------------------------------------------------------
+Fri Nov 6 11:03:59 CET 2015 - ma@suse.de
+
+- Fix #83 incomplete bash completion for --type
+- Fix typo (bsc#953214)
+- Fix miss aligned output when LANG=C (bsc#951707)
+- Provide --priority option on addrepo command.
+- add/modifyrepo: Support '--priority 0' to restore the default
+ repo priority.
+- Fixed Japanese translations (bsc#949196)
+- version 1.12.25
+
+-------------------------------------------------------------------
+Fri Nov 6 10:56:52 CET 2015 - ma@suse.de
+
+- Update sle-zypper-po.tar.bz2
+
+-------------------------------------------------------------------
+Thu Nov 5 01:15:23 CET 2015 - ma@suse.de
+
+- Update sle-zypper-po.tar.bz2
+
+-------------------------------------------------------------------
+Thu Nov 5 01:13:38 CET 2015 - ma@suse.de
+
+- Update zypper-po.tar.bz2
+
+-------------------------------------------------------------------
+Tue Nov 3 10:52:08 CET 2015 - ma@suse.de
+
+- Update sle-zypper-po.tar.bz2
+
+-------------------------------------------------------------------
+Tue Nov 3 10:51:52 CET 2015 - ma@suse.de
+
+- Update zypper-po.tar.bz2
+
+-------------------------------------------------------------------
Mon Oct 26 12:29:07 CET 2015 - ma@suse.de
- Add -x shorthand for --match-exact (fixes #64)
{"check", no_argument, 0, 'c'},
{"no-check", no_argument, 0, 'C'},
{"name", required_argument, 0, 'n'},
+ {"priority", required_argument, 0, 'p'},
{"keep-packages", no_argument, 0, 'k'},
{"no-keep-packages", no_argument, 0, 'K'},
{"gpgcheck", no_argument, 0, 'g'},
" or can be read from specified .repo file (even remote).\n"
"\n"
" Command options:\n"
- "-r, --repo <file.repo> Just another means to specify a .repo file to read.\n"
- "-t, --type <type> Type of repository (%s).\n"
- "-d, --disable Add the repository as disabled.\n"
- "-c, --check Probe URI.\n"
- "-C, --no-check Don't probe URI, probe later during refresh.\n"
- "-n, --name <name> Specify descriptive name for the repository.\n"
- "-k, --keep-packages Enable RPM files caching.\n"
- "-K, --no-keep-packages Disable RPM files caching.\n"
- "-g, --gpgcheck Enable GPG check for this repository.\n"
- "-G, --no-gpgcheck Disable GPG check for this repository.\n"
- "-f, --refresh Enable autorefresh of the repository.\n"
+ "-r, --repo <file.repo> Just another means to specify a .repo file to read.\n"
+ "-t, --type <type> Type of repository (%s).\n"
+ "-d, --disable Add the repository as disabled.\n"
+ "-c, --check Probe URI.\n"
+ "-C, --no-check Don't probe URI, probe later during refresh.\n"
+ "-n, --name <name> Specify descriptive name for the repository.\n"
+ "-p, --priority <integer> Set priority of the repository.\n"
+ "-k, --keep-packages Enable RPM files caching.\n"
+ "-K, --no-keep-packages Disable RPM files caching.\n"
+ "-g, --gpgcheck Enable GPG check for this repository.\n"
+ "-G, --no-gpgcheck Disable GPG check for this repository.\n"
+ "-f, --refresh Enable autorefresh of the repository.\n"
), "yast2, rpm-md, plaindir");
break;
}
.option( "-s, --short", // translators: -s, --short
_("Create a short table not showing the deleted files. Given twice, show only processes which are associated with a system service. Given three times, list the associated system service names only.") )
.option( "--print <format>", // translators: --print <format>
- _("For each associated system service print <format> on the standard output, followed by a newline. Any '%s' directive in <format> is replaced by the the system service name.") )
+ _("For each associated system service print <format> on the standard output, followed by a newline. Any '%s' directive in <format> is replaced by the system service name.") )
;
break;
}
case "$prev" in
"--type" | "-t")
- opts=(package patch pattern product)
+ opts=(package patch pattern product srcpackage application)
COMPREPLY=($(compgen -W "${opts[*]}" -- ${cur}))
_strip
eval $noglob
}
}
+unsigned parse_priority(Zypper & zypper)
+{
+ //! \todo use some preset priorities (high, medium, low, ...)
+ unsigned ret = 0U;
+ parsed_opts::const_iterator cArg = zypper.cOpts().find("priority");
+ if ( cArg == zypper.cOpts().end() )
+ return ret; // 0: no --priority arg
+
+ int prio = -1;
+ std::string prio_str = *cArg->second.begin();
+ safe_lexical_cast(prio_str, prio); // try to make an int out of the string
+
+ if ( prio < 0 )
+ {
+ zypper.out().error(boost::str(format(
+ _("Invalid priority '%s'. Use a positive integer number. The greater the number, the lower the priority."))
+ % prio_str));
+ zypper.setExitCode(ZYPPER_EXIT_ERR_INVALID_ARGS);
+ ZYPP_THROW(ExitRequestException("Invalid priority."));
+ }
+
+ ret = ( prio ? unsigned(prio) : RepoInfo::defaultPriority() );
+ return ret;
+}
+
// | Enabled | GPG Check | Colored strings for enabled and GPG Check status
// +---------+-----------+
// | Yes | ( ) No |
// translators: property name; short; used like "Name: value"
p.add( _("GPG Check"), repo.gpgCheck() ).paint( ColorContext::MSG_WARNING, repo.gpgCheck() == false );
// translators: property name; short; used like "Name: value"
+ p.add( _("Priority"), repo.priority() );
+ // translators: property name; short; used like "Name: value"
p.add( _("URI"), repo.baseUrlsBegin(), repo.baseUrlsEnd() );
s << p;
}
MIL << "going to add repository by url (alias=" << alias << ", url=" << url
<< ")" << endl;
+ unsigned prio = parse_priority(zypper);
+
RepoInfo repo;
if ( ! type.empty() )
repo.setName(it->second.front());
repo.addBaseUrl(url);
+ if (prio >= 1)
+ repo.setPriority(prio);
+
// enable the repo by default
if ( indeterminate(enabled) )
enabled = true;
return;
}
+ unsigned prio = parse_priority(zypper);
+
list<RepoInfo> repos;
// read the repo file
if ( !indeterminate(gpgCheck) )
repo.setGpgCheck(gpgCheck);
+ if (prio >= 1)
+ repo.setPriority(prio);
+
MIL << "to-be-added: enabled: " << repo.enabled() << " autorefresh: " << repo.autorefresh() << endl;
add_repo(zypper, repo);
zypper, "gpgcheck", "no-gpgcheck");
DBG << "gpgCheck = " << gpgCheck << endl;
+ unsigned prio = parse_priority(zypper);
+
try
{
RepoManager & manager = zypper.repoManager();
repo.setGpgCheck(gpgCheck);
}
- long long prio = 0;
- parsed_opts::const_iterator tmp1;
- if ((tmp1 = zypper.cOpts().find("priority")) != zypper.cOpts().end())
+ if (prio >= 1)
{
- //! \todo use some preset priorities (high, medium, low, ...)
-
- string prio_str = *tmp1->second.begin();
- safe_lexical_cast(prio_str, prio); // try to make an int out of the string
- if (prio < 1)
- {
- zypper.out().error(boost::str(format(
- _("Invalid priority '%s'. Use a positive integer number. The greater the number, the lower the priority."))
- % prio_str));
- zypper.setExitCode(ZYPPER_EXIT_ERR_INVALID_ARGS);
- return;
- }
-
- if (prio == (int) repo.priority())
+ if (prio == repo.priority())
zypper.out().info(boost::str(format(
_("Repository '%s' priority has been left unchanged (%d)"))
% alias % prio));
}
string name;
+ parsed_opts::const_iterator tmp1;
if ((tmp1 = zypper.cOpts().find("name")) != zypper.cOpts().end())
{
name = *tmp1->second.begin();
gData.show_media_progress_hack = false;
gData.entered_commit = false;
- USR << dump(result.transaction()) << endl;
if ( !result.allDone() && !( copts.count("dry-run") && result.noError() ) )
{ zypper.setExitCode( result.attemptToModify() ? ZYPPER_EXIT_ERR_COMMIT : ZYPPER_EXIT_ERR_ZYPP ); } // error message comes later....
namespace mbs
{
#define ZYPPER_TRACE_MBS 0
+
+ struct MbToWc
+ {
+ static const char _oooooooo = 0000;
+ static const char _Xooooooo = 0200;
+ static const char _XXoooooo = 0300;
+ static const char _XXXooooo = 0340;
+ static const char _XXXXoooo = 0360;
+ static const char _XXXXXooo = 0370;
+ static const char _ooXXXXXX = 0077;
+
+ MbToWc( char ch )
+ : _wc( ch )
+ , _cont( -1 )
+ {
+ if ( (_wc & _XXXooooo) == _XXoooooo ) // '110xxxxx'
+ { _wc &= ~_XXXooooo; _cont = 1; }
+ else if ( (_wc & _XXXXoooo) == _XXXooooo ) // '1110xxxx'
+ { _wc &= ~_XXXXoooo; _cont = 2; }
+ else if ( (_wc & _XXXXXooo) == _XXXXoooo ) // '11110xxx'
+ { _wc &= ~_XXXXXooo; _cont = 3; }
+ else if ( (_wc & _Xooooooo) == _oooooooo ) // '0xxxxxxx'
+ { _cont = 0; }
+ else // something broken
+ { _wc = L'?'; }
+ }
+
+ bool add( char ch ) // return whether ch is a continuation char
+ {
+ if ( (ch & _XXoooooo) == _Xooooooo ) // '10xxxxxx'
+ {
+ if ( _cont > 0 )
+ { _wc = (_wc<<6)+(ch & _ooXXXXXX); --_cont; }
+ return true;
+ }
+ if ( _cont > 0 ) // error, else ignore excess chars
+ { _wc = L'?'; _cont = -1; }
+ return false;
+ }
+
+ wchar_t _wc;
+ char _cont;
+ };
+
///////////////////////////////////////////////////////////////////
/// \class MbsIterator
/// \brief Iterate chars and ANSI SGR in a multi-byte character string
, _tpos( _text.data() )
, _trest( _text.size() )
, _tread( 0 )
+ , _cols( size_t(-1) )
, _wc( L'\0' )
{ memset( &_mbstate, 0, sizeof(_mbstate) ); operator++(); }
const char * pos() const { return _tpos; }
size_t size() const { return _tread; }
- size_t columns() const { size_t ret = ::wcwidth(_wc); if ( ret == size_t(-1) ) ret = 0; return ret; }
+ size_t columns() const
+ {
+ if ( _cols == size_t(-1) )
+ {
+ if ( _wc < L' ' )
+ _cols = 0; // CTRLs
+ else
+ {
+ _cols = ::wcwidth( _wc );
+ if ( _cols == size_t(-1) )
+ _cols = 1; // -1 due to LC_CTYPE?
+ }
+ }
+ return _cols;
+ }
boost::string_ref ref() const { return boost::string_ref( _tpos, _tread ); }
_tpos += _tread;
_trest -= _tread;
_tread = ::mbrtowc( &_wc, _tpos, _trest, &_mbstate );
+ _cols = size_t(-1);
+
+ if ( _tread >= (size_t)-2 )
+ {
+ // common case is -1 due to LC_CTYPE
+ // skip this and continue with next mb
+ memset( &_mbstate, 0, sizeof(_mbstate) );
+ _tread = 1;
+ MbToWc c( *_tpos );
+ while ( c.add( *(_tpos+_tread) ) )
+ _tread += 1;
+ _wc = c._wc;
+ }
switch ( _tread )
{
- case (size_t)-2:
- case (size_t)-1:
- _tread = 0;
- // fall through
+// case (size_t)-2:
+// case (size_t)-1:
+// _tread = 0;
+// // fall through
case 0:
_trest = 0; // atEnd
_wc = L'\0';
const char * _tpos; // start of last ::mbrtowc
size_t _trest; // _tpos to end of string
size_t _tread; // consumed in last ::mbrtowc
+ mutable size_t _cols; // number of columns occupied on screen
wchar_t _wc; // result of last ::mbrtowc
mbstate_t _mbstate;