Imported Upstream version 1.11.23 53/109353/1 upstream/1.11.23
authorDongHun Kwak <dh0128.kwak@samsung.com>
Tue, 10 Jan 2017 05:24:28 +0000 (14:24 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Tue, 10 Jan 2017 05:24:29 +0000 (14:24 +0900)
Change-Id: I688a2d0fbfb8e9db04a4e9972419b08d7a050699
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
47 files changed:
VERSION.cmake
doc/CMakeLists.txt
doc/zypp-refresh.8 [new file with mode: 0644]
doc/zypp-refresh.8.txt [new file with mode: 0644]
doc/zypper-log.8
doc/zypper-log.8.txt [new file with mode: 0644]
doc/zypper.8
doc/zypper.8.txt [new file with mode: 0644]
mkChangelog
package/zypper.changes
po/createPot
po/sle-zypper-po.tar.bz2
po/zypper-po.tar.bz2
src/CMakeLists.txt
src/Command.cc
src/Command.h
src/Config.cc
src/Config.h
src/SolverRequester.cc
src/Summary.cc
src/Summary.h
src/Table.cc
src/Table.h
src/Zypper.cc
src/callbacks/keyring.h
src/callbacks/media.h
src/callbacks/repo.h
src/callbacks/rpm.h
src/configtest.cc [new file with mode: 0644]
src/configtest.h [new file with mode: 0644]
src/download.cc
src/info.cc
src/locks.cc
src/main.h
src/output/OutNormal.cc
src/repos.cc
src/repos.h
src/search.cc
src/update.cc
src/utils/ansi.h [new file with mode: 0644]
src/utils/colors.cc
src/utils/colors.h
src/utils/misc.cc
src/utils/prompt.cc
src/utils/prompt.h
zypper.conf
zypper.spec.cmake

index bf0cdbe..0166ce7 100644 (file)
@@ -34,7 +34,7 @@
 #
 SET(VERSION_MAJOR "1")
 SET(VERSION_MINOR "11")
-SET(VERSION_PATCH "11")
+SET(VERSION_PATCH "23")
 
-# LAST RELEASED: 1.11.11
+# LAST RELEASED: 1.11.23
 #=======
index 0d9c733..893560f 100644 (file)
@@ -1,9 +1,40 @@
-INSTALL(
-  FILES zypper.8
-  DESTINATION ${MANDIR}/man8
-)
 
-INSTALL(
-  FILES zypper-log.8
-  DESTINATION ${MANDIR}/man8
+SET (my_MAN8
+     zypper.8 zypper-log.8 zypp-refresh.8)
+
+SET (my_MAN
+     ${my_MAN8})
+
+ADD_CUSTOM_TARGET( man ALL
+   DEPENDS ${my_MAN}
 )
+
+FOREACH (my_MANIDX 1 2 3 4 5 6 7 8)
+  INSTALL (FILES
+    ${my_MAN${my_MANIDX}}
+    DESTINATION ${MANDIR}/man${my_MANIDX}
+  )
+ENDFOREACH (my_MANIDX)
+
+#
+# If a2x is installed, auto update manpage from asciidoc manpage.txt:
+#
+FIND_PROGRAM(A2X a2x)
+FOREACH (my_MANTARGET ${my_MAN})
+  IF (A2X)
+    ADD_CUSTOM_COMMAND (
+      OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/${my_MANTARGET}
+      COMMAND ${A2X} -v -f manpage ${my_MANTARGET}.txt
+      DEPENDS ${my_MANTARGET}.txt
+      WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+    )
+  ELSE (A2X)
+    ADD_CUSTOM_COMMAND (
+      OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/${my_MANTARGET}
+      DEPENDS ${my_MANTARGET}.txt
+      WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+      COMMENT "Forgott to fix manpage after changing ascidoc?   Install a2x for automated creation or 'touch ${my_MANTARGET}'"
+    )
+  ENDIF (A2X)
+ENDFOREACH (my_MANTARGET)
+
diff --git a/doc/zypp-refresh.8 b/doc/zypp-refresh.8
new file mode 100644 (file)
index 0000000..7e7f278
--- /dev/null
@@ -0,0 +1,59 @@
+'\" t
+.\"     Title: zypp-refresh
+.\"    Author: [see the "AUTHORS" section]
+.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
+.\"      Date: 10/27/2014
+.\"    Manual: ZYPPER
+.\"    Source: zypp-refresh
+.\"  Language: English
+.\"
+.TH "ZYPP\-REFRESH" "8" "10/27/2014" "zypp\-refresh" "ZYPPER"
+.\" -----------------------------------------------------------------
+.\" * Define some portability stuff
+.\" -----------------------------------------------------------------
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.\" http://bugs.debian.org/507673
+.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.ie \n(.g .ds Aq \(aq
+.el       .ds Aq '
+.\" -----------------------------------------------------------------
+.\" * set default formatting
+.\" -----------------------------------------------------------------
+.\" disable hyphenation
+.nh
+.\" disable justification (adjust text to left margin only)
+.ad l
+.\" -----------------------------------------------------------------
+.\" * MAIN CONTENT STARTS HERE *
+.\" -----------------------------------------------------------------
+.SH "NAME"
+zypp-refresh \- Autorefresh metadata of all enabled repositories
+.SH "SYNOPSIS"
+.sp
+\fBzypp\-refresh\fR
+.SH "DESCRIPTION"
+.sp
+\fBzypp\-refresh\fR refreshes metadata of all enabled repositories which have \fBautorefresh\fR turned on (see \fBzypper lr\fR)\&. For use e\&.g\&. in cron jobs or scripts\&.
+.SH "FILES"
+.PP
+\fB/var/log/zypp\-refresh\&.log\fR
+.RS 4
+\fBzypp\-refresh\fR
+logfile
+.RE
+.SH "AUTHORS"
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+Jan Kupec <>
+Michael Andres <ma@suse\&.de>
+.fi
+.if n \{\
+.RE
+.\}
+.SH "SEE ALSO"
+.sp
+zypper(8)
diff --git a/doc/zypp-refresh.8.txt b/doc/zypp-refresh.8.txt
new file mode 100644 (file)
index 0000000..07e679d
--- /dev/null
@@ -0,0 +1,34 @@
+zypp-refresh(8)
+=============
+:man manual: ZYPPER
+:man source: zypp-refresh
+
+
+NAME
+----
+zypp-refresh - Autorefresh metadata of all enabled repositories
+
+
+SYNOPSIS
+--------
+*zypp-refresh*
+
+
+DESCRIPTION
+-----------
+*zypp-refresh* refreshes metadata of all enabled repositories which have *autorefresh* turned on (see *zypper lr*). For use e.g. in cron jobs or scripts.
+
+
+FILES
+-----
+*/var/log/zypp-refresh.log*::
+          *zypp-refresh* logfile
+
+AUTHORS
+-------
+       Jan Kupec <>
+       Michael Andres <ma@suse.de>
+
+SEE ALSO
+--------
+zypper(8)
index faf4202..a063724 100644 (file)
-.TH zypper-log 8 "15 June 2011"
-.SH NAME
+'\" t
+.\"     Title: zypper-log
+.\"    Author: [see the "AUTHORS" section]
+.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
+.\"      Date: 12/15/2014
+.\"    Manual: ZYPPER
+.\"    Source: zypper-log
+.\"  Language: English
+.\"
+.TH "ZYPPER\-LOG" "8" "12/15/2014" "zypper\-log" "ZYPPER"
+.\" -----------------------------------------------------------------
+.\" * Define some portability stuff
+.\" -----------------------------------------------------------------
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.\" http://bugs.debian.org/507673
+.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.ie \n(.g .ds Aq \(aq
+.el       .ds Aq '
+.\" -----------------------------------------------------------------
+.\" * set default formatting
+.\" -----------------------------------------------------------------
+.\" disable hyphenation
+.nh
+.\" disable justification (adjust text to left margin only)
+.ad l
+.\" -----------------------------------------------------------------
+.\" * MAIN CONTENT STARTS HERE *
+.\" -----------------------------------------------------------------
+.SH "NAME"
 zypper-log \- Zypper logfile reader
-.SH SYNOPSIS
-\fBzypper-log\fP [\fIoptions\fP] [\fIpid\fP]
-.SH DESCRIPTION
-zypper-log can read zypper's logfiles. It can also handle rotated logfiles, and will open plain, xz, gz and bz2-compressed files.
+.SH "SYNOPSIS"
 .sp
-By default zypper.log will be read in.
+\fBzypper\-log\fR [\fIOPTIONS\fR] [\fIPID\fR]
+.SH "DESCRIPTION"
 .sp
-When you provide a \fIpid\fP, you will get the complete log for the corresponding zypper run.
-.SH OPTIONS
+\fBzypper\-log\fR can read zyppers logfiles\&. It can also handle rotated logfiles, and will open plain, xz, gz and bz2\-compressed files\&.
+.sp
+By default \fB/var/log/zypper\&.log\fR will be read and a list of all \fBzypper\fR invocations is shown:
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+$ zypper\-log
+Reading /var/log/zypper\&.log \&.\&.\&.\&.\&.\&.\&.\&.\&.\&.\&.\&.\&.\&.\&. DONE
+
+TIME              PID    VER      CMD
+2013\-10\-15 11:01  2195   1\&.11\&.14  /usr/bin/zypper se spell
+2013\-10\-15 11:03  2703   1\&.11\&.14  /usr/bin/zypper in aspell\-en aspell\-ispell aspell\-de
+2013\-10\-15 15:00  22463  1\&.11\&.14  /usr/bin/zypper lr \-u
+2013\-10\-15 15:00  22479  1\&.11\&.14  /usr/bin/zypper lr \-s
+.fi
+.if n \{\
+.RE
+.\}
+.sp
+When you provide a pid, you will get the complete log for the corresponding zypper run\&.
+.SH "OPTIONS"
 .PP
-\-\-help
+\fB\-d\fR \fIYYYY\-MM\-DD\fR
 .RS 4
-Print help and quit
+Only view zypper runs of the specified day\&.
 .RE
 .PP
-\-l \fIFILE\fP
+\fB\-l\fR \fIFILE\fR
 .RS 4
-Only read this logfile
+Only read this logfile\&.
 .RE
 .PP
-\-r \fIN\fP
+\fB\-r\fR \fINUMBER\fR
 .RS 4
-Also read the \fIN\fP latest rotated logfiles.
+Also read the
+\fINUMBER\fR
+latest rotated logfiles\&.
 .RE
 .PP
-\-d \fIYYYY-MM-DD\fP
+\fB\-\-help\fR
 .RS 4
-Only view zypper runs of the specified day.
+Print help and quit\&.
 .RE
-.SH SEE ALSO
+.SH "FILES"
+.PP
+\fB/var/log/zypper\&.log\fR
+.RS 4
+\fBzypper\fR
+default logfile\&.
+.RE
+.PP
+\fB/var/log/YaST2/y2log\fR
+.RS 4
+As YAST uses a similar logfile format, you should be able to scan the YAST logfiles as well, using the
+\fB\-l\fR
+switch\&.
+.RE
+.SH "AUTHORS"
+.sp
+Dominik Heidler <dheidler@suse\&.de>
+.SH "SEE ALSO"
+.sp
 zypper(8)
-.SH AUTHOR
-Dominik Heidler <dheidler@suse.de>
diff --git a/doc/zypper-log.8.txt b/doc/zypper-log.8.txt
new file mode 100644 (file)
index 0000000..449f2a2
--- /dev/null
@@ -0,0 +1,64 @@
+zypper-log(8)
+=============
+:man manual: ZYPPER
+:man source: zypper-log
+
+
+NAME
+----
+zypper-log - Zypper logfile reader
+
+
+SYNOPSIS
+--------
+*zypper-log* ['OPTIONS'] ['PID']
+
+
+DESCRIPTION
+-----------
+*zypper-log* can read zyppers logfiles. It can also handle rotated logfiles, and will open plain, xz, gz and bz2-compressed files.
+
+By default */var/log/zypper.log* will be read and a list of all *zypper* invocations is shown:
+
+--------------------
+$ zypper-log
+Reading /var/log/zypper.log ............... DONE
+
+TIME              PID    VER      CMD
+2013-10-15 11:01  2195   1.11.14  /usr/bin/zypper se spell
+2013-10-15 11:03  2703   1.11.14  /usr/bin/zypper in aspell-en aspell-ispell aspell-de
+2013-10-15 15:00  22463  1.11.14  /usr/bin/zypper lr -u
+2013-10-15 15:00  22479  1.11.14  /usr/bin/zypper lr -s
+--------------------
+
+When you provide a pid, you will get the complete log for the corresponding zypper run.
+
+
+OPTIONS
+-------
+*-d* 'YYYY-MM-DD'::
+          Only view zypper runs of the specified day.
+*-l* 'FILE'::
+          Only read this logfile.
+*-r* 'NUMBER'::
+          Also read the 'NUMBER' latest rotated logfiles.
+*--help*::
+          Print help and quit.
+
+FILES
+-----
+*/var/log/zypper.log*::
+          *zypper* default logfile.
+
+*/var/log/YaST2/y2log*::
+         As YAST uses a similar logfile format, you should be able to scan the YAST logfiles as well, using the *-l* switch.
+
+
+AUTHORS
+-------
+Dominik Heidler <dheidler@suse.de>
+
+
+SEE ALSO
+--------
+zypper(8)
index f7c6860..d123da1 100644 (file)
-.TH "zypper" "8" "1.5.1" "zypper" "System Tools"
+'\" t
+.\"     Title: zypper
+.\"    Author: [see the "AUTHORS" section]
+.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
+.\"      Date: 03/11/2015
+.\"    Manual: ZYPPER
+.\"    Source: zypper
+.\"  Language: English
+.\"
+.TH "ZYPPER" "8" "03/11/2015" "zypper" "ZYPPER"
+.\" -----------------------------------------------------------------
+.\" * Define some portability stuff
+.\" -----------------------------------------------------------------
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.\" http://bugs.debian.org/507673
+.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.ie \n(.g .ds Aq \(aq
+.el       .ds Aq '
+.\" -----------------------------------------------------------------
+.\" * set default formatting
+.\" -----------------------------------------------------------------
+.\" disable hyphenation
+.nh
+.\" disable justification (adjust text to left margin only)
+.ad l
+.\" -----------------------------------------------------------------
+.\" * MAIN CONTENT STARTS HERE *
+.\" -----------------------------------------------------------------
 .SH "NAME"
-.LP
-zypper - Command\-line interface to ZYpp system management library (libzypp)
-
-.SH "SYNTAX"
-.LP
-zypper [\fI\-\-global\-opts\fR] <\fBcommand\fR> [\fI\-\-command\-opts\fR] [\fBcommand-arguments\fR]
-
-zypper \fBhelp\fR [\fBcommand\fR]
+zypper \- Command\-line interface to ZYpp system management library (libzypp)
+.SH "SYNOPSIS"
+.sp
+\fBzypper\fR [\fI\-\-global\-opts\fR] \fIcommand\fR [\fI\-\-command\-opts\fR] [\fIcommand\-arguments\fR]
+.sp
+\fBzypper\fR \fBhelp\fR \fIcommand\fR
 .SH "DESCRIPTION"
-.LP
-zypper is a command\-line interface to ZYpp system management library.
-It can be used to install, update, remove software, manage repositories, perform
-various queries, and more.
-
-.SH CONCEPTS
-
-Most of the following concepts are common for all applications based on the
-libzypp package management library, but there are some zypper specifics.
-
-.SS Repositories
-.LP
-Libzypp works with package metadata, that is information about packages and their
-relations extracted from RPM packages and other data like patch information,
-pattern definitions, etc. These data are stored together with the RPM files in
-folders called \fBrepositories\fR. Repositories can be placed on various media
-like an HTTP or FTP server, DVD, or a folder on a local disc.
-
-There is a special set of commands in zypper intented to manipulate repositories.
-Also many commands and options take a repository as an argument. See section
-\fBCOMMANDS\fR, subsection \fBRepository Management\fR for more details.
-
-.SS Resource Identfiers (URI)
-To specify locations of repositories or other resources (RPM files, .repo
-files) you can use any type of URIs supported by libzypp. See
-http://en.opensuse.org/openSUSE:Libzypp_URIs for a complete list and usage
-examples.
-
-Zypper also accepts special URIs identifying openSUSE Build Service (OBS)
-repositories in the \fBaddrepo\fR command. These URIs have the form of
-\fBobs://<project>/[platform]\fR, where \fIproject\fR is the name of the
-OBS project and \fIplatform\fR is the target platform (OS) for which the
-repository is intended. For example: obs://server:http/openSUSE_11.3.
-
-If \fIplatform\fR is omitted, zypper.conf's \fIobs.platform\fR value is used.
-See also other options in the [obs] section of zypper.conf.
-
-In addition to these URIs you can use plain directory and file paths in which
-case zypper automatically treats them as dir:/path URIs.
-
-.SS Refresh
-.LP
-Refreshing a repository means downloading metadata of packages from the medium
-(if needed), storing it in local cache (typically under
-/var/cache/zypp/raw/<alias> directory) and preparsing the metadata into .solv
-files (building the solv cache), typically under /var/cache/zypp/solv/<alias>.
-.LP
-The metadata get refreshed either automatically or on user request. An
-\fBautomatic refresh\fR takes place right before reading metadata from
-the database if the \fBauto-refresh is enabled\fR for the repository and the
-metada is reported to be out of date. If the \fBauto-refresh is disabled\fR,
-the repository will only be refreshed on user request. You can request
-a refresh by calling \fBzypper refresh\fR (see the documentation of the refresh
-command for details).
-.LP
-The repository metadata are checked for changes before actually doing the
-refresh. A change is detected by downloading one or two metadata index files
-(small files) and comparing the checksums of the cached ones and the remote
-ones. If the files differ, the repository is out of date and will be refreshed.
-.LP
-To delay the up-to-date check (and thus the automatic refresh) for a certain
-number of minutes, edit the value of the repo.refresh.delay attribute of ZYpp
-config file (/etc/zypp/zypp.conf). This means, zypper will not even try
-to download and check the index files, and you will be able to use zypper for
-operations like search or info without internet access or root privileges.
-
-.SS Services
-.LP
-Services are one level above repositories and serve to manage repositories
-or to do some special tasks. Libzypp currently supports only one type of
-services, the Repository Index Service (RIS).
-.LP
-Repository Index Service (RIS) is a special type of repository which contains
-a list of other repositories. This list can be generated dynamically by the
-server according to some URI parameters or user name, or can be static. Once
-such service is added to your system, zypper takes care of adding, modifying,
-or removing these repositories on your system to reflect the current list.
-See section Service Management and http://old-en.opensuse.org/Standards/Repository_Index_Service
-for more details.
-
-.SS Package Types
-.LP
-zypper works with several types of resource objects, called
-.BR resolvables.
-A resolvable is a package, patch, pattern, or a product.
-.LP
-.B package
-\- an ordinary RPM package.
-.br
-.B patch
-\- update of one or more packages. A patch can include special scripts and
-messages to be run or shown during installation of the update.
-.br
-.B pattern
-\- group of packages required or recommended to install some functionality.
-.br
-.B product
-\- group of packages which are necessary to install a product.
-.br
-.B srcpackage
-\- source code package (.src.rpm). This type works in \fBsearch\fR and \fBinstall\fR commands.
-.LP
-Throughout this manual we will refer to resolvables simply as \fIpackages\fR
-and to resolvable types as \fIpackage types\fR. These type names can be used
-as arguments of \fI--type\fR option in several commands like \fBinstall\fR,
-\fBinfo\fR, or \fBsearch\fR.
-
-.SS Package Dependencies
-.LP
-Software packages depend on each other in various ways. Packages usually
-require or recommend other packages, they can declare that they conflict
-with other packages, etc. Packages can also depend on specific hardware.
-See http://old-en.opensuse.org/Software_Management/Dependencies for more
-information. Zypper uses a \fIdependency solver\fR to find out what
-packages need to be installed to satisfy the user's request.
-
-.SS Package File Conflicts
-.LP
-File conflicts happen when two packages attempt to install files with the same name but different contents. This may happen if you are installing a newer version of a package without erasing the older version, of if two unrelated packages each install a file with the same name.
-.LP
-As checking for file conflicts requires access to the full filelist of each package being installed, zypper will check for file conflict only if all packages are downloaded in advance (see \fI--download-in-advance\fR).
-.LP
-As the reason for file conlicts usually is a poor package design or lack of coordination between the the people building the packages, they are not easy to resolve. By using the \fI--replacefiles\fR option you can force zypper to replace the conflicting files. Nevertheless this may damage the package whose file gets replaced.
-
+.sp
+zypper is a command\-line interface to ZYpp system management library (libzypp)\&. It can be used to install, update, remove software, manage repositories, perform various queries, and more\&.
+.SH "CONCEPTS"
+.sp
+Most of the following concepts are common for all applications based on the libzypp package management library, but there are some zypper specifics\&.
+.SS "Repositories"
+.sp
+Libzypp works with package metadata, that is information about packages and their relations extracted from RPM packages and other data like patch information, pattern definitions, etc\&. These data are stored together with the RPM files in folders called \fIrepositories\fR\&. Repositories can be placed on various media like an HTTP or FTP server, DVD, or a folder on a local disc\&.
+.sp
+There is a special set of commands in zypper intended to manipulate repositories\&. Also many commands and options take a repository as an argument\&. See section \fBCOMMANDS\fR, subsection \fBRepository Management\fR for more details\&.
+.SS "Resource Identifiers (URI)"
+.sp
+To specify locations of repositories or other resources (RPM files, \&.repo files) you can use any type of URIs supported by libzypp\&. See section \fBCOMMANDS\fR, subsection \fBRepository Management\fR for a complete list and usage examples\&.
+.sp
+Zypper also accepts special URIs identifying openSUSE Build Service (OBS) repositories in the \fBaddrepo\fR command\&. These URIs have the form of \fBobs://\fR\fIproject\fR\fB/\fR[\fIplatform\fR], where \fIproject\fR is the name of the OBS project and \fIplatform\fR is the target platform (OS) for which the repository is intended\&. If \fIplatform\fR is omitted, the \fBobs\&.platform\fR value from zypper\&.conf is used\&. See also other options in the [obs] section of zypper\&.conf\&.
+.sp
+For example: \fBobs://server:http/openSUSE_11\&.3\fR\&.
+.sp
+In addition to these URIs you can use plain directory and file paths in which case zypper automatically treats them as \fBdir:/\fR\fIpath\fR URI\&.
+.SS "Refresh"
+.sp
+Refreshing a repository means downloading metadata of packages from the medium (if needed), storing it in local cache (typically under \fB/var/cache/zypp/raw/\fR\fIalias\fR directory) and preparsing the metadata into \fI\&.solv\fR files (building the solv cache), typically under \fB/var/cache/zypp/solv/\fR\fIalias\fR\&.
+.sp
+The metadata get refreshed either automatically or on user request\&. An \fIautomatic refresh\fR takes place right before reading metadata from the database if the \fBauto\-refresh is enabled\fR for the repository and the metadata is reported to be out of date\&. If the \fIauto\-refresh is disabled\fR, the repository will only be refreshed on user request\&. You can request a refresh by calling \fBzypper refresh\fR (see the documentation of the \fBrefresh\fR command for details)\&.
+.sp
+The repository metadata are checked for changes before actually doing the refresh\&. A change is detected by downloading one or two metadata index files (small files) and comparing the checksums of the cached ones and the remote ones\&. If the files differ, the repository is out of date and will be refreshed\&.
+.sp
+To delay the up\-to\-date check (and thus the automatic refresh) for a certain number of minutes, edit the value of the \fBrepo\&.refresh\&.delay\fR attribute of ZYpp config file (\fB/etc/zypp/zypp\&.conf\fR)\&. This means, zypper will not even try to download and check the index files, and you will be able to use zypper for operations like search or info without internet access or root privileges\&.
+.SS "Services"
+.sp
+Services are one level above repositories and serve to manage repositories or to do some special tasks\&. Libzypp currently supports \fIRepository Index Service\fR (RIS) and \fIPlugin Service\fR\&.
+.sp
+Repository Index Service (RIS) is a special type of repository which contains a list of other repositories\&. This list can be generated dynamically by the server according to some URI parameters or user name, or can be static\&. Once such service is added to your system, zypper takes care of adding, modifying, or removing these repositories on your system to reflect the current list\&. See section \fBService Management\fR and http://old\-en\&.opensuse\&.org/Standards/Repository_Index_Service for more details\&.
+.SS "Package Types"
+.sp
+Zypper works with several types of resource objects, called \fIresolvables\fR\&. A resolvable might be a \fBpackage\fR, \fBpatch\fR, \fBpattern\fR, \fBproduct\fR; basically any \fIkind of object\fR with dependencies to other objects\&.
+.PP
+\fBpackage\fR
+.RS 4
+An ordinary RPM package\&.
+.RE
+.PP
+\fBpatch\fR
+.RS 4
+A released patch conflicts with the affected/vulnerable versions of a collection of packages\&. As long as any of these affected/vulnerable versions are installed, the conflict triggers and the patch is classified as
+\fBneeded\fR\&. Selecting the patch, the conflict is resolved by updating all installed and affected/vulnerable packages to a version providing the fix\&. When updating the packages zypper always aims for the latest available version\&.
+.RE
+.PP
+\fBpattern\fR
+.RS 4
+A group of packages required or recommended to install some functionality\&.
+.RE
+.PP
+\fBproduct\fR
+.RS 4
+A group of packages which are necessary to install a product\&.
+.RE
+.PP
+\fBsrcpackage\fR
+.RS 4
+Source code package (\&.src\&.rpm)\&. This type works in
+\fBsearch\fR
+and
+\fBinstall\fR
+commands\&.
+.RE
+.PP
+\fBapplication\fR
+.RS 4
+Focuses on packages a user might want to install and hide away supporting packages which are selected via package dependencies anyway (see
+\fIhttp://people\&.freedesktop\&.org/~hughsient/appdata/\fR)
+.RE
+.sp
+Throughout this manual we will often refer to resolvables simply as \fIpackages\fR and to resolvable types as \fIpackage type\fR or \fIkind\fR\&. These type names can be used as arguments of \fB\-\-type\fR option in several commands like \fBinstall\fR, \fBinfo\fR, or \fBsearch\fR\&. Commands should also allow to specify resolvables as \fIKIND\fR\fB:\fR\fINAME\fR (e\&.g\&. \fBpatch:openSUSE\-2014\-7\fR)\&.
+.SS "Package Dependencies"
+.sp
+Software packages depend on each other in various ways\&. Packages usually \fIrequire\fR or \fIrecommend\fR other packages, but they can also \fIconflict\fR with other packages\&. Packages can also support specific hardware or language settings\&. Zypper uses a \fIdependency solver\fR to find out what packages need to be installed to satisfy the user\(cqs request\&. See http://old\-en\&.opensuse\&.org/Software_Management/Dependencies for more information\&.
+.SS "Package File Conflicts"
+.sp
+File conflicts happen when two packages attempt to install files with the same name but different contents\&. This may happen if you are installing a newer version of a package without erasing the older version, of if two unrelated packages each install a file with the same name\&.
+.sp
+As checking for file conflicts requires access to the full filelist of each package being installed, zypper will check for file conflict only if all packages are downloaded in advance (see \fB\-\-download\-in\-advance\fR)\&.
+.sp
+As the reason for file conflicts usually is a poor package design or lack of coordination between the the people building the packages, they are not easy to resolve\&. By using the \fB\-\-replacefiles\fR option you can force zypper to replace the conflicting files\&. Nevertheless this may damage the package whose file gets replaced\&.
 .SH "COMMANDS"
-.LP
-zypper provides a number of \fBcommands\fR. Each command accepts the options
-listed in the GLOBAL OPTIONS section. These options must be specified
-\fIbefore\fR the command name. In addition, many commands have specific
-options, which are listed in this section. These command-specific options must
-be specified \fIafter\fR the name of the command and \fIbefore\fR any
-of the command arguments.
-
-.SS General Commands
-
-.TP
-.B help [command]
-Shows help texts. If invoked without any argument (just \'zypper\' or
-\'zypper\ help\'), zypper displays global help text which lists all available
-global options and commands.
-
-If invoked with a command name argument, zypper displays help for the
-specified command, if such command exists. Long as well as short variants
-of the command names can be used.
-
-For your convenience, zypper help can be invoked in any of the following ways:
+.sp
+zypper provides a number of \fIcommands\fR\&. Each command accepts the options listed in the \fBGLOBAL OPTIONS\fR section\&. These options must be specified \fIbefore\fR the command name\&. In addition, many commands have specific options, which are listed in this section\&. These command\-specific options must be specified \fIafter\fR the name of the command and \fIbefore\fR any of the command arguments\&.
+.SS "General Commands"
+.PP
+\fBhelp\fR [\fIcommand\fR]
+.RS 4
+Shows help texts\&. If invoked without any argument (just
+\fBzypper\fR
+or
+\fBzypper help\fR), zypper displays global help text which lists all available global options and commands\&.
+
+If invoked with a
+\fIcommand\fR
+name argument, zypper displays help for the specified command, if such command exists\&. Long as well as short variants of the command names can be used\&.
+
+For your convenience,
+\fBzypper help\fR
+can also be invoked in any of the following ways:
+.TS
+tab(:);
+lt lt
+lt lt.
+T{
+
+T}:T{
+$
+\fBzypper \-h\fR|\fB\-\-help\fR
+[\fIcommand\fR]
+T}
+T{
+
+T}:T{
+$
+\fBzypper\fR
+[\fIcommand\fR]
+\fB\-h\fR|\fB\-\-help\fR
+T}
+.TE
+.sp 1
+.RE
+.PP
+\fBshell\fR (\fBsh\fR)
+.RS 4
+Starts a shell for entering multiple commands in one session\&. Exit the shell using
+\fBexit\fR,
+\fBquit\fR, or
+\fICtrl\-D\fR\&.
+
+The shell support is not complete so expect bugs there\&. However, there\(cqs no urgent need to use the shell since libzypp became so fast thanks to the SAT solver and its tools (openSUSE 11\&.0), but still, you\(cqre welcome to experiment with it\&.
+.RE
+.SS "Package Management Commands"
+.PP
+\fBinfo\fR (\fBif\fR) [\fIoptions\fR] \fIname\fR\&...
+.RS 4
+Displays detailed information about the specified packages\&.
 
-.B $ zypper help [command]
-.br
-.B $ zypper -h|--help [command]
-.br
-.B $ zypper [command] -h|--help
-
-.TP
-.B shell (sh)
-Starts a shell for entering multiple commands in one session.
-Exit the shell using "exit", "quit", or Ctrl-D.
-
-The shell support is not complete
-so expect bugs there. However, there's no urgent need to use the shell
-since libzypp became so fast thanks to the SAT solver and its tools
-(openSUSE 11.0), but still, you're welcome to experiment with it.
-
-
-.SS Package Management Commands
-
-.TP
-.B info (if) [options] <name> ...
-Displays detailed information about the specified packages.
-
-For each specified package, zypper finds the best available version in defined
-repositories and shows information for this package.
-
-.TP
-\fI\-r, \-\-repo\fR <alias|name|#|URI>
-Work only with the repository specified by the alias, name, number or URI. This
-option can be used multiple times.
-.TP
-.I \-t, \-\-type <type>
-Type of package (default: package). See section \fBPackage Types\fR for list
-of available package types.
-.TP
-.I \ \ \ \ \-\-provides
-Show symbols the package provides.
-.TP
-.I \ \ \ \ \-\-requires
-Show symbols the package requires.
-.TP
-.I \ \ \ \ \-\-conflicts
-Show symbols the package conflits with.
-.TP
-.I \ \ \ \ \-\-obsoletes
-Show symbols the package obsoletes.
-.TP
-.I \ \ \ \ \-\-recommends
-Show symbols the package recommends.
-.TP
-.I \ \ \ \ \-\-suggests
-Show symbols the package suggests.
-.TP
+For each specified package, zypper finds the best available version in defined repositories and shows information for this package\&.
+.PP
+\fB\-r\fR, \fB\-\-repo\fR \fIalias\fR|\fIname\fR|\fI#\fR|\fIURI\fR
+.RS 4
+Work only with the repository specified by the alias, name, number or URI\&. This option can be used multiple times\&.
+.RE
+.PP
+\fB\-t\fR, \fB\-\-type\fR \fItype\fR
+.RS 4
+Type of package (default: package)\&. See section
+\fBPackage Types\fR
+for list of available package types\&.
+.RE
+.PP
+\fB\-\-provides\fR
+.RS 4
+Show symbols the package provides\&.
+.RE
+.PP
+\fB\-\-requires\fR
+.RS 4
+Show symbols the package requires\&.
+.RE
+.PP
+\fB\-\-conflicts\fR
+.RS 4
+Show symbols the package conflicts with\&.
+.RE
+.PP
+\fB\-\-obsoletes\fR
+.RS 4
+Show symbols the package obsoletes\&.
+.RE
+.PP
+\fB\-\-recommends\fR
+.RS 4
+Show symbols the package recommends\&.
+.RE
+.PP
+\fB\-\-suggests\fR
+.RS 4
+Show symbols the package suggests\&.
+.RE
+.PP
 Examples:
+.RS 4
+.PP
+$ \fBzypper info workrave\fR
+.RS 4
+Show information about
+\fIpackage workrave\fR
+.RE
+.PP
+$ \fBzypper info \-t patch libzypp\fR
+.RS 4
+Show information about
+\fIpatch libzypp\fR
+.RE
+.PP
+$ \fBzypper info \-t pattern lamp_server\fR
+.RS 4
+Show information about
+\fIpattern lamp_server\fR
+.RE
+.RE
+.RE
+.PP
+\fBinstall\fR (\fBin\fR) [\fIoptions\fR] \fIname\fR|\fIcapability\fR|\fIrpm_file_uri\fR\&...
+.RS 4
+Install or update packages\&.
+.PP
+The packages can be selected by their \fIname\fR or by a \fIcapability\fR they provide\&.
+.RS 4
+
+A
+\fIcapability\fR
+is formed by "\fINAME\fR[\fB\&.\fR\fIARCH\fR][
+\fIOP EDITION\fR]", where
+\fIARCH\fR
+is an architecture code,
+\fIOP\fR
+is one of
+\fB<\fR,
+\fB<=\fR,
+\fB=\fR,
+\fB>=\fR, or
+\fB>\fR
+and
+\fIEDITION\fR
+is "\fIVERSION\fR[\fB\-\fR\fIRELEASE\fR]"\&. For example:
+\fBzypper=0\&.8\&.8\-2\fR
+The
+\fINAME\fR
+component of a capability is not only a package name but any symbol provided by packages:
+\fB/bin/vi\fR,
+\fBlibcurl\&.so\&.3\fR,
+\fBperl(Time::ParseDate)\fR\&. Just remember to quote to protect the special characters from the shell, for example:
+\fBzypper\e>0\&.8\&.10\fR
+or
+\fB\*(Aqzypper>0\&.8\&.10\*(Aq\fR\&.
+
+If
+\fIEDITION\fR
+is not specified, the newest installable version will be installed\&. This also means that if the package is already installed and newer versions are available, it will get upgraded to the newest installable version\&.
+
+If
+\fIARCH\fR
+is not specified, or the last dot of the capability name string is not followed by known architecture, the solver will treat the whole string as a capability name\&. If the ARCH is known, the solver will select a package matching that architecture and complain if such package cannot be found\&.
+.RE
+.PP
+Zypper is also able to install \fIplain RPM files\fR while trying to satisfy their dependencies using packages from defined repositories\&. You can install a plain RPM file by specifying its location in the install command arguments either as a local path or an URI\&. E\&.g\&.:
+.RS 4
 
-Show information about package 'workrave':
-.br
-.B $ zypper info workrave
-
-Show information about patch 'libzypp':
-.br
-.B $ zypper info -t patch libzypp
-
-Show information about pattern 'lamp_server':
-.br
-.B $ zypper info -t pattern lamp_server
-
-.TP
-.B install (in) [options] <name|capability|rpm_file_uri> ...
-Install or update packages.
-
-The packages can be selected by their name or by a capability they provide.
-
-Capability is: NAME, or "NAME[.ARCH][OP<EDITION>]", where ARCH is architecture
-code, OP is <, <=, =, >=, or > and EDITION is VERSION[-RELEASE].
-For example: zypper=0.8.8-2.
-
-The NAME component of a capability is not only a package name but any symbol
-provided by packages: /bin/vi, libcurl.so.3, perl(Time::ParseDate).
-Just remember to quote to protect the special characters from the shell,
-for example: zypper\\>0.8.10 or 'zypper>0.8.10'
-
-If EDITION is not specified, the newest installable version will be installed.
-This also means that if the package is already installed and newer versions
-are available, it will get upgraded to the newest installable version.
-
-If ARCH is not specified, or the last dot of the capability name string is not
-followed by known architecture, the solver will treat the whole string
-as a capability name. If the ARCH is known, the solver will select a package
-matching that architecture and complain if such package cannot be found.
+$
+\fBzypper install ~/rpms/foo\&.rpm \fR\fBhttp://some\&.site/bar\&.rpm\fR\&.
 
-Zypper will report packages that it cannot find. Further, in interactive
-mode, zypper proceeds with installation of the rest of requested packages,
-and it will abort immediately in non-interactive mode. In both cases
-zypper returns ZYPPER_EXIT_INF_CAP_NOT_FOUND after finishing
-the operation.
+Zypper will report packages that it cannot find\&. Further, in interactive mode, zypper proceeds with installation of the rest of requested packages, and it will abort immediately in non\-interactive mode\&. In both cases zypper returns
+\fBZYPPER_EXIT_INF_CAP_NOT_FOUND\fR
+after finishing the operation\&.
 
-Zypper is also able to install plain RPM files while trying to satisfy their
-dependencies using packages from defined repositories. You can install a plain
-RPM file by specifying its location in the install command arguments either
-as a local path or an URI. E.g.:
+Zypper will download the files into its cache directory (/var/cache/zypper/RPMS), add this directory as a temporary
+\fBplaindir\fR
+repository and mark the respective packages for installation\&.
+.RE
+.PP
+In the install command, you can specify also packages you wish to remove in addition to the packages you wish to install, by prepending their names by a \fI\-\fR or \fI~\fR character\&. For example:
+.RS 4
+
+$
+\fI\fBzypper install vim \-emacs\fR\fR\ \&
+
+$
+\fBzypper remove emacs +vim\fR\ \&
+
+will both
+\fIinstall vim\fR
+and
+\fIremove emacs\fR\&. Note that if you choose to use
+\fB\-\fR
+with the first package you specify, you need to write
+\fB\-\-\fR
+before it to prevent its interpretation as a command option:
+
+$
+\fBzypper install \(em \-boring\-game great\-game great\-game\-manual\fR\ \&
+.RE
+.PP
+\-r, \-\-repo alias|name|#|URI
+.RS 4
+Work only with the repository specified by the alias, name, number or URI\&. This option can be used multiple times\&.
+
+Using \-\-repo is
+\fIdiscouraged\fR
+as it currently hides unmentioned repositories from the resolver, leading to inexpertly decisions\&. In the future \-\-repo will become an alias for
+\fB\-\-from\fR\&.
+.RE
+.PP
+\fB\-t\fR, \fB\-\-type\fR \fItype\fR
+.RS 4
+Type of package to install (default: package)\&. See section
+\fBPackage Types\fR
+for list of available package types\&. Use
+\fI\fBzypper se \-t\fR\fR\fI type\fR
+[\fIname\fR] to look for available items of this type and
+\fI\fBzypper info \-t\fR\fR\fI type name\fR
+to display more detailed information about the item\&.
+
+If
+\fIpatch\fR
+is specified, zypper will install and/or remove packages to satisfy specified patch\&. This is a way to ensure that specific bug fix is installed\&. Use
+\fBzypper list\-patches\fR
+to look for available
+\fIneeded\fR
+patches\&.
+
+If
+\fIproduct\fR
+or
+\fIpattern\fR
+are specified, zypper ensures that all required (and optionally recommended) packages are installed\&.
+.RE
+.PP
+\fB\-n\fR, \fB\-\-name\fR
+.RS 4
+Select packages by their name, don\(cqt try to select by capabilities\&.
+.RE
+.PP
+\fB\-f\fR, \fB\-\-force\fR
+.RS 4
+Install even if the item is already installed (reinstall), downgraded or changes vendor or architecture\&.
+.RE
+.PP
+\fB\-\-oldpackage\fR
+.RS 4
+Allow to replace a newer item with an older one\&. Handy if you are doing a rollback\&. Unlike \-\-force it will not enforce a reinstall, if the item is already installed with the requested version\&.
+.RE
+.PP
+\fB\-\-from\fR \fIalias|name|#|URI\fR
+.RS 4
+Select packages from specified repository\&. If strings specified as arguments to the install command match packages in repositories specified in this option, they will be marked for installation\&. This option currently implies
+\fB\-\-name\fR, but allows using wildcards for specifying packages\&.
+.RE
+.PP
+\fB\-C\fR, \fB\-\-capability\fR
+.RS 4
+Select packages by capabilities\&.
+.RE
+.PP
+\fB\-l\fR, \fB\-\-auto\-agree\-with\-licenses\fR
+.RS 4
+Automatically say
+\fIyes\fR
+to third party license confirmation prompt\&. By using this option, you choose to agree with licenses of all third\-party software this command will install\&. This option is particularly useful for administrators installing the same set of packages on multiple machines (by an automated process) and have the licenses confirmed before\&.
+.RE
+.PP
+\fB\-\-debug\-solver\fR
+.RS 4
+Create solver test case for debugging\&. Use this option, if you think the dependencies were not solved all right and attach the resulting /var/log/zypper\&.solverTestCase directory to your bug report\&. To use this option, simply add it to the problematic install or remove command\&.
+.RE
+.PP
+\fB\-\-no\-recommends\fR
+.RS 4
+By default, zypper installs also packages recommended by the requested ones\&. This option causes the recomended packages to be ignored and only the required ones to be installed\&.
+.RE
+.PP
+\fB\-\-replacefiles\fR
+.RS 4
+Install the packages even if they replace files from other, already installed, packages\&. Default is to treat file conflicts as an error\&.
+\fB\-\-download\-as\-needed\fR
+disables the file conflict check because access to all packages file lists is needed in advance in order to perform the check\&.
+.RE
+.PP
+\fB\-R\fR, \fB\-\-no\-force\-resolution\fR
+.RS 4
+Do not force the solver to find a solution\&. Instead, report dependency problem and prompt the user to resolve it manually\&.
+.RE
+.PP
+\fB\-\-force\-resolution\fR
+.RS 4
+Force the solver to find a solution, even if it would mean removing all packages with unfulfilled requirements\&. The default behavior is
+\fIforce in the interactive mode\fR
+and
+\fIno\-force in the non\-interactive mode\fR\&. If this option is specified, it takes the preference\&.
+.RE
+.PP
+\fB\-D\fR, \fB\-\-dry\-run\fR
+.RS 4
+Test the installation, do not actually install any package\&. This option will add the
+\fB\-\-test\fR
+option to the rpm commands run by the install command\&.
+.RE
+.PP
+\fB\-\-details\fR
+.RS 4
+Show the detailed installation summary\&.
+.RE
+.PP
+Download\-and\-install mode options:
+.RS 4
+.RE
+.PP
+\fB\-d\fR, \fB\-\-download\-only\fR
+.RS 4
+Only download the packages for later installation\&.
+.RE
+.PP
+\fB\-\-download\-in\-advance\fR
+.RS 4
+First download all packages, then start installing\&.
+.RE
+.PP
+\fB\-\-download\-in\-heaps\fR
+.RS 4
+Download a minimal set of packages that can be installed without leaving the system in broken state, and install them\&. Then download and install another heap until all are installed\&. This helps to keep the system in consistent state without the need to download
+\fIall\fR
+packages in advance, which combines the advantages of
+\fB\-\-download\-in\-advance\fR
+and
+\fB\-\-download\-as\-needed\fR\&. This is the default mode\&.
+
+NOTE: While the resolver is not capable of building heaps, this behaves the same as
+\fB\-\-download\-in\-advance\fR\&.
+.RE
+.PP
+\fB\-\-download\-as\-needed\fR
+.RS 4
+Download one package, install it immediately, and continue with the rest until all are installed\&.
+.RE
+.PP
+\fB\-\-download\fR \fImode\fR
+.RS 4
+Use the specified download\-and\-install mode\&. Available modes are:
+\fBonly\fR,
+\fBin\-advance\fR,
+\fBin\-heaps\fR,
+\fBas\-needed\fR\&. See corresponding
+\fB\-\-download\-\fR\fImode\fR
+options for their description\&.
+.RE
+.PP
+Examples:
+.RS 4
+.PP
+$ \fBzypper install \-t pattern lamp_server\fR
+.RS 4
+Install lamp_server pattern\&.
+.RE
+.PP
+$ \fBzypper install \-\-no\-recommends gv\fR
+.RS 4
+Install GhostScript viewer, but ignore recommended packages\&.
+.RE
+.PP
+$ \fBzypper install virtualbox\-ose\-2\&.0\&.6\fR
+.RS 4
+.RE
+.PP
+$ \fBzypper install virtualbox\-ose=2\&.0\&.6\fR
+.RS 4
+.RE
+.PP
+$ \fBzypper install virtualbox\-ose = 2\&.0\&.6\fR
+.RS 4
+Install version 2\&.0\&.6 of virtualbox\-ose package\&.
+.RE
+.RE
+.RE
+.PP
+\fBsource\-install\fR (\fBsi\fR) \fIname\fR\&...
+.RS 4
+Install specified source packages and their build dependencies\&. If the name of a binary package is given, the corresponding source package is looked up and installed instead\&.
 
-\fB$ zypper install ~/rpms/foo.rpm http://some.site/bar.rpm\fR
+This command will try to find the newest available versions of the source packages and uses
+\fBrpm \-i\fR
+to install them and the packages that are required to build the source package\&.
 
-Zypper will download the files into its cache directory (/var/cache/zypper/RPMS),
-add this directory as a temporary \fBplaindir\fR repository and mark the
-respective packages for installation.
+Note that the source packages must be available in repositories you are using\&. You can check whether a repository contains any source packages using the following command:
+.PP
+.RS 4
+$
+\fI\fBzypper search \-t srcpackage \-r\fR\fR\fI alias\fR|\fIname\fR|\fI#\fR|\fIURI\fR
+.RE
+.PP
+\fB\-d\fR, \fB\-\-build\-deps\-only\fR
+.RS 4
+Install only build dependencies of specified packages\&.
+.RE
+.PP
+\fB\-D\fR, \fB\-\-no\-build\-deps\fR
+.RS 4
+Don\(cqt install build dependencies\&.
+.RE
+.PP
+\fB\-r\fR, \fB\-\-repo\fR \fIalias\fR|\fIname\fR|\fI#\fR|\fIURI\fR
+.RS 4
+Work only with the repository specified by the alias, name, number, or URI\&. This option can be used multiple times\&.
+.RE
+.PP
+\fB\-\-download\-only\fR
+.RS 4
+Only download the packages, do not install\&.
+.RE
+.PP
+Examples:
+.RS 4
+.PP
+$ \fBzypper si \-d dbus\-1\fR
+.RS 4
+Install build dependencies of dbus\-1 source package\&.
+.RE
+.RE
+.RE
+.PP
+\fBverify\fR (\fBve\fR) [\fIoptions\fR]
+.RS 4
+Check whether dependencies of installed packages are satisfied\&.
 
-In the install command, you can specify also packages you wish to remove in
-addition to the packages you wish to install, by prepending their names by
-a '-' or '~' character. For example:
+In case that any dependency problems are found, zypper suggests packages to install or remove to fix them\&.
+.PP
+\fB\-\-no\-recommends\fR
+.RS 4
+By default, zypper installs also packages recommended by the requested ones (the ones needed to fix broken dependencies in this case)\&. This option causes the recommended packages to be ignored and only the required ones to be installed\&.
+.RE
+.PP
+\fB\-D\fR, \fB\-\-dry\-run\fR
+.RS 4
+Test the repair, do not actually do anything to the system\&.
+.RE
+.PP
+\fB\-\-details\fR
+.RS 4
+Show the detailed installation summary\&.
+.RE
+.PP
+\fB\-r\fR, \fB\-\-repo\fR \fIalias\fR|\fIname\fR|\fI#\fR|\fIURI\fR
+.RS 4
+Work only with the repository specified by the alias, name, number, or URI\&. This option can be used multiple times\&.
+.RE
+.PP
+\fB\-\-debug\-solver\fR
+.RS 4
+Create solver test case for debugging\&. See the install command for details\&.
+.RE
+.RE
+.PP
+\fBinstall\-new\-recommends\fR (\fBinr\fR) [\fIoptions\fR]
+.RS 4
+Install newly added packages recommended by already installed ones\&. This can typically be used to install language packages recently added to repositories or drivers for newly added hardware\&.
+.PP
+\fB\-r\fR, \fB\-\-repo\fR \fIalias\fR|\fIname\fR|\fI#\fR|\fIURI\fR
+.RS 4
+Work only with the repository specified by the alias, name, number, or URI\&. This option can be used multiple times\&.
+.RE
+.PP
+\fB\-D\fR, \fB\-\-dry\-run\fR
+.RS 4
+Test the installation, do not actually install anything\&.
+.RE
+.PP
+\fB\-\-details\fR
+.RS 4
+Show the detailed installation summary\&.
+.RE
+.PP
+\fB\-\-debug\-solver\fR
+.RS 4
+Create solver test case for debugging\&. See the install command for details\&.
+.RE
+.PP
+This command also accepts the \fBDownload\-and\-install mode options\fR described in the \fBinstall\fR command\&.
+.RS 4
+.RE
+.RE
+.PP
+\fBremove\fR (\fBrm\fR) [\fIoptions\fR] \fIname\fR\&...
+.RS 4
+.RE
+.PP
+\fBremove\fR (\fBrm\fR) [\fIoptions\fR] \fB\-\-capability\fR \fIcapability\fR\&...
+.RS 4
+Remove (uninstall) packages\&.
 
-.B $ zypper install vim -emacs
-.br
-.B $ zypper remove emacs +vim
-
-will both install vim and remove emacs. Note that if you choose to use '-' with the
-first package you specify, you need to write '--' before it to prevent its
-interpretation as a command option.
-
-.B $ zypper install -- -boring-game great-game great-game-manual
-.TP
-\fI\-r, \-\-repo\fR <alias|name|#|URI>
-Work only with the repository specified by the alias, name, number or URI. This
-option can be used multiple times.
-.TP
-\fI\-t, \-\-type\fR <type>
-Type of package to install (default: package). See section \fBPackage Types\fR
-for list of available package types.
-
-If \fIpattern\fR is specified, and the pattern is not yet installed,
-all packages required and recommended by the pattern will be installed.
-A pattern is considered installed if all the packages and patterns
-it requires are installed. Thus a pattern can be evalueated as installed
-even if you do not install the pattern itself, but rather the packages
-it requries. Use \fBzypper search -t pattern [name]\fR to look for available
-patterns and \fBzypper info -t pattern <name>\fR to list its contents.
-
-If \fIpatch\fR is specified, zypper will install and/or remove packages
-to satisfy specified patch. This is a way to ensure that specific
-bug fix is installed. Like patterns, patches can also be evaluated as installed
-by installing the packages needed to satisfy the patch.
-Use \fBzypper list-patches\fR to look for available
-needed patches and \fBzypper info -t patch <name>\fR to display detailed
-information about a patch.
-
-If \fIproduct\fR is specified, zypper ensures all packages required
-by the product are installed. Use \fBzypper se -t product [name]\fR to look
-for available products and \fBzypper info -t product <name>\fR to display
-detailed information about a product.
-
-.TP
-.I \-n, \-\-name
-Select packages by their name, don't try to select by capabilities.
-.TP
-.I \-f, \-\-force
-Install even if the item is already installed (reinstall), downgraded or changes vendor or architecture.
-.TP
-.I \ \ \ \ \-\-oldpackage
-Allow to replace a newer item with an older one. Handy if you are doing a rollback. Unlike --force it will not enforce a reinstall, if the item is already installed with the requested version.
-.TP
-.I \ \ \ \ \-\-from <alias|name|#|URI>
-Select packages from specified repository. If strings specified as arguments
-to the install command match packages in repositories specified in this option,
-they will be marked for installation. This option currently implies
-\fI\-\-name\fR, but allows using wildcards for specifying packages.
-.TP
-.I \-C, \-\-capability
-Select packages by capabilities.
-.TP
-.I \-l, \-\-auto\-agree\-with\-licenses
-Automatically say 'yes' to third party license confirmation prompt. By using this option, you choose to agree with licenses of all third-party software this command will install. This option is particularly useful for administators installing the same set of packages on multiple machines (by an automated process) and have the licenses confirmed before.
-.TP
-.I \ \ \ \ \-\-debug\-solver
-Create solver test case for debugging. Use this option, if you think the
-dependencies were not solved all right and attach the resulting /var/log/zypper.solverTestCase
-directory to your bug report. To use this option, simply add it to the problematic
-install or remove command.
-.TP
-.I \ \ \ \ \-\-no\-recommends
-By default, zypper installs also packages recommended by the requested ones.
-This option causes the recomended packages to be ignored and only the
-required ones to be installed.
-.TP
-.I \ \ \ \ \-\-replacefiles
-Install the packages even if they replace files from other, already installed, packages. Default is to treat file conflicts as an error. \fI--download-as-needed\fR disables the fileconflict check because access to all packages filelists is needed in advance in order to perform the check.
-.TP
-.I \-R, \-\-no\-force\-resolution
-Do not force the solver to find a solution. Instead, report
-dependency problem and prompt the user to resolve it manually.
-.TP
-.I \ \ \ \ \-\-force\-resolution
-Force the solver to find a solution, even if it would
-mean removing all packages with unfulfilled requirements.
-
-The default behavior is 'force' in the interactive mode and 'no-force' in the
-non-interactive mode. If this option is specified, it takes the preference.
-.TP
-.I \-D, \-\-dry\-run
-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
-Only download the packages for later installation.
-.TP
-.I \ \ \ \ \-\-download\-in\-advance
-First download all packages, then start installing.
-.TP
-.I \ \ \ \ \-\-download\-in\-heaps
-(Not yet implemented, currently the same as \fI--download-in-advance\fR).
-Download a minimal set of packages that can be installed without leaving
-the system in broken state, and install them. Then download and install another
-heap until all are installed. This helps to keep the system in consistent state
-without the need to download all package in advance, which combines the
-advantages of \fI--download-in-advance\fR and \fI--download-as-needed\fR.
-This is the default mode.
-.TP
-.I \ \ \ \ \-\-download\-as\-needed
-Download one package, install it immediately, and continue with the rest
-until all are installed.
-.TP
-.I \ \ \ \ \-\-download <mode>
-Use the specified download-and-install mode. Available modes are:
-\fBonly\fR, \fBin-advance\fR, \fBin-heaps\fR, \fBas-needed\fR.
-See corresponding \fI--download-<mode>\fR options for their description.
-
-.TP
-More examples:
-
-Install lamp_server pattern:
-.br
-.B $ zypper install -t pattern lamp_server
+The packages can be selected by their name or by a capability they provide\&. For details on package selection see the
+\fBinstall\fR
+command description\&.
+.PP
+\fB\-r\fR, \fB\-\-repo\fR \fIalias\fR|\fIname\fR|\fI#\fR|\fIURI\fR
+.RS 4
+Work only with the repository specified by the alias, name, number, or URI\&. This option can be used multiple times\&.
+.RE
+.PP
+\fB\-t\fR, \fB\-\-type\fR \fItype\fR
+.RS 4
+Type of package (default: package)\&. See section
+\fBPackage Types\fR
+for list of available package types\&.
+
+Since
+\fBpatches\fR
+are not installed in sense of copying files or recording a database entry, they cannot be uninstalled, even though zypper shows them as installed\&. The installed status is determined solely based on the installed status of its required dependencies\&. If these dependencies are satisfied, the patch is rendered installed\&.
+.RE
+.PP
+\fB\-n\fR, \fB\-\-name\fR
+.RS 4
+Select packages by their name (default)\&.
+.RE
+.PP
+\fB\-C\fR, \fB\-\-capability\fR
+.RS 4
+Select packages by capabilities\&.
+.RE
+.PP
+\fB\-\-debug\-solver\fR
+.RS 4
+Create solver test case for debugging\&. See the install command for details\&.
+.RE
+.PP
+\fB\-R\fR, \fB\-\-no\-force\-resolution\fR
+.RS 4
+Do not force the solver to find a solution\&. Instead, report dependency problem and prompt the user to resolve it manually\&.
+.RE
+.PP
+\fB\-\-force\-resolution\fR
+.RS 4
+Force the solver to find a solution, even if it would mean removing all packages with unfulfilled requirements\&.
+
+The default behavior is
+\fIforce\fR
+in the
+\fIinteractive mode\fR
+and
+\fIno\-force\fR
+in the
+\fInon\-interactive mode\fR\&. If this option is specified, it takes the preference\&.
+.RE
+.PP
+\fB\-u\fR, \fB\-\-clean\-deps\fR
+.RS 4
+Automatically remove dependencies which become unneeded after removal of requested packages\&.
+.RE
+.PP
+\fB\-U\fR, \fB\-\-no\-clean\-deps\fR
+.RS 4
+No automatic removal of unneeded dependencies\&.
+.RE
+.PP
+\fB\-D\fR, \fB\-\-dry\-run\fR
+.RS 4
+Test the removal of packages, do not actually remove anything\&. This option will add the
+\fB\-\-test\fR
+option to the rpm commands run by the remove command\&.
+.RE
+.PP
+\fB\-\-details\fR
+.RS 4
+Show the detailed installation summary\&.
+.RE
+.RE
+.SS "Update Management Commands"
+.PP
+\fBlist\-updates\fR (\fBlu\fR) [\fIoptions\fR]
+.RS 4
+List available updates\&.
+
+This command will list only installable updates, i\&.e\&. updates which have no dependency problems, or which do not change package vendor\&. This list is what the
+\fBupdate\fR
+command will propose to install\&. To list all packages for which newer version are available, use
+\fB\-\-all\fR
+option\&.
+.PP
+\fB\-t\fR, \fB\-\-type\fR \fItype\fR
+.RS 4
+Type of package (default: package)\&. See section
+\fBPackage Types\fR
+for list of available package types\&.
+
+If
+\fBpatch\fR
+is specified, zypper acts as if the
+\fBlist\-patches\fR
+command was executed\&.
+.RE
+.PP
+\fB\-r\fR, \fB\-\-repo\fR \fIalias\fR|\fIname\fR|\fI#\fR|\fIURI\fR
+.RS 4
+Work only with the repository specified by the alias, name, number, or URI\&. This option can be used multiple times\&.
+.RE
+.PP
+\fB\-a\fR, \fB\-\-all\fR
+.RS 4
+List all packages for which newer versions are available, regardless whether they are installable or not\&.
+.RE
+.PP
+\fB\-\-best\-effort\fR
+.RS 4
+See the
+\fBupdate\fR
+command for description\&.
+.RE
+.RE
+.PP
+\fBupdate\fR (\fBup\fR) [\fIoptions\fR] [\fIpackagename\fR]\&...
+.RS 4
+Update installed packages with newer versions, where possible\&.
+
+This command will not update packages which would require change of package vendor unless the vendor is specified in
+\fB/etc/zypp/vendors\&.d\fR, or which would require manual resolution of problems with dependencies\&. Such non\-installable updates will then be listed in separate section of the summary as "\fIThe following package updates will NOT be installed:\fR"\&.
+
+To update individual packages, specify one or more package names\&. You can use the
+\fB*\fR
+and
+\fB?\fR
+wildcard characters in the package names to specify multiple packages matching the pattern\&.
+.PP
+\fB\-t\fR, \fB\-\-type\fR \fItype\fR
+.RS 4
+Type of package (default: package)\&. See section
+\fBPackage Types\fR
+for list of available package types\&.
+
+If
+\fBpatch\fR
+is specified, zypper acts as if the
+\fBpatches\fR
+command was executed\&.
+.RE
+.PP
+\fB\-r\fR, \fB\-\-repo\fR \fIalias\fR|\fIname\fR|\fI#\fR|\fIURI\fR
+.RS 4
+Work only with the repository specified by the alias, name, number, or URI\&. This option can be used multiple times\&.
+.RE
+.PP
+\fB\-\-skip\-interactive\fR
+.RS 4
+This will skip interactive patches, that is, those that need reboot, contain a message, or update a package whose license needs to be confirmed\&.
+.RE
+.PP
+\fB\-\-with\-interactive\fR
+.RS 4
+Avoid skipping of interactive patches when in non\-interactive mode\&.
+.RE
+.PP
+\fB\-l\fR, \fB\-\-auto\-agree\-with\-licenses\fR
+.RS 4
+Automatically say
+\fIyes\fR
+to third party license confirmation prompt\&. By using this option, you choose to agree with licenses of all third\-party software this command will install\&. This option is particularly useful for administrators installing the same set of packages on multiple machines (by an automated process) and have the licenses confirmed before\&.
+.RE
+.PP
+\fB\-\-debug\-solver\fR
+.RS 4
+Create solver test case for debugging\&. See the install command for details\&.
+.RE
+.PP
+\fB\-\-no\-recommends\fR
+.RS 4
+By default, zypper installs also packages recommended by the requested ones\&. This option causes the recommended packages to be ignored and only the required ones to be installed\&.
+.RE
+.PP
+\fB\-\-replacefiles\fR
+.RS 4
+Install the packages even if they replace files from other, already installed, packages\&. Default is to treat file conflicts as an error\&.
+\fB\-\-download\-as\-needed\fR
+disables the fileconflict check because access to all packages filelists is needed in advance in order to perform the check\&.
+.RE
+.PP
+\fB\-R\fR, \fB\-\-no\-force\-resolution\fR
+.RS 4
+Do not force the solver to find a solution\&. Instead, report dependency problem and prompt the user to resolve it manually\&.
+.RE
+.PP
+\fB\-\-force\-resolution\fR
+.RS 4
+Force the solver to find a solution, even if it would mean removing all packages with unfulfilled requirements\&.
 
-Install GhostScript viewer, but ignore recommended packages:
-.br
-.B $ zypper install --no-recommends gv
+The default behavior is
+\fIno\-force\fR\&. If this option is specified, it takes the preference\&.
+.RE
+.PP
+\fB\-D\fR, \fB\-\-dry\-run\fR
+.RS 4
+Test the update, do not actually install or update any package\&. This option will add the
+\fB\-\-test\fR
+option to the rpm commands run by the update command\&.
+.RE
+.PP
+\fB\-\-details\fR
+.RS 4
+Show the detailed installation summary\&.
+.RE
+.PP
+\fB\-\-best\-effort\fR
+.RS 4
+Do a
+\fIbest effort\fR
+approach to update\&. This method does not explicitly select packages with best version and architecture, but instead requests installation of a package with higher version than the installed one and leaves the rest on the dependency solver\&. This method is always used for packages, and is optional for products and patterns\&. It is not applicable to patches\&.
+.RE
+.PP
+This command also accepts the download\-and\-install mode options described in the \fBinstall\fR command description\&.
+.RS 4
+.RE
+.RE
+.PP
+\fBlist\-patches\fR (\fBlp\fR) [\fIoptions\fR]
+.RS 4
+List all available needed patches\&.
+
+This command is similar to
+\fBzypper list\-updates \-t patch\fR\&.
+
+Note that
+\fIoptional arguments\fR
+of some of the following options must be specified using
+\fB=\fR
+instead of a space\&.
+.PP
+\fB\-b\fR, \fB\-\-bugzilla\fR[\fB=\fR\fI#\fR]
+.RS 4
+List available needed patches for all Bugzilla issues, or issues whose number matches the given string\&.
+.RE
+.PP
+\fB\-\-cve\fR[\fB=\fR\fI#\fR]
+.RS 4
+List available needed patches for all CVE issues, or issues whose number matches the given string\&.
+.RE
+.PP
+\fB\-\-date\fR \fIYYYY\-MM\-DD\fR
+.RS 4
+List patches issued up to the specified date\&.
+.RE
+.PP
+\fB\-g\fR, \fB\-\-category\fR \fIcategory\fR
+.RS 4
+List available patches in the specified category\&.
+.RE
+.PP
+\fB\-\-issues\fR[\fB=\fR\fIstring\fR]
+.RS 4
+Look for issues whose number, summary, or description matches the specified
+\fIstring\fR\&. Issues found by number are displayed separately from those found by descriptions\&. In the latter case, use
+\fI\fBzypper patch\-info\fR\fR\fI patchname\fR
+to get information about issues the patch fixes\&.
+.RE
+.PP
+\fB\-a\fR, *\-\-all
+.RS 4
+By default, only patches that are relevant and needed on your system are listed\&. This option causes all available released patches to be listed\&. This option can be combined with all the rest of the
+\fBlist\-updates\fR
+command options\&.
+.RE
+.PP
+\fB\-r\fR, \fB\-\-repo\fR \fIalias\fR|\fIname\fR|\fI#\fR|\fIURI\fR
+.RS 4
+Work only with the repository specified by the alias, name, number, or URI\&. This option can be used multiple times\&.
+.RE
+.RE
+.PP
+\fBpatch\-check\fR (\fBpchk\fR)
+.RS 4
+Check for patches\&. Displays a count of applicable patches and how many of them have the security category\&.
+
+See also the
+\fBEXIT CODES\fR
+section for details on exit status of
+\fB0\fR,
+\fB100\fR, and
+\fB101\fR
+returned by this command\&.
+.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\&.
+.RE
+.RE
+.PP
+\fBpatch\fR [\fIoptions\fR]
+.RS 4
+Install all available needed patches\&.
 
-Install version 2.0.6 of virtualbox-ose package (any of the following):
-.br
-.B $ zypper install virtualbox-ose-2.0.6
-.br
-.B $ zypper install virtualbox-ose=2.0.6
-.br
-.B $ zypper install virtualbox-ose = 2.0.6
-
-
-.TP
-.B source-install (si) <name> ...
-Install specified source packages and their build dependencies. If the name of
-a binary package is given, the coresponding source package is looked up and
-installed instead.
-
-This command will try to find the newest available versions of the source
-packages and use rpm -i to install them and the packages that are required
-to build the source package.
-
-Note that the source packages must be available in repositories you are using.
-You can check whether a repository contains any source packages using the
-following command:
-
-.B $ zypper search -t srcpackage -r <alias|name|#|URI>
-
-.TP
-.I \-d, \-\-build\-deps\-only
-Install only build dependencies of specified packages.
-.TP
-.I \-D, \-\-no\-build\-deps
-Don't install build dependencies.
-.TP
-\fI\-r, \-\-repo\fR <alias|name|#|URI>
-Work only with the repository specified by the alias, name, number, or URI. This
-option can be used multiple times.
-.TP
-.I \ \ \ \ \-\-download\-only
-Only download the packages, do not install.
-.TP
-Examples:
+If there are patches that affect the package management itself, those will be installed first and you will be asked to run the
+\fBpatch\fR
+command again\&.
 
-Install build dependencies of dbus-1 source package:
-.br
-.B $ zypper si -d dbus-1
-
-.TP
-.B verify (ve) [options]
-Check whether dependencies of installed packages are satisfied.
-
-In case that any dependency problems are found, zypper suggests packages
-to install or remove to fix them.
-
-.TP
-.I \ \ \ \ \-\-no\-recommends
-By default, zypper installs also packages recommended by the requested ones
-(the ones needed to fix broken dependencies in this case).
-This option causes the recomended packages to be ignored and only the
-required ones to be installed.
-.TP
-.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 <alias|name|#|URI>
-Work only with the repository specified by the alias, name, number, or URI. This
-option can be used multiple times.
-.TP
-.I \ \ \ \ \-\-debug\-solver
-Create solver test case for debugging. See the install command for details.
-
-.TP
-.B install-new-recommends (inr) [options]
-Install newly added packages recommended by already installed ones.
-This can typically be used to install language packages recently added
-to repositories or drivers for newly added hardware.
-
-.TP
-\fI\-r, \-\-repo\fR <alias|name|#|URI>
-Work only with the repository specified by the alias, name, number, or URI. This
-option can be used multiple times.
-.TP
-.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
-This command also accepts the download-and-install mode options described
-in the \fBinstall\fR command description.
-
-.TP
-.B remove (rm) [options] <name> ...
-.TP
-.B remove (rm) [options] --capability <capability> ...
-Remove (uninstall) packages.
-
-The packages can be selected by their name or by a capability they provide.
-For details on package selection see the \fBinstall\fR command description.
-
-.TP
-\fI\-r, \-\-repo\fR <alias|name|#|URI>
-Work only with the repository specified by the alias, name, number, or URI. This
-option can be used multiple times.
-.TP
-\fI\-t, -\-type\fR <type>
-Type of package (default: package). See section \fBPackage Types\fR for list
-of available package types.
-
-Since \fBpatches\fR are not installed in sense of copying files or recording
-a database entry, they cannot be uninstalled, even though zypper shows
-them as installed. The installed status is determined solely based on
-the installed status of its required dependencies. If these dependencies
-are satisified, the patch is rendered installed.
-
-Uninstallation of \fBpatterns\fR is currently not implemented.
-.TP
-.I \-n, \-\-name
-Select packages by their name (default).
-.TP
-.I \-C, \-\-capability
-Select packages by capabilities.
-.TP
-.I      \-\-debug\-solver
-Create solver test case for debugging. See the install command for details.
-.TP
-.I \-R, \-\-no\-force\-resolution
-Do not force the solver to find a solution. Instead, report
-dependency problem and prompt the user to resolve it manually.
-.TP
-.I \ \ \ \ \-\-force\-resolution
-Force the solver to find a solution, even if it would
-mean removing all packages with unfulfilled requirements.
-
-The default behavior is 'force' in the interactive mode and 'no-force' in the
-non-interactive mode. If this option is specified, it takes the preference.
-.TP
-.I \-u, \-\-clean\-deps
-Automatically remove dependencies which become unneeded after removal
-of requested packages.
-.TP
-.I \-U, \-\-no\-clean\-deps
-No automatic removal of unneeded dependencies.
-.TP
-.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
-
-
-.TP
-.B list-updates (lu) [options]
-List available updates.
-
-This command will list only installable updates, i.e. updates which have
-no dependency problems, or which do not change package vendor. This list
-is what the \fBupdate\fR command will propose to install. To list
-all packages for which newer version are available, use \fI\-\-all\fR option.
-
-.TP
-\fI\-t, --type\fR <type>
-Type of package (default: package). See section \fBPackage Types\fR for list
-of available package types.
-
-If \fIpatch\fR is specified, zypper acts as if the \fBlist-patches\fR command
-was executed.
-.TP
-\fI\-r, \-\-repo\fR <alias|name|#|URI>
-Work only with the repository specified by the alias, name, number, or URI. This
-option can be used multiple times.
-.TP
-.I \-a, \-\-all
-List all packages for which newer versions are available, regardles whether
-they are installable or not.
-.TP
-.I \ \ \ \ \-\-best\-effort
-See the \fBupdate\fR command for description.
-
-
-.TP
-.B update (up) [options] [packagename] ...
-Update installed packages with newer versions, where possible.
-
-This command will not update packages which would require change of package
-vendor unless the vendor is specified in /etc/zypp/vendors.d, or which would
-require manual resolution of problems with dependencies. Such non-installable
-updates will then be listed in separate section of the summary as
-"The following package updates will NOT be installed:".
-
-To update individual packages, specify one or more package names. You can
-use the '*' and '?' wildcard characters in the package names to specify
-multiple packages matching the pattern.
-
-.TP
-\fI\-t, -\-type\fR <type>
-Type of package (default: package). See section \fBPackage Types\fR for list
-of available package types.
-
-If \fIpatch\fR is specified, zypper acts as if the \fBpatche\fR command
-was executed.
-.TP
-\fI\-r, \-\-repo\fR <alias|name|#|URI>
-Work only with the repository specified by the alias, name, number, or URI. This
-option can be used multiple times.
-.TP
-.I \ \ \ \ \-\-skip\-interactive
-This will skip interactive patches, that is, those that need reboot,
-contain a message, or update a package whose license needs to be
-confirmed.
-.TP
-.I \ \ \ \ \-\-with\-interactive
-Avoid skipping of interactive patches when in non-interactive mode.
-.TP
-.I \-l, \-\-auto\-agree\-with\-licenses
-Automatically say 'yes' to third party license confirmation prompt. By using this option, you choose to agree with licenses of all third-party software this command will install. This option is particularly useful for administators installing the same set of packages on multiple machines (by an automated process) and have the licenses confirmed before.
-.TP
-.I \ \ \ \ \-\-debug\-solver
-Create solver test case for debugging. See the install command for details.
-.TP
-.I \ \ \ \ \-\-no\-recommends
-By default, zypper installs also packages recommended by the requested ones.
-This option causes the recomended packages to be ignored and only the
-required ones to be installed.
-.TP
-.I \ \ \ \ \-\-replacefiles
-Install the packages even if they replace files from other, already installed, packages. Default is to treat file conflicts as an error. \fI--download-as-needed\fR disables the fileconflict check because access to all packages filelists is needed in advance in order to perform the check.
-.TP
-.I \-R, \-\-no\-force\-resolution
-Do not force the solver to find a solution. Instead, report
-dependency problem and prompt the user to resolve it manually.
-.TP
-.I \ \ \ \ \-\-force\-resolution
-Force the solver to find a solution, even if it would
-mean removing all packages with unfulfilled requirements.
-
-The default behavior is 'no-force'. If this option is specified, it takes the preference.
-.TP
-.I \-D, \-\-dry\-run
-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
-of a package with higher version than the installed one and leaves the rest
-on the dependency solver. This method is always used for packages, and is
-optional for products and patterns. It is not applicable to patches.
-.TP
-This command also accepts the download-and-install mode options described
-in the \fBinstall\fR command description.
-
-
-.TP
-.B list-patches (lp) [options]
-List all available needed patches.
-
-This command is similar to 'zypper list-updates -t patch'.
-
-Note that since the arguments of some of the following options are not
-required, they must be specified using '=' instead of a space.
-
-.TP
-\fI\-b, \-\-bugzilla\fR[=#]
-List available needed patches for all Bugzilla issues, or issues whose
-number matches the given string.
-.TP
-\fI \ \ \ \ \-\-cve\fR[=#]
-List available needed patches for all CVE issues, or issues whose number
-matches the given string.
-.TP
-\fI\-g, \-\-category\fR <category>
-List available patches in the specified category.
-.TP
-\fI \ \ \ \ \-\-issues\fR[=string]
-Look for issues whose number, summary, or description matches the specified
-string. Issues found by number are displayed separately from those found
-by descriptions. In the latter case, use \fBzypper patch-info <patchname>\fR
-to get information about issues the patch fixes.
-.TP
-.I \-a, \-\-all
-By default, only patches that are relevant and needed on your system are listed.
-This option causes all available released patches to be listed. This option can
-be combined with all the rest of the \fBlist-updates\fR command options.
-.TP
-\fI\-r, \-\-repo\fR <alias|name|#|URI>
-Work only with the repository specified by the alias, name, number, or URI. This
-option can be used multiple times.
-
-.TP
-.B patch-check (pchk)
-Check for patches. Displays a count of applicable patches and how many
-of them have the security category.
-.PP
-See also the EXIT CODES section for details on exit status of 0, 100, and 101
-returned by this command.
-.TP
-.I \-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.
-
-.TP
-.B patch [options]
-Install all available needed patches.
-
-If there are patches that affect the package management itself, those will
-be installed first and you will be asked to run the \fBpatch\fR command again.
-
-This command is similar to 'zypper update -t patch'.
-
-.TP
-\fI\-b, \-\-bugzilla\fR <#>
-Install patch fixing a Bugzilla issue specified by number. Use
-\fBlist-patches --bugzilla\fR command to get a list of available
-needed patches for specific issues.
-.TP
-\fI \ \ \ \ \-\-cve\fR <#>
-Install patch fixing a MITRE's CVE issue specified by number. Use
-\fBlist-patches --cve\fR command to get a list of available
-needed patches for specific issues.
-.TP
-\fI\-g, \-\-category\fR <category>
-Install all patches in the specified category. Use
-\fBlist-patches --category\fR command to get a list of available
-patches for a specific category.
-.TP
-\fI\-r, \-\-repo\fR <alias|name|#|URI>
-Work only with the repository specified by the alias, name, number, or URI. This
-option can be used multiple times.
-.TP
-.I \ \ \ \ \-\-skip\-interactive
-Skip interactive patches.
-.TP
-.I \ \ \ \ \-\-with\-interactive
-Avoid skipping of  interactive patches when in non-interactive mode.
-.TP
-.I \-l, \-\-auto\-agree\-with\-licenses
-See the \fBupdate\fR command for description of this option.
-.TP
-.I \ \ \ \ \-\-no\-recommends
-By default, zypper installs also packages recommended by the requested ones.
-This option causes the recomended packages to be ignored and only the
-required ones to be installed.
-.TP
-.I \ \ \ \ \-\-replacefiles
-Install the packages even if they replace files from other, already installed, packages. Default is to treat file conflicts as an error. \fI--download-as-needed\fR disables the fileconflict check because access to all packages filelists is needed in advance in order to perform the check.
-.TP
-.I \ \ \ \ \-\-debug\-solver
-Create test case for debugging of dependency resolver.
-.TP
-.I \-D, \-\-dry\-run
-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
-.B dist-upgrade (dup) [options]
-Perform a distribution upgrade. This command applies the state of (specified)
-repositories onto the system; upgrades (or even downgrades) installed packages
-to versions found in repositories, removes packages that are no longer in the
-repositories and pose a dependency problem for the upgrade, handles package
-splits and renames, etc.
-
-If no repositories are specified via --from or --repo options, zypper
-will do the upgrade with all defined repositories. This can be a problem
-if the system contains conflicting repositories, like repositories
-for two different distribution releases. This often happens if one
-forgets to remove an older release repository after adding a new one, say
-openSUSE 11.1 and openSUSE 11.2.
-
-To avoid the above trouble, you can specify the repositories from
-which to do the upgrade using the --from or --repo options.
-The difference between these two is that when --repo is used, zypper
-uses only the specified repositories, while with --from
-zypper can also use the rest of the enabled repositories to
-satisfy package dependencies.
-
-Note: distribution upgrades in openSUSE are currently only supported between
-consecutive releases. To upgrade multiple releases, upgrade each consecutive
-release one at a time. For more details see http://en.opensuse.org/SDB:System_upgrade
-and the openSUSE release notes at http://doc.opensuse.org/release-notes/.
-
-.TP
-\fI\ \ \ \ \-\-from\fR <alias|name|#|URI>
-Restricts the upgrade to the specified repositories (the option can be used
-multiple times) only, but can satisfy dependencies also from the rest
-of enabled repositories.
-.TP
-\fI\-r, \-\-repo\fR <alias|name|#|URI>
-Work only with the repository specified by the alias, name, number, or URI. This
-option can be used multiple times.
-.TP
-.I \-l, \-\-auto\-agree\-with\-licenses
-Automatically say 'yes' to third party license confirmation prompt. By using this option, you choose to agree with licenses of all third-party software this command will install. This option is particularly useful for administators installing the same set of packages on multiple machines (by an automated process) and have the licenses confirmed before.
-.TP
-.I \ \ \ \ \-\-no\-recommends
-By default, zypper installs also packages recommended by the requested ones.
-This option causes the recomended packages to be ignored and only the
-required ones to be installed.
-.TP
-.I \ \ \ \ \-\-replacefiles
-Install the packages even if they replace files from other, already installed, packages. Default is to treat file conflicts as an error. \fI--download-as-needed\fR disables the fileconflict check because access to all packages filelists is needed in advance in order to perform the check.
-.TP
-.I \ \ \ \ \-\-debug\-solver
-Create solver test case for debugging. See the install command for details.
-.TP
-.I \-D, \-\-dry\-run
-Test the upgrade, do not actually install or update any package. This option will
-add the \-\-test option to the rpm commands run by the dist-upgrade command.
-.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
+This command is similar to
+\fBzypper update \-t patch\fR\&.
+.PP
+\fB\-b\fR, \fB\-\-bugzilla\fR \fI#\fR
+.RS 4
+Install patch fixing a Bugzilla issue specified by number\&. Use
+\fBlist\-patches \-\-bugzilla\fR
+command to get a list of available needed patches for specific issues\&.
+.RE
+.PP
+\fB\-\-cve\fR \fI#\fR
+.RS 4
+Install patch fixing a MITRE\(cqs CVE issue specified by number\&. Use
+\fBlist\-patches \-\-cve\fR
+command to get a list of available needed patches for specific issues\&.
+.RE
+.PP
+\fB\-\-date\fR \fIYYYY\-MM\-DD\fR
+.RS 4
+Install patches issued up to the specified date\&.
+.RE
+.PP
+\fB\-g\fR, \fB\-\-category\fR \fIcategory\fR
+.RS 4
+Install all patches in the specified category\&. Use
+\fBlist\-patches \-\-category\fR
+command to get a list of available patches for a specific category\&.
+.RE
+.PP
+\fB\-r\fR, \fB\-\-repo\fR \fIalias\fR|\fIname\fR|\fI#\fR|\fIURI\fR
+.RS 4
+Work only with the repository specified by the alias, name, number, or URI\&. This option can be used multiple times\&.
+.RE
+.PP
+\fB\-\-skip\-interactive\fR
+.RS 4
+Skip interactive patches\&.
+.RE
+.PP
+\fB\-\-with\-interactive\fR
+.RS 4
+Avoid skipping of interactive patches when in non\-interactive mode\&.
+.RE
+.PP
+\fB\-l\fR, \fB\-\-auto\-agree\-with\-licenses\fR
+.RS 4
+See the
+\fBupdate\fR
+command for description of this option\&.
+.RE
+.PP
+\fB\-\-no\-recommends\fR
+.RS 4
+By default, zypper installs also packages recommended by the requested ones\&. This option causes the recommended packages to be ignored and only the required ones to be installed\&.
+.RE
+.PP
+\fB\-\-replacefiles\fR
+.RS 4
+Install the packages even if they replace files from other, already installed, packages\&. Default is to treat file conflicts as an error\&.
+\fB\-\-download\-as\-needed\fR
+disables the fileconflict check because access to all packages filelists is needed in advance in order to perform the check\&.
+.RE
+.PP
+\fB\-\-debug\-solver\fR
+.RS 4
+Create test case for debugging of dependency resolver\&.
+.RE
+.PP
+\fB\-D\fR, \fB\-\-dry\-run\fR
+.RS 4
+Test the update, do not actually update\&.
+.RE
+.PP
+\fB\-\-details\fR
+.RS 4
+Show the detailed installation summary\&.
+.RE
+.PP
+This command also accepts the \fBdownload\-and\-install\fR mode options described in the \fBinstall\fR command description\&.
+.RS 4
+.RE
+.RE
+.PP
+\fBdist\-upgrade\fR (\fBdup\fR) [\fIoptions\fR]
+.RS 4
+Perform a distribution upgrade\&. This command applies the state of (specified) repositories onto the system; upgrades (or even downgrades) installed packages to versions found in repositories, removes packages that are no longer in the repositories and pose a dependency problem for the upgrade, handles package splits and renames, etc\&.
+
+If no repositories are specified via the
+\fB\-\-from\fR
+option, zypper will do the upgrade with all defined repositories\&. This can be a problem if the system contains conflicting repositories, like repositories for two different distribution releases\&. This often happens if one forgets to remove an older release repository after adding a new one, say openSUSE 13\&.1 and openSUSE 13\&.2\&.
+
+For all repositories which have the distribution version within their URL (like
+http://download\&.opensuse\&.org/distribution/\fI13\&.1\fR/repo/oss) using the
+\fB$releasever\fR
+variable instead may be helpful (http://download\&.opensuse\&.org/distribution/\fB$releasever\fR/repo/oss)\&. The variable is per default substituted by the current distributions version (\fI13\&.1\fR) This value can be overwritten using the
+\fB\-\-releasever\fR
+global option\&. Calling
+\fBzypper \-\-releasever 13\&.2\fR\fI\&...\fR
+will cause these repos to use the new location (http://download\&.opensuse\&.org/distribution/\fI13\&.2\fR/repo/oss) without need to add/remove anything\&. Once the
+\fBdup\fR
+is performed,
+\fB$releasever\fR
+will default to the new distribution version\&. See section
+\fBRepository Management\fR
+for more info about variable substitution\&.
+
+Note: distribution upgrades in openSUSE are currently only supported between consecutive releases\&. To upgrade multiple releases, upgrade each consecutive release one at a time\&. For more details see
+\fBhttp://en\&.opensuse\&.org/SDB:System_upgrade\fR
+and the
+\fIopenSUSE release notes\fR
+at
+\fBhttp://doc\&.opensuse\&.org/release\-notes/\fR\&.
+.PP
+\fB\-\-from\fR \fIalias\fR|\fIname\fR|\fI#\fR|\fIURI\fR
+.RS 4
+Restricts the upgrade to the specified repositories (the option can be used multiple times) only, but can satisfy dependencies also from the rest of enabled repositories\&.
+.RE
+.PP
+\-r, \-\-repo alias|name|#|URI
+.RS 4
+Work only with the repository specified by the alias, name, number, or URI\&.
+
+Using \-\-repo is
+\fIdiscouraged\fR
+as it currently hides unmentioned repositories from the resolver, leading to inexpertly decisions\&. In the future \-\-repo will become an alias for
+\fB\-\-from\fR\&.
+.RE
+.PP
+\fB\-l\fR, \fB\-\-auto\-agree\-with\-licenses\fR
+.RS 4
+Automatically say
+\fIyes\fR
+to third party license confirmation prompt\&. By using this option, you choose to agree with licenses of all third\-party software this command will install\&. This option is particularly useful for administrators installing the same set of packages on multiple machines (by an automated process) and have the licenses confirmed before\&.
+.RE
+.PP
+\fB\-\-no\-recommends\fR
+.RS 4
+By default, zypper installs also packages recommended by the requested ones\&. This option causes the recommended packages to be ignored and only the required ones to be installed\&.
+.RE
+.PP
+\fB\-\-replacefiles\fR
+.RS 4
+Install the packages even if they replace files from other, already installed, packages\&. Default is to treat file conflicts as an error\&.
+\fB\-\-download\-as\-needed\fR
+disables the fileconflict check because access to all packages filelists is needed in advance in order to perform the check\&.
+.RE
+.PP
+\fB\-\-debug\-solver\fR
+.RS 4
+Create solver test case for debugging\&. See the install command for details\&.
+.RE
+.PP
+\fB\-D\fR, \fB\-\-dry\-run\fR
+.RS 4
+Test the upgrade, do not actually install or update any package\&. This option will add the
+\fB\-\-test\fR
+option to the rpm commands run by the dist\-upgrade command\&.
+.RE
+.PP
+\fB\-\-details\fR
+.RS 4
+Show the detailed installation summary\&.
+.RE
+.PP
+This command also accepts the download\-and\-install mode options described in the \fBinstall\fR command description\&.
+.RS 4
+.RE
+.PP
 Examples:
+.RS 4
+.PP
+$ \fBzypper dup \-\-from factory \-\-from packman\fR
+.RS 4
+Upgrade the system to the lates versions provided by the
+\fIfactory\fR
+and
+\fIpackman\fR
+repositories\&.
+.RE
+.RE
+.RE
+.SS "Query Commands"
+.PP
+\fBsearch\fR (\fBse\fR) [\fIoptions\fR] [\fIquerystring\fR|\fIcapability\fR]\&...
+.RS 4
+Search for packages matching any of the given search strings\&.
+\fB*\fR
+and
+\fI\fB?\fR\fR\fI wildcard\fR
+characters can be used within search strings\&. If the search string is enclosed in
+\fB/\fR
+(e\&.g\&.
+\fB/^k\&.*e$/\fR) it\(cqs interpreted as a
+\fIregular expression\fR\&. See the
+\fBinstall\fR
+command for details about how to specify a
+\fIcapability\fR\&.
+
+Results of the search are printed in a table\&. with columns
+\fBS\fRtatus,
+\fBName\fR,
+\fBType\fR
+of package,
+\fBVersion\fR,
+\fBArch\fRitecture
+and
+\fBRepository\fR\&. The
+\fBS\fRtatus
+column can contain the following values:
+.TS
+tab(:);
+lt lt
+lt lt
+lt lt.
+T{
+\fBi\fR
+T}:T{
+installed
+T}
+T{
+\fBv\fR
+T}:T{
+a different version is installed
+T}
+T{
+\fIempty\fR
+T}:T{
+neither of the former cases
+T}
+.TE
+.sp 1
+The
+\fBv\fR
+status is only shown if the version or the repository matters (see
+\fB\-\-details\fR
+or
+\fB\-\-repo\fR), and the installed version differs from the one listed or is from a repository other than specified\&.
 
-Upgrade the system using 'factory' and 'packman' repository:
-.br
-.B $ zypper install zypper libzypp
-.br
-.B $ zypper dup --from factory --from packman
-
-.SS Query Commands
-
-
-.TP
-\fBsearch\fR (\fBse\fR) [\fIoptions\fR] [\fBquerystring|capability\fR] ...
-Search for packages matching any of the given strings. * (any substring) and ?
-(any character) wildcards can also be used within search strings.
-If the search string is enclosed in '/', for example
-.B $ zypper se '/^k.*e$/',
-it's interpreted as a regular expression.
-It's also possible to specify a capability like "NAME[.ARCH][OP<EDITION>]", where ARCH
-is an architecture code, OP is <, <=, =, >=, or > and EDITION is VERSION[-RELEASE].
-Also quote here to protect the special characters from the shell, for example:
-.B $ zypper se 'libgcc>4.6'.
-
-Results of search are printed in a table with following columns:
-S (status), Catalog, Type (type of package), Name, Version,
-Arch (architecture). The status column can contain the following
-values: i - installed, v - another version installed,
-or an empty space for neither of the former cases.
-
-The 'v' status is only shown if the version or the repository
-matters (\fI\-\-details\fR or \fI\-\-repo\fR is used), and the installed
-version differs from the one listed or is from a repository other
-than specified.
-
-.IP
 This command accepts the following options:
-
-.TP
-\fI    \-\-match\-substrings\fR
-Matches for search strings may be partial words (default).
-.TP
-\fI    \-\-match\-words\fR
-Matches for search strings may only be whole words.
-.TP
-\fI    \-\-match-exact\fR
-Searches for an exact name of the package.
-.TP
-\fI    \-\-provides
-Search for packages which provide the search strings. A search string here might be also
-any symbol provided by a package like /bin/vi, libcurl.so.3, perl(Time::ParseDate),
-web_browser, e.g. search for the package which provides the shell:
-.B zypper se --provides /bin/sh
-.TP
-\fI    \-\-requires
-Search for packages which require the search strings. A search string here might be also
-any symbol required by a package, e.g. all packages which require the snapper library:
-.B zypper se --requires libsnapper.so
-.TP
-\fI    \-\-recommends
-Search for packages which recommend the search strings, e.g.
-.B zypper se --recommends usb_modeswitch
-.TP
-\fI    \-\-suggests
-Search for packages which suggest the search strings, e.g.
-.B zypper se --suggests acroread
-.TP
-\fI    \-\-conflicts
-Search for packages conflicting with the search strings, e.g.
-.B zypper se --conflicts aspell-hi
-.TP
-\fI    \-\-obsoletes
-Search for packages wich obsolete the search strings, e.g.
-.B zypper se --obsoletes efence
-.TP
-.I \-n, \-\-name
-Useful together with dependency options, otherwise searching in package name is default.
-.TP
-.I \-f, \-\-file\-list
-Search in file list of packages.
-.TP
-.I \-d, \-\-search\-descriptions
-Search also in summaries and descriptions.
-.TP
-.I \-C, \-\-case\-sensitive
-Perform case-sensitive search.
-.TP
-.I \-i, \-\-installed\-only
-Show only packages that are already installed.
-.TP
-.I \-u, \-\-uninstalled\-only
-Show only packages that are not currently installed.
-.TP
-.I \-t, -\-type <type>
-Search only for packages of specified type. See section \fBPackage Types\fR for list
-of available package types. Multiple \-t option are allowed.
-
-See also the type-specific query commands like \fBpackages\fR, \fBpatterns\fR, etc.
-.TP
-\fI\-r, \-\-repo\fR <alias|name|#|URI>
-Work only with the repository specified by the alias, name, number, or URI. This
-option can be used multiple times.
-.TP
-.I \ \ \ \ \-\-sort\-by\-name
-Sort packages by name (default).
-.TP
-.I \ \ \ \ \-\-sort\-by\-repo
-Sort packages by catalog, not by name.
-.TP
-.I \-s, \-\-details
-Show all available versions of found packages, each version in each repository
-on a separate line.
-.TP
-.I \-v, \-\-verbose
-Like --details with additional information where the search has matched (useful when searching
-for dependencies, e.g. --provides).
-.TP
+.PP
+\fB\-\-match\-substrings\fR
+.RS 4
+Matches for search strings may be partial words (default)\&.
+.RE
+.PP
+\fB\-\-match\-words\fR
+.RS 4
+Matches for search strings may only be whole words\&.
+.RE
+.PP
+\fB\-\-match\-exact\fR
+.RS 4
+Searches for an exact name of the package\&.
+.RE
+.PP
+\fB\-\-provides\fR
+.RS 4
+Search for packages which provide the search strings\&.
+.RE
+.PP
+\fB\-\-requires\fR
+.RS 4
+Search for packages which require the search strings\&.
+.RE
+.PP
+\fB\-\-recommends\fR
+.RS 4
+Search for packages which recommend the search strings\&.
+.RE
+.PP
+\fB\-\-suggests\fR
+.RS 4
+Search for packages which suggest the search strings\&.
+.RE
+.PP
+\fB\-\-conflicts\fR
+.RS 4
+Search for packages conflicting with the search strings\&.
+.RE
+.PP
+\fB\-\-obsoletes\fR
+.RS 4
+Search for packages which obsolete the search strings\&.
+.RE
+.PP
+\fB\-n\fR, \fB\-\-name\fR
+.RS 4
+Useful together with dependency options, otherwise searching in package name is default\&.
+.RE
+.PP
+\fB\-f\fR, \fB\-\-file\-list\fR
+.RS 4
+Search in file list of packages\&.
+.RE
+.PP
+\fB\-d\fR, \fB\-\-search\-descriptions\fR
+.RS 4
+Search also in summaries and descriptions\&.
+.RE
+.PP
+\fB\-C\fR, \fB\-\-case\-sensitive\fR
+.RS 4
+Perform case\-sensitive search\&.
+.RE
+.PP
+\fB\-i\fR, \fB\-\-installed\-only\fR
+.RS 4
+Show only packages that are already installed\&.
+.RE
+.PP
+\fB\-u\fR, \fB\-\-uninstalled\-only\fR
+.RS 4
+Show only packages that are not currently installed\&.
+.RE
+.PP
+\fB\-t\fR, \fB\-\-type\fR \fItype\fR
+.RS 4
+Search only for packages of specified type\&. See section
+\fBPackage Types\fR
+for list of available package types\&. Multiple
+\fB\-\-type\fR
+options are allowed\&.
+
+See also the type\-specific query commands like
+\fBpackages\fR,
+\fBpatterns\fR, etc\&.
+.RE
+.PP
+\fB\-r\fR, \fB\-\-repo\fR \fIalias\fR|\fIname\fR|\fI#\fR|\fIURI\fR
+.RS 4
+Work only with the repository specified by the alias, name, number, or URI\&. This option can be used multiple times\&.
+.RE
+.PP
+\fB\-\-sort\-by\-name\fR
+.RS 4
+Sort packages by name (default)\&.
+.RE
+.PP
+\fB\-\-sort\-by\-repo\fR
+.RS 4
+Sort packages by repository, not by name\&.
+.RE
+.PP
+\fB\-s\fR, \fB\-\-details\fR
+.RS 4
+Show all available versions of mayching packages, each version in each repository on a separate line\&.
+.RE
+.PP
+\fB\-v\fR, \fB\-\-verbose\fR
+.RS 4
+Like
+\fB\-\-details\fR
+with additional information where the search has matched (useful when searching for dependencies, e\&.g\&.
+\fB\-\-provides\fR)\&.
+.RE
+.PP
 Examples:
-
-Search for YaST packages (quote the string to prevent the shell
-from expanding the wildcard):
-.br
-.B $ zypper se 'yast*'
-
-Show all available versions of package 'kernel-default':
-.br
-.B $ zypper se -s --match-exact kernel-default
-
-Look for RSI acronym (case-sensitively), also in summaries and descriptions:
-.br
-.B $ zypper se -dC --match-words RSI
-
-
-.TP
-.B packages (pa) [options] [repository] ...
-List all available packages or all packages from specified repositories
-(similar to \fBzypper search -s -t package\fR).
-Also allows the options \fI\-\-orphaned\fR, \fI\-\-suggested\fR, \fI\-\-recommended\fR
-and \fI\-\-unneeded\fR to get corresponding lists of packages.
-.TP
-.I \-r, \-\-repo <alias|name|#|URI>
-Just another means to specify repositories.
-.TP
-.I \-i, \-\-installed\-only
-Show only installed packages.
-.TP
-.I \-u, \-\-uninstalled\-only
-Show only packages which are not installed.
-.TP
-.I \-\-orphaned
-Show packages which are orphaned (without repository).
-.TP
-.I \-\-suggested
-Show packages which are suggested.
-.TP
-.I \-\-recommended
-Show packages which are recommeded.
-.TP
-.I \-\-unneeded
-Show packages which are unneeded.
-
-.TP
-.B patches (pch) [options] [repository] ...
-List all available patches from specified repositories, including those not
-needed. Similar to \fBzypper search -s -t patch\fR.
-.TP
-\fI\-r, \-\-repo\fR <alias|name|#|URI>
-Just another means to specify repositories.
-
-.TP
-.B patterns (pt) [options] [repository] ...
-List all available patterns or all patterns from specified repositories.
-Similar to \fBzypper search -s -t pattern\fR.
-.TP
-.I \-r, \-\-repo <alias|name|#|URI>
-Just another means to specify repositories.
-.TP
-.I \-i, \-\-installed\-only
-Show only installed patterns.
-.TP
-.I \-u, \-\-uninstalled\-only
-Show only patterns which are not installed.
-
-.TP
-.B products (pd) [options] [repository] ...
-List all available products or all products from specified repositories.
-Similar to \fBzypper search -s -t product\fR, but shows also the type of the product
-(base, add-on).
-.TP
-.I \-r, \-\-repo <alias|name|#|URI>
-Just another means to specify repositories.
-.TP
-.I \-i, \-\-installed\-only
-Show only installed products.
-.TP
-.I \-u, \-\-uninstalled\-only
-Show only products which are not installed.
-
-.TP
-.B what-provides (wp) <capability>
-List all packages providing the specified capability. See also the \fBinstall\fR command for hint about capabilities.
-.br
-\fBwhat-provides\fR is replaced by the \fBsearch\fR command, which now has the functionality
-to search for dependencies (and allows various options).
-.br
-The command line is automatically transformed to the appropriate \fBsearch\fR, e.g.:
-.br
-.B $ zypper what-provides 'zypper>1.6'
-to
-.B $ zypper se --provides --match-exact 'zypper>1.6'
-
-.SS Repository Management
+.RS 4
+.PP
+$ \fBzypper se \*(Aqyast*\*(Aq\fR
+.RS 4
+Search for YaST packages (quote the string to prevent the shell from expanding the wildcard)\&.
+.RE
+.PP
+$ \fBzypper se \-s \-\-match\-exact kernel\-default\fR
+.RS 4
+Show all available versions of package kernel\-default
+.RE
+.PP
+$ \fBzypper se \-dC \-\-match\-words RSI\fR
+.RS 4
+Look for RSI acronym (case\-sensitively), also in summaries and descriptions\&.
+.RE
+.RE
+.RE
+.PP
+\fBpackages\fR (\fBpa\fR) [\fIoptions\fR] [\fIrepository\fR]\&...
+.RS 4
+List all available packages or all packages from specified repositories\&. Similar to
+\fBzypper search \-s \-t package\fR\&.
+.PP
+\fB\-r\fR, \fB\-\-repo\fR \fIalias\fR|\fIname\fR|\fI#\fR|\fIURI\fR
+.RS 4
+Just another means to specify repositories\&.
+.RE
+.PP
+\fB\-i\fR, \fB\-\-installed\-only\fR
+.RS 4
+Show only installed packages\&.
+.RE
+.PP
+\fB\-u\fR, \fB\-\-uninstalled\-only\fR
+.RS 4
+Show only packages which are not installed\&.
+.RE
+.PP
+\fB\-\-orphaned\fR
+.RS 4
+Show packages which are orphaned (without repository)\&.
+.RE
+.PP
+\fB\-\-suggested\fR
+.RS 4
+Show packages which are suggested\&.
+.RE
+.PP
+\fB\-\-recommended\fR
+.RS 4
+Show packages which are recommended\&.
+.RE
+.PP
+\fB\-\-unneeded\fR
+.RS 4
+Show packages which are unneeded\&.
+.RE
+.RE
+.PP
+\fBpatches\fR (\fBpch\fR) [\fIoptions\fR] [\fIrepository\fR]\&...
+.RS 4
+List all available patches from specified repositories, including those not needed\&. Similar to
+\fBzypper search \-s \-t patch\fR\&.
+.PP
+\fB\-r\fR, \fB\-\-repo\fR \fIalias\fR|name\*(Aq|\fI#\fR|\fIURI\fR
+.RS 4
+Just another means to specify repositories\&.
+.RE
+.RE
+.PP
+\fBpatterns\fR (\fBpt\fR) [\fIoptions\fR] [\fIrepository\fR]\&...
+.RS 4
+List all available patterns or all patterns from specified repositories\&. Similar to
+\fBzypper search \-s \-t pattern\fR\&.
+.PP
+\fB\-r\fR, \fB\-\-repo\fR \fIalias\fR|\fIname\fR|\fI#\fR|\fIURI\fR
+.RS 4
+Just another means to specify repositories\&.
+.RE
+.PP
+\fB\-i\fR, \fB\-\-installed\-only\fR
+.RS 4
+Show only installed patterns\&.
+.RE
+.PP
+\fB\-u\fR, \fB\-\-uninstalled\-only\fR
+.RS 4
+Show only patterns which are not installed\&.
+.RE
+.RE
+.PP
+\fBproducts\fR (\fBpd\fR) [\fIoptions\fR] [\fIrepository\fR]\&...
+.RS 4
+List all available products or all products from specified repositories\&. Similar to
+\fBzypper search \-s \-t product\fR, but shows also the type of the product (\fBbase\fR,
+\fBadd\-on\fR)\&.
+.PP
+\fB\-r\fR, \fB\-\-repo\fR \fI\*(Aqalias\fR|\fIname\fR|\fI#\fR|\fIURI\fR
+.RS 4
+Just another means to specify repositories\&.
+.RE
+.PP
+\fB\-i\fR, \fB\-\-installed\-only\fR
+.RS 4
+Show only installed products\&.
+.RE
+.PP
+\fB\-u\fR, \fB\-\-uninstalled\-only\fR
+.RS 4
+Show only products which are not installed\&.
+.RE
+.RE
+.PP
+\fBwhat\-provides\fR (\fBwp\fR) \fIcapability\fR
+.RS 4
+List all packages providing the specified capability\&. See also the
+\fBinstall\fR
+command for info about specifying
+\fIcapabilities\fR\&.
+.PP
+The command line is automatically transformed into the appropriate \fBsearch\fR command, e\&.g\&.:
+.RS 4
+.PP
+$ \fBzypper what\-provides \*(Aqzypper>1\&.6\*(Aq\fR
+.RS 4
+.RE
+.PP
+$ \fBzypper se \-\-provides \-\-match\-exact \*(Aqzypper>1\&.6\*(Aq\fR
+.RS 4
+.RE
+.RE
+.RE
+.SS "Repository Management"
+.sp
+Zypper is able to work with YaST, RPM\-MD (yum) software repositories, and plain directories containing \&.rpm files\&.
+.sp
+Repositories are primarily identified using their \fIURI\fR or \fIalias\fR\&. Alias serves as a shorthand for the long URI or name of the repository\&. The \fIname\fR of the repository should briefly describe the repository and is shown to the user in tables and messages\&. The name is not required, and if not known, the alias is shown instead\&. The alias is required and uniquely identifies the repository on the system\&.
+.sp
+The \fIalias\fR, \fIname\fR, \fIURI\fR, or the \fInumber\fR from \fBzypper repos\fR list can be used to specify a repository as an argument of various zypper commands and options like \fBrefresh\fR, \fB\-\-repo\fR, or \fB\-\-from\fR\&.
+.sp
+Apart from the above, repositories have several other properties which can be set using the commands described in this section below, or by manually editing the repository definition files (\fB\&.repo\fR files, see section \fBFILES\fR)\&.
+.sp
+.it 1 an-trap
+.nr an-no-space-flag 1
+.nr an-break-flag 1
+.br
+.ps +1
+\fBVariable substitution:\fR
+.RS 4
+.sp
+You can use the following built\-in variables within a \fB\&.repo\fR or \fB\&.service\fR files \fIname\fR and \fIURI\fR values:
+.PP
+\fB$arch\fR
+.RS 4
+Use this variable to refer to the system\(cqs CPU architecture\&.
+.RE
+.PP
+\fB$basearch\fR
+.RS 4
+Use this variable to refer to the base architecture of the system\&. For example, iX86 machines have a base architecture of
+\fBi386\fR, while AMD64 and Intel64 have
+\fBx86_64\fR\&.
+.RE
+.PP
+\fB$releasever\fR, \fB$releasever_major\fR, \fB$releasever_minor\fR
+.RS 4
+Use this variable to refer to the version of your openSUSE or SUSE Linux\&. The value is obtained from the
+\fI/product/version\fR
+XML\-node in
+\fB/etc/products\&.d/baseproduct\fR\&.
+
+This is useful for related repositories like packman (\fBhttp://ftp\&.gwdg\&.de/pub/linux/packman/suse/$releasever\fR), which shall always fit the installed distribution, even after a distribution upgrade\&. To help performing a distribution upgrade, the value of
+\fB$releasever\fR
+can be overwritten using the
+\fB\-\-releasever\fR
+global option\&. This way you can easily switch all repositories using
+\fB$releasever\fR
+to the new version (provided the server layouts did not change and new repos are already available)\&.
+
+In addition
+\fB$releasever_major\fR
+will be set to the leading portion up to (but not including) the 1st dot;
+\fB$releasever_minor\fR
+to the trailing portion after the 1st dot\&. If there\(cqs no dot in
+\fB$releasever\fR,
+\fB$releasever_major\fR
+is the same as
+\fB$releasever\fR
+and
+\fB$releasever_minor\fR
+is empty\&.
+.RE
+.PP
+Remember to protect the \fB$\fR when using these variables on a shell command line:
+.RS 4
+zypper ar \-f
+http://ftp\&.gwdg\&.de/pub/linux/packman/suse/\fB\e$\fRreleasever packman
+.RE
+.PP
+If a variable is followed by an alphanumeric character or underscore it needs to be enclosed in \fB{}\fR:
+.RS 4
+zypper ar \-f
+http://ftp\&.gwdg\&.de/pub/linux/packman/suse/\fB\e${\fR\fIreleasever\fR\fB}\fR_packman
+.RE
+.PP
+Bash style definition of default \fB${\fR\fIvariable\fR\fB:\-\fR\fIword\fR\fB}\fR and alternate \fB${\fR\fIvariable\fR\fB:+\fR\fIword\fR\fB}\fR values:
+.RS 4
+SLE\-\fB${\fR\fIreleasever_major\fR\fB}${\fR\fIreleasever_minor\fR\fB:+\fR\-SP\-\fI$releasever_minor\fR\fB}\fR
+.RE
+.PP
+To check where you already use \fB$releasever\fR call:
+.RS 4
+\fBzypper \-\-releasever @\-\-HERE\-\-@ lr \-u\fR
+.RE
+.RE
+.sp
+.it 1 an-trap
+.nr an-no-space-flag 1
+.nr an-break-flag 1
+.br
+.ps +1
+\fBSupported URI formats:\fR
+.RS 4
+.PP
+\fIscheme\fR\fB:\fR [\fB//\fR[\fIuser\fR[\fB:\fR\fIpassword\fR]\fI\fB@\fR\fR]\fIhost\fR[\fB:\fR\fIport\fR]] \fB/\fR\fIpath\fR [\fB?\fR\fIquery\fR] [\fB#\fR\fIfragment\fR]
+.RS 4
+Special characters occurring in URI components (like a
+\fI\fB@\fR\fR
+in a password) must be %\-encoded (\fI\fB%40\fR\fR)\&.
+.RE
 .PP
-Zypper is able to work with YaST, RPM-MD (yum) software repositories, and
-plain directories containing .rpm files.
-
-Repositories are primarily identified using their \fIURI\fR or \fIalias\fR.
-Alias serves as a shorthand for the long URI or name of the repository.
-The \fIname\fR of the repository should briefly describe the repository and
-is shown to the user in tables and messages. The name is not required, and
-if not known, the alias is shown instead. The alias is required and
-uniquely identifies the repository on the system.
-
-The \fIalias\fR, \fIname\fR, \fIURI\fR, or the \fInumber\fR from \fBzypper repos\fR list can be used to
-specify a repository as an argument of various zypper commands and
-options like \fBrefresh\fR, \fB--repo\fR, or \fB--from\fR.
-
-.TP
-Supported URI formats:
-
-.B \fIscheme\fB: \fR[\fB//\fR[\fIuser\fR[\fB:\fIpassword\fR]\fB@\fR]\fIhost\fR[\fB:\fIport\fR]] \fB/\fIpath \fR[\fB?\fIquery\fR][\fB#\fIfragment\fR]
-.br
-Special characters occuring in URI components (like a '\fB@\fR' in a password) must be %-encoded ('\fB%40\fR').
-
-.TP
 CD or DVD drive
-Optionally with \fIdevices\fR list for probing.
-
-.B cd:///
-.br
-.B dvd:/subdir\fI?devices=/dev/sr0,/dev/sr1
-
-.TP
+.RS 4
+Optionally with
+\fIdevices\fR
+list for probing\&.
+.TS
+tab(:);
+lt lt
+lt lt.
+T{
+
+T}:T{
+\fBcd:///\fR
+T}
+T{
+
+T}:T{
+\fBdvd:/subdir\fR\fI?devices=/dev/sr0,/dev/sr1\fR
+T}
+.TE
+.sp 1
+.RE
+.PP
 FTP/HTTP/HTTPS directory tree
-The ftp URL scheme supports absolute and relative paths to the default ftp server directory (RFC1738, Section 3.2.2). To use an absolute path, you have to prepend the path with an additional slash, what results in a "/%2f" combination (second "/" encoded to "%2f") at the begin of the URL path. This is important, especially in user authenticated ftp, where the users home is usually the default directory of the server (except when the server chroots into the users home directory).
-
-Explicit proxy settings may be passed via optional parameters \fIproxy\fR, \fIproxyport\fR, \fIproxyuser\fR and \fIproxypass\fR.
-
-HTTP authentication methods to use can be defined as comma separated list via optional parameter \fIauth\fR. Valid methods are e.g. 'basic', 'digest', 'ntlm', 'negotiate'. Note, that this list depends on the list of methods supported by the curl library.
-
-.br
-.B ftp://user:pass@server/path/to/media/dir
-.br
-.B ftp://user:pass@server/%2fhome/user/path/to/media/dir
-.br
-.B http://user:pass@server/path
-.br
-.B https://user:pass@server/path\fI?proxy=foo&proxyuser=me&proxypass=pw
-
-.TP
+.RS 4
+The ftp URL scheme supports absolute and relative paths to the default ftp server directory (RFC1738, Section 3\&.2\&.2)\&. To use an absolute path, you have to prepend the path with an additional slash, what results in a
+\fB/%2f\fR
+combination (second
+\fB/\fR
+encoded to
+\fB%2f\fR) at the begin of the URL path\&. This is important, especially in user authenticated ftp, where the users home is usually the default directory of the server (except when the server chroots into the users home directory)\&.
+
+Explicit proxy settings may be passed via optional parameters
+\fIproxy\fR,
+\fIproxyport\fR,
+\fIproxyuser\fR
+and
+\fIproxypass\fR\&.
+
+HTTP authentication methods to use can be defined as comma separated list via optional parameter
+\fIauth\fR\&. Valid methods are e\&.g\&.
+\fIbasic\fR,
+\fIdigest\fR,
+\fIntlm\fR,
+\fInegotiate\fR\&. Note, that this list depends on the list of methods supported by the curl library\&.
+.TS
+tab(:);
+lt lt
+lt lt
+lt lt
+lt lt.
+T{
+
+T}:T{
+\fBftp://user:pass@server/path/to/media/dir\fR
+T}
+T{
+
+T}:T{
+\fBftp://user:pass@server/%2fhome/user/path/to/media/dir\fR
+T}
+T{
+
+T}:T{
+\fBhttp://user:pass@server/path\fR
+T}
+T{
+
+T}:T{
+\fBhttps://user:pass@server/path\fR\fI?proxy=foo&proxyuser=me&proxypass=pw\fR
+T}
+.TE
+.sp 1
+.RE
+.PP
 Disk volume (partition)
-Mandatory \fBdevice\fR parameter specifying the name of the block device to mount. The name of the optional \fIfilesystem\fR defaults to "auto".
-
-.B hd:/subdir?device=/dev/sda1\fI&filesystem=reiserfs
-.TP
+.RS 4
+Mandatory
+\fBdevice\fR
+parameter specifying the name of the block device to mount\&. The name of the optional
+\fIfilesystem\fR
+defaults to "auto"\&.
+.PP
+.RS 4
+\fBhd:/subdir?device=/dev/sda1\fR\fI&filesystem=reiserfs\fR
+.RE
+.RE
+.PP
 Local directory tree
-
-.B dir:/directory/name
-.TP
+.RS 4
+.PP
+.RS 4
+\fBdir:/directory/name\fR
+.RE
+.RE
+.PP
 Media in an ISO image (loopback mounted)
-Mandatory \fBiso\fR parameter specifying the name of the iso file. Optional \fIurl\fR parameter specifying the URL to the directory containing the iso file. Optional \fImnt\fR parameter specifying the preferred attach point for the source media url. Optional \fIfilesystem\fR name of the filesystem used in the iso file. Defaults to "auto".
-
-.B iso:/?iso=CD1.iso\fI&url=nfs://server/path/to/media
-.br
-.B iso:/?iso=CD1.iso\fI&url=hd:/?device=/dev/hda
-.br
-.B iso:/subdir?iso=DVD1.iso\fI&url=nfs://nfs-server/directory&mnt=/nfs/attach/point&filesystem=udf
-
-.TP
+.RS 4
+
+Mandatory
+\fBiso\fR
+parameter specifying the name of the iso file\&. Optional
+\fIurl\fR
+parameter specifying the URL to the directory containing the iso file\&. Optional
+\fImnt\fR
+parameter specifying the preferred attach point for the source media url\&. Optional
+\fIfilesystem\fR
+name of the filesystem used in the iso file\&. Defaults to "auto"\&.
+.TS
+tab(:);
+lt lt
+lt lt
+lt lt.
+T{
+
+T}:T{
+\fBiso:/?iso=CD1\&.iso\fR\fI&url=nfs://server/path/to/media\fR
+T}
+T{
+
+T}:T{
+\fBiso:/?iso=CD1\&.iso\fR\fI&url=hd:/?device=/dev/hda\fR
+T}
+T{
+
+T}:T{
+\fBiso:/subdir?iso=DVD1\&.iso\fR\fI&url=nfs://nfs\-server/directory&mnt=/nfs/attach/point&filesystem=udf\fR
+T}
+.TE
+.sp 1
+.RE
+.PP
 NFS exported directory tree
-To use NFSv4 either use schema \fItnfsv4://\fR or pass an optional parameter \fItype=nfs4\fR. Additional \fImountoptions\fR can be passed as comma separated list. Defaults to "ro".
-
-.B nfs://nfs-server/exported/path
-.br
-.B nfs://nfs-server/exported/path\fI?mountoptions=ro&type=nfs4
-.br
-.B nfs4://nfs-server/exported/path\fI?mountoptions=ro
-
-.TP
+.RS 4
+To use NFSv4 either use schema
+\fItnfsv4://\fR
+or pass an optional parameter
+\fItype=nfs4\fR\&. Additional
+\fImountoptions\fR
+can be passed as comma separated list\&. Defaults to "ro"\&.
+.TS
+tab(:);
+lt lt
+lt lt
+lt lt.
+T{
+
+T}:T{
+\fBnfs://nfs\-server/exported/path\fR
+T}
+T{
+
+T}:T{
+\fBnfs://nfs\-server/exported/path\fR\fI?mountoptions=ro&type=nfs4\fR
+T}
+T{
+
+T}:T{
+\fBnfs4://nfs\-server/exported/path\fR\fI?mountoptions=ro\fR
+T}
+.TE
+.sp 1
+.RE
+.PP
 CIFS/SMB directory tree
-There is no difference between cifs and smb scheme (any more). In both cases the \fIcifs\fR filesystem is used. Additional \fImountoptions\fR can be passed as comma separated list. Defaults to "ro,guest". Specify "noguest" to turn off "guest". This is necessary if Samba is configured to reject guest connections.
-
-Optional \fIworkgroup\fR or \fIdomain\fR parameter set the name of the workgroup. As alternative to passing \fIusername:password\fR in the URI authority the parameters \fIuser\fR and \fIpass\fR can be used.
-
-.B smb://servername/share/path/on/the/share
-.br
-.B cifs://usenr:passw@servername/share/path/on/the/share\fI?mountoptions=ro,noguest
-.br
-.B cifs://usern:passw@servername/share/path/on/the/share\fI?workgroup=mygroup
-.br
-.B cifs://servername/share/path/on/the/share\fI?user=usern&pass=passw
-.PP
-Apart from the above, repositories have several other properties which can be
-set using the commands described in this section below, or by manually
-editing the repository definition files (.repo files, see section FILES).
-
-.TP
-.B addrepo (ar) [options] <URI> <alias>
-.TP
-.B addrepo (ar) [options] <FILE.repo>
-
-Add a new repository specified by URI and assign specified alias to it or specify URI to a .repo file.
-
-Newly added repositories have auto-refresh disabled by default (except for repositories
-imported from a .repo, having the auto-refresh enabled). To enable auto-refresh, use the
-\fB\-\-refresh\fR option of the \fBmodifyrepo\fR command.
-
-Also, this command does not automatically refresh the newly added repositories.
-The repositories will get refreshed when used for the first time, or you can use
-the \fBrefresh\fR command after finishing your modifications with \fB*repo\fR commands.
-See also METADATA REFRESH POLICY section for more details.
-
-.TP
-\fI\-r, \-\-repo\fR <file.repo>
-Read URI and alias from specified .repo file
-.TP
-\fI\-t, \-\-type\fR <type>
-Type of repository (yast2, rpm-md, or plaindir). There are several aliases
-defined for these types:
-\fByast2\fR - susetags, yast, YaST, YaST2, YAST;
-\fBrpm-md\fR - repomd, rpmmd, yum, YUM;
-\fBplaindir\fR - Plaindir.
-.TP
-\fI\-d, \-\-disable\fR
-Add the repository as disabled. Repositories are added as enabled by default.
-.TP
-\fI\-c, \-\-check\fR
-Probe given URI.
-.TP
-\fI\-C, \-\-nocheck\fR
-Don't probe URI, probe later during refresh.
-.TP
-\fI\-n, \-\-name\fR
-Specify descriptive name for the repository.
-.TP
-\fI\-k, \-\-keep\-packages\fR
-Enable RPM files caching for the repository.
-.TP
-\fI\-K, \-\-no-keep-packages\fR
-Disable RPM files caching.
-.TP
-.I \-f, \-\-refresh
-Enable autorefresh of the repository. The autorefresh is disabled by default when adding
-new repositories.
-.TP
+.RS 4
+There is no difference between cifs and smb scheme (any more)\&. In both cases the
+\fIcifs\fR
+filesystem is used\&. Additional
+\fImountoptions\fR
+can be passed as comma separated list\&. Defaults to "ro,guest"\&. Specify "noguest" to turn off "guest"\&. This is necessary if Samba is configured to reject guest connections\&.
+
+Optional
+\fIworkgroup\fR
+or
+\fIdomain\fR
+parameter set the name of the workgroup\&. As alternative to passing
+\fIusername:password\fR
+in the URI authority the parameters
+\fIuser\fR
+and
+\fIpass\fR
+can be used\&.
+.TS
+tab(:);
+lt lt
+lt lt
+lt lt
+lt lt.
+T{
+
+T}:T{
+\fBsmb://servername/share/path/on/the/share\fR
+T}
+T{
+
+T}:T{
+\fBcifs://usenr:passw@servername/share/path/on/the/share\fR\fI?mountoptions=ro,noguest\fR
+T}
+T{
+
+T}:T{
+\fBcifs://usern:passw@servername/share/path/on/the/share\fR\fI?workgroup=mygroup\fR
+T}
+T{
+
+T}:T{
+\fBcifs://servername/share/path/on/the/share\fR\fI?user=usern&pass=passw\fR
+T}
+.TE
+.sp 1
+.RE
+.RE
+.SS ""
+.PP
+\fBaddrepo\fR (\fBar\fR) [\fIoptions\fR] \fIURI\fR \fIalias\fR
+.RS 4
+.RE
+.PP
+\fBaddrepo\fR (\fBar\fR) [\fIoptions\fR] \fIFILE\fR\fB\&.repo\fR
+.RS 4
+Add a new repository specified by URI and assign specified alias to it or specify URI to a \&.repo file\&.
+
+Newly added repositories have auto\-refresh disabled by default (except for repositories imported from a \&.repo, having the auto\-refresh enabled)\&. To enable auto\-refresh, use the
+\fB\-\-refresh\fR
+option of the
+\fBmodifyrepo\fR
+command\&.
+
+Also, this command does not automatically refresh the newly added repositories\&. The repositories will get refreshed when used for the first time, or you can use the
+\fBrefresh\fR
+command after finishing your modifications with
+\fB*repo\fR
+commands\&. See also
+\fBMETADATA REFRESH POLICY\fR
+section for more details\&.
+.PP
+\fB\-r\fR, \fB\-\-repo\fR \fIfile\fR\fB\&.repo\fR
+.RS 4
+Read URI and alias from specified \&.repo file
+.RE
+.PP
+\fB\-t\fR, \fB\-\-type\fR \fItype\fR
+.RS 4
+Type of repository (yast2, rpm\-md, or plaindir) in case the autodetection fails\&. There are several aliases defined for these types:
+.TS
+tab(:);
+lt lt
+lt lt
+lt lt.
+T{
+\fByast2\fR
+T}:T{
+susetags, yast, YaST, YaST2, YAST
+T}
+T{
+\fBrpm\-md\fR
+T}:T{
+repomd, rpmmd, yum, YUM
+T}
+T{
+\fBplaindir\fR
+T}:T{
+Plaindir
+T}
+.TE
+.sp 1
+.RE
+.PP
+\fB\-d\fR, \fB\-\-disable\fR
+.RS 4
+Add the repository as disabled\&. Repositories are added as enabled by default\&.
+.RE
+.PP
+\fB\-c\fR, \fB\-\-check\fR
+.RS 4
+Probe given URI\&.
+.RE
+.PP
+\fB\-C\fR, \fB\-\-nocheck\fR
+.RS 4
+Don\(cqt probe URI, probe later during refresh\&.
+.RE
+.PP
+\fB\-n\fR, \fB\-\-name\fR
+.RS 4
+Specify descriptive name for the repository\&.
+.RE
+.PP
+\fB\-k\fR, \fB\-\-keep\-packages\fR
+.RS 4
+Enable RPM files caching for the repository\&.
+.RE
+.PP
+\fB\-K\fR, \fB\-\-no\-keep\-packages\fR
+.RS 4
+Disable RPM files caching\&.
+.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\&.
+.RE
+.PP
 Examples:
-
-Add an HTTP repository, probe it, name it 'Packman 11.1 repo', and use 'packman' as alias:
-.br
-.B $ zypper ar -c -n 'Packman 11.1 repo' http://packman.iu-bremen.de/suse/11.1 packman
-
-Add repositories from a repo file:
-.br
-.B $ zypper ar http://download.opensuse.org/repositories/zypp:/svn/openSUSE_Factory/zypp:svn.repo
-.br
-.B $ zypper ar myreposbackup.repo
-
-.TP
-.B removerepo (rr) [options] <alias|name|#|URI> ...
-Delete repositories specified by aliases, names, numbers or URIs.
-.TP
-.I --loose-auth
+.RS 4
+.PP
+$ \fBzypper ar \-c \-n \*(AqPackman 11\&.1 repo\*(Aq \fR\fBhttp://packman\&.iu\-bremen\&.de/suse/11\&.1\fR\fB packman\fR
+.RS 4
+Add a HTTP repository, probe it, name it
+\fIPackman 11\&.1 repo\fR, and use
+\fIpackman\fR
+as alias\&.
+.RE
+.PP
+$ \fBzypper ar \fR\fBhttp://download\&.opensuse\&.org/repositories/zypp:/svn/openSUSE_Factory/zypp:svn\&.repo\fR
+.RS 4
+.RE
+.PP
+$ \fBzypper ar myreposbackup\&.repo\fR
+.RS 4
+Add repositories from a \&.repo file\&.
+.RE
+.RE
+.RE
+.PP
+\fBremoverepo\fR (\fBrr\fR) [\fIoptions\fR] \fIalias\fR|\fIname\fR|\fI#\fR|\fIURI\fR\&...
+.RS 4
+Delete repositories specified by aliases, names, numbers or URIs\&.
+.PP
+\fB\-\-loose\-auth\fR
+.RS 4
 Ignore user authentication data in the URI
-.TP
-.I --loose-query
+.RE
+.PP
+\fB\-\-loose\-query\fR
+.RS 4
 Ignore query string in the URI
+.RE
+.RE
+.PP
+\fBrepos\fR (\fBlr\fR) [\fIoptions\fR] [\fIrepo\fR]\&...
+.RS 4
+List all defined repositories or show detailed information about those specified as arguments
 
-.TP
-.B repos (lr) [options] [repo] ...
-List all defined repositories or show detailed information about those
-specified as arguments
-.IP
 The following data can be printed for each repository found on the sytem:
-# (repository number), Alias (shorthand for Name), Name, Enabled (whether
-the repository is enabled), Refresh (whether auto-refresh is enabled for
-the repository), Priority, Type (repository meta-data type: rpm-md, yast2,
-plaindir). Which of the data is shown is determined by command line
-options listed below and the main.repoListColumns setting from zypper.conf.
-By default, #, Alias, Name, Enabled, and Refresh is shown.
-
-Repository number is a unique identifier of the repository in current
-set of repositories. If you add, remove or change a repository, the numbers may
-change. Keep that in mind when using the numbers with the repository handling
-commands. On the other hand, using the alias instead of the number is always
-safe.
-
-To show detailed information about specific repositories, specify them
-as arguments, either by alias, name, number from simple \fBzypper lr\fR, or by
-URI; e.g. fB \fBzypper lr factory\fR, or \fBzypper lr 2\fR.
-
-.TP
-.I \-e, \-\-export <FILE.repo|->
-This option causes zypper to write repository definition of all defined
-repositories into a single file in repo file format.
-If '\-' is specified instead of a file name,
-the repositories will be written to the standard output.
-.TP
-.I \-a, \-\-alias
-Add alias column to the output.
-.TP
-.I \-n, \-\-name
-Add name column to the output.
-.TP
-.I \-u, \-\-uri
-Add base URI column to the output.
-.TP
-.I \-p, \-\-priority
-Add repository priority column to the output.
-.TP
-.I \-r, \-\-refresh
-Add the autorefresh column to the output.
-.TP
-.I \-d, \-\-details
-Show more information like URI, priority, type, etc.
-.TP
-.I \-E, \-\-show\-enabled\-only
-Show enabled repositories only.
-.TP
-.I \-U, \-\-sort\-by\-uri
-Add base URI column and sort the list it.
-.TP
-.I \-P, \-\-sort\-by\-priority
-Add repository priority column and sort the list by it.
-.TP
-.I \-A, \-\-sort\-by\-alias
-Sort the list by alias.
-.TP
-.I \-N, \-\-sort\-by\-name
-Sort the list by name.
-.TP
+\fI#\fR
+(repository number),
+\fIAlias\fR
+(unique identifier),
+\fIName\fR,
+\fIEnabled\fR
+(whether the repository is enabled),
+\fIRefresh\fR
+(whether auto\-refresh is enabled for the repository),
+\fIPriority\fR,
+\fIType\fR
+(repository meta\-data type: rpm\-md, yast2, plaindir)\&. Which of the data is shown is determined by command line options listed below and the main\&.repoListColumns setting from zypper\&.conf\&. By default, #, Alias, Name, Enabled, and Refresh is shown\&.
+
+Repository number is a unique identifier of the repository in current set of repositories\&. If you add, remove or change a repository, the numbers may change\&. Keep that in mind when using the numbers with the repository handling commands\&. On the other hand, using the alias instead of the number is always safe\&.
+
+To show detailed information about specific repositories, specify them as arguments, either by alias, name, number from simple
+\fBzypper lr\fR, or by URI; e\&.g\&. fB
+\fBzypper lr factory\fR, or
+\fBzypper lr 2\fR\&.
+.PP
+\fB\-e\fR, \fB\-\-export\fR \fIFILE\fR\fB\&.repo\fR|\fI\-\fR
+.RS 4
+This option causes zypper to write repository definition of all defined repositories into a single file in repo file format\&. If
+\fB\-\fR
+is specified instead of a file name, the repositories will be written to the standard output\&.
+.RE
+.PP
+\fB\-a\fR, \fB\-\-alias\fR
+.RS 4
+Add alias column to the output\&.
+.RE
+.PP
+\fB\-n\fR, \fB\-\-name\fR
+.RS 4
+Add name column to the output\&.
+.RE
+.PP
+\fB\-u\fR, \fB\-\-uri\fR
+.RS 4
+Add base URI column to the output\&.
+.RE
+.PP
+\fB\-p\fR, \fB\-\-priority\fR
+.RS 4
+Add repository priority column to the output\&.
+.RE
+.PP
+\fB\-r\fR, \fB\-\-refresh\fR
+.RS 4
+Add the autorefresh column to the output\&.
+.RE
+.PP
+\fB\-d\fR, \fB\-\-details\fR
+.RS 4
+Show more information like URI, priority, type, etc\&.
+.RE
+.PP
+\fB\-E\fR, \fB\-\-show\-enabled\-only\fR
+.RS 4
+Show enabled repositories only\&.
+.RE
+.PP
+\fB\-U\fR, \fB\-\-sort\-by\-uri\fR
+.RS 4
+Add base URI column and sort the list it\&.
+.RE
+.PP
+\fB\-P\fR, \fB\-\-sort\-by\-priority\fR
+.RS 4
+Add repository priority column and sort the list by it\&.
+.RE
+.PP
+\fB\-A\fR, \fB\-\-sort\-by\-alias\fR
+.RS 4
+Sort the list by alias\&.
+.RE
+.PP
+\fB\-N\fR, \fB\-\-sort\-by\-name\fR
+.RS 4
+Sort the list by name\&.
+.RE
+.PP
 Examples:
-
+.RS 4
+.PP
+$ \fBzypper repos \-e myreposbackup\&.repo\fR
+.RS 4
 Backup your repository setup:
-.br
-.B $ zypper repos -e myreposbackup.repo
-
+.RE
+.PP
+$ \fBzypper lr \-pu\fR
+.RS 4
 List repositories with their URIs and priorities:
-.br
-.B $ zypper lr -pu
-
-.TP
-.B renamerepo (nr) <alias|name|#|URI> <new-alias>
-Assign new alias to the repository specified by alias, name, number, or URI.
-.TP
-Example:
-
-Rename repository number 8 to 'myrepo' (useful if the repo has some
-dreadful alias which is not usable on the command line).
-.br
-.B $ zypper nr 8 myrepo
-
-.TP
-.B modifyrepo (mr) <options> <alias|name|#|URI> ...
-.TP
-.B modifyrepo (mr) <options> <--all|--remote|--local|--medium-type>
-Modify properties of repositories specified by alias, name, number, or URI or
-one of the aggregate options.
-.TP
-\fI\-e, \-\-enable\fR
-Enable the repository.
-.TP
-\fI\-d, \-\-disable\fR
-Disable the repository.
-.TP
-\fI\-r, \-\-refresh\fR
-Enable auto-refresh for the repository.
-.TP
-\fI\-R, \-\-no\-refresh\fR
-Disable auto-refresh for the repository.
-.TP
-.I \-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.
-.TP
-.I \-n, \-\-name
-Set a descriptive name for the repository.
-.TP
-.I \-k, \-\-keep\-packages
-Enable RPM files caching.
-.TP
-.I \-K, \-\-no\-keep\-packages
-Disable RPM files caching.
-.TP
-.I \-a, \-\-all
-Apply changes to all repositories.
-.TP
-.I \-l, \-\-local
-Apply changes to all local repositories.
-.TP
-.I \-t, \-\-remote
-Apply changes to all remote repositories (http/https/ftp).
-.TP
-.I \-m, \-\-medium\-type <type>
-Apply changes to repositories of specified type. The type corresponds to the
-repository URI scheme identifier like http, dvd, etc. You can find complete
-list of valid types at http://en.opensuse.org/openSUSE:Libzypp_URIs.
-.TP
+.RE
+.RE
+.RE
+.PP
+\fBrenamerepo\fR (\fBnr\fR) \fIalias\fR|\fIname\fR|\fI#\fR|\fIURI\fR \fInew\-alias\fR
+.RS 4
+Assign new alias to the repository specified by alias, name, number, or URI\&.
+.PP
 Examples:
+.RS 4
+.PP
+$ \fBzypper nr 8 myrepo\fR
+.RS 4
+Rename repository
+\fInumber 8\fR
+to
+\fBmyrepo\fR
+(useful if the repo has some dreadful alias which is not usable on the command line)\&.
+.RE
+.RE
+.RE
+.PP
+\fBmodifyrepo\fR (\fBmr\fR) \fIoptions\fR \fIalias\fR|\fIname\fR|\fI#\fR|\fIURI\fR\&...
+.RS 4
+.RE
+.PP
+\fBmodifyrepo\fR (\fBmr\fR) \fIoptions\fR \fB\-\-all\fR|\fB\-\-remote\fR|\fB\-\-local\fR|\fB\-\-medium\-type\fR
+.RS 4
+Modify properties of repositories specified by alias, name, number, or URI or one of the aggregate options\&.
+.PP
+\fB\-e\fR, \fB\-\-enable\fR
+.RS 4
+Enable the repository\&.
+.RE
+.PP
+\fB\-d\fR, \fB\-\-disable\fR
+.RS 4
+Disable the repository\&.
+.RE
+.PP
+\fB\-r\fR, \fB\-\-refresh\fR
+.RS 4
+Enable auto\-refresh for the repository\&.
+.RE
+.PP
+\fB\-R\fR, \fB\-\-no\-refresh\fR
+.RS 4
+Disable auto\-refresh for the repository\&.
+.RE
+.PP
+\fB\-p\fR, \fB\-\-priority\fR \fIpositive\-integer\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\&.
+.RE
+.PP
+\fB\-n\fR, \fB\-\-name\fR
+.RS 4
+Set a descriptive name for the repository\&.
+.RE
+.PP
+\fB\-k\fR, \fB\-\-keep\-packages\fR
+.RS 4
+Enable RPM files caching\&.
+.RE
+.PP
+\fB\-K\fR, \fB\-\-no\-keep\-packages\fR
+.RS 4
+Disable RPM files caching\&.
+.RE
+.PP
+\fB\-a\fR, \fB\-\-all\fR
+.RS 4
+Apply changes to all repositories\&.
+.RE
+.PP
+\fB\-l\fR, \fB\-\-local\fR
+.RS 4
+Apply changes to all local repositories\&.
+.RE
+.PP
+\fB\-t\fR, \fB\-\-remote\fR
+.RS 4
+Apply changes to all remote repositories (http/https/ftp)\&.
+.RE
+.PP
+\fB\-m\fR, \fB\-\-medium\-type\fR \fItype\fR
+.RS 4
+Apply changes to repositories of specified type\&. The type corresponds to the repository URI scheme identifier like http, dvd, etc\&. You can find complete list of valid types at
+http://en\&.opensuse\&.org/openSUSE:Libzypp_URIs\&.
+.RE
+.PP
+Examples:
+.RS 4
+.PP
+$ \fBzypper mr \-kt\fR
+.RS 4
+Enable keeping of packages for all remote repositories\&.
+.RE
+.PP
+$ \fBzypper mr \-er updates\fR
+.RS 4
+Enable repository
+\fIupdates\fR
+and switch on autorefresh for the repo\&.
+.RE
+.PP
+$ \fBzypper mr \-da\fR
+.RS 4
+Disable all repositories\&.
+.RE
+.RE
+.RE
+.PP
+\fBrefresh\fR (\fBref\fR) [\fIalias\fR|\fIname\fR|\fI#\fR|\fIURI\fR]\&...
+.RS 4
+Refresh repositories specified by their alias, name, number, or URI\&. If no repositories are specified, all enabled repositories will be refreshed\&.
 
-Enable keeping of packages for all remote repositories:
-.br
-.B $ zypper mr -kt
-
-Enable repository 'updates' and switch on autorefresh for the repo:
-.br
-.B $ zypper mr -er updates
-
-Disable all repositories:
-.br
-.B $ zypper mr -da
-
-.TP
-.B refresh (ref) [alias|name|#|URI] ...
-Refresh repositories specified by their alias, name, number, or URI. If no repositories are specified, all enabled repositories will be refreshed.
-.IP
-See also METADATA REFRESH POLICY section for more details.
-.TP
-.I \-f, \-\-force
-Force a complete refresh of specified repositories. This option will cause both the download of raw metadata and parsing of the metadata to be forced even if everything indicates a refresh is not needed.
-.TP
-.I \-b, \-\-force\-build
-Force only reparsing of cached metadata and rebuilding of the database. Raw metadata download will not be forced.
-.TP
-.I \-d, \-\-force\-download
-Force only download of current copy of repository metadata. Parsing and rebuild of the database will not be forced.
-.TP
-.I \-B, \-\-build\-only
-Only parse the metadata and build the database, don't download raw metadata into the cache. This will enable you to repair damaged database from cached data without accessing network at all.
-.TP
-.I \-D, \-\-download\-only
-Only download the raw metadata, don't parse it or build the database.
-.TP
-.I \-s, \-\-services
-Refresh also services before refreshing repositories.
-
-.TP
-.B clean (cc) [options] [alias|name|#|URI] ...
-Clean the local caches for all known or specified repositories. By default,
- only caches of downloaded packages are cleaned.
-.TP
-.I \-m, \-\-metadata
-Clean repository metadata cache instead of package cache.
-.TP
-.I \-M, \-\-raw\-metadata
-Clean repository raw metadata cache instead of package cache.
-.TP
-.I \-a, \-\-all
-Clean both repository metadata and package caches.
-
-
-.SS Service Management
-
-The \fBservices\fR, \fBaddservice\fR, \fBremoveservice\fR, \fBmodifyservice\fR,
-and \fBrefresh-services\fR commands serve for manipulating services. A service
-is specified by its URI and needs to have a unique alias defined (among
-both services and repositories).
-
-Standalone repositories (not belonging to any service) are treated like
-services, too. The \fBls\fR command will list them, \fBms\fR command will modify
-them, etc. Repository specific options, like --keep-packages
-are not available here, though. You can use repository handling commands
-to manipulate them.
-
-
-.TP
-.B addservice (as) [options] <URI> <alias>
-Adds a service specified by \fBURI\fR to the system. The \fBalias\fR must be
-unique and serves to identify the service.
-
-Newly added services are not refereshed automatically. Use the
-\fBrefresh-services\fR command to refresh them. Zypper does not access the
-service URI when adding the service, so the type of the services is unknown
-until it is refreshed.
+See also
+\fBMETADATA REFRESH POLICY\fR
+section for more details\&.
+.PP
+\fB\-f\fR, \fB\-\-force\fR
+.RS 4
+Force a complete refresh of specified repositories\&. This option will cause both the download of raw metadata and parsing of the metadata to be forced even if everything indicates a refresh is not needed\&.
+.RE
+.PP
+\fB\-b\fR, \fB\-\-force\-build\fR
+.RS 4
+Force only reparsing of cached metadata and rebuilding of the database\&. Raw metadata download will not be forced\&.
+.RE
+.PP
+\fB\-d\fR, \fB\-\-force\-download\fR
+.RS 4
+Force only download of current copy of repository metadata\&. Parsing and rebuild of the database will not be forced\&.
+.RE
+.PP
+\fB\-B\fR, \fB\-\-build\-only\fR
+.RS 4
+Only parse the metadata and build the database, don\(cqt download raw metadata into the cache\&. This will enable you to repair damaged database from cached data without accessing network at all\&.
+.RE
+.PP
+\fB\-D\fR, \fB\-\-download\-only\fR
+.RS 4
+Only download the raw metadata, don\(cqt parse it or build the database\&.
+.RE
+.PP
+\fB\-s\fR, \fB\-\-services\fR
+.RS 4
+Refresh also services before refreshing repositories\&.
+.RE
+.RE
+.PP
+\fBclean\fR (\fBcc\fR) [\fIoptions\fR] [\fIalias\fR|\fIname\fR|\fI#\fR|\fIURI\fR]\&...
+.RS 4
+Clean the local caches for all known or specified repositories\&. By default, only caches of downloaded packages are cleaned\&.
+.PP
+\fB\-m\fR, \fB\-\-metadata\fR
+.RS 4
+Clean repository metadata cache instead of package cache\&.
+.RE
+.PP
+\fB\-M\fR, \fB\-\-raw\-metadata\fR
+.RS 4
+Clean repository raw metadata cache instead of package cache\&.
+.RE
+.PP
+\fB\-a\fR, \fB\-\-all\fR
+.RS 4
+Clean both repository metadata and package caches\&.
+.RE
+.RE
+.SS "Service Management"
+.sp
+The \fBservices\fR, \fBaddservice\fR, \fBremoveservice\fR, \fBmodifyservice\fR, and \fBrefresh\-services\fR commands serve for manipulating services\&. A service is specified by its URI and needs to have a unique alias defined (among both services and repositories)\&.
+.sp
+Standalone repositories (not belonging to any service) are treated like services, too\&. The \fBls\fR command will list them, \fBms\fR command will modify them, etc\&. Repository specific options, like \fB\-\-keep\-packages\fR are not available here, though\&. You can use repository handling commands to manipulate them\&.
+.PP
+\fBaddservice\fR (\fBas\fR) [\fIoptions\fR] \fIURI\fR \fIalias\fR
+.RS 4
+Adds a service specified by
+\fBURI\fR
+to the system\&. The
+\fIalias\fR
+must be unique and serves to identify the service\&.
+
+Newly added services are not refreshed automatically\&. Use the
+\fBrefresh\-services\fR
+command to refresh them\&. Zypper does not access the service URI when adding the service, so the type of the services is unknown until it is refreshed\&.
 
 This command also allows to add also ordinary repositories when used with
---type option, where you specify the type of the repository. See the addrepo
-command for the list of supported repository types.
-
-.TP
-.I \-t, \-\-type <TYPE>
-Type of the service (possible values: ris). There are several aliases
-defined for this type:
-\fBris\fR - RIS, nu, NU
-.TP
-.I \-d, \-\-disable
-Add the service as disabled.
-.TP
-.I \-n, \-\-name
-Specify descriptive name for the service.
-
-.TP
-.B removeservice (rs) [options] <alias|name|#|URI> ...
-
-Remove specified repository index service from the sytem.
-
-Removing an RIS service will result in removing of all of its repositories.
-
-.TP
-.I \-\-loose\-auth
-Ignore user authentication data in the URI.
-.TP
-.I \-\-loose-query
-Ignore query string in the URI.
-
-.TP
-.B modifyservice (ms) <options> <alias|name|#|URI>
-.B modifyservice (ms) <options> <--all|--remote|--local|--medium-type>
-Modify properties of specified services.
-
-.TP
+\fB\-\-type\fR
+option, where you specify the type of the repository\&. See the addrepo command for the list of supported repository types\&.
+.PP
+\fB\-t\fR, \fB\-\-type\fR \fItype\fR
+.RS 4
+Type of the service (possible values:
+\fBris\fR) in case the autodetection fails\&. There are several aliases defined for this type:
+.TS
+tab(:);
+lt lt.
+T{
+\fBris\fR
+T}:T{
+RIS, nu, NU
+T}
+.TE
+.sp 1
+.RE
+.PP
+\fB\-d\fR, \fB\-\-disable\fR
+.RS 4
+Add the service as disabled\&.
+.RE
+.PP
+\fB\-n\fR, \fB\-\-name\fR
+.RS 4
+Specify descriptive name for the service\&.
+.RE
+.RE
+.PP
+\fBremoveservice\fR (\fBrs\fR) [\fIoptions\fR] \fIalias\fR|\fIname\fR|\fI#\fR|\fIURI\fR\&...
+.RS 4
+Remove specified service from the system\&. Removing a service will also remove of all of its repositories\&.
+.PP
+\fB\-\-loose\-auth\fR
+.RS 4
+Ignore user authentication data in the URI\&.
+.RE
+.PP
+\fB\-\-loose\-query\fR
+.RS 4
+Ignore query string in the URI\&.
+.RE
+.RE
+.PP
+\fBmodifyservice\fR (\fBms\fR) \fIoptions\fR \fIalias\fR|\fIname\fR|\fI#\fR|\fIURI\fR
+.RS 4
+.RE
+.PP
+\fBmodifyservice\fR (\fBms\fR) \fIoptions\fR \fB\-\-all\fR|\fB\-\-remote\fR|\fB\-\-local\fR|\fB\-\-medium\-type\fR
+.RS 4
+Modify properties of specified services\&.
+.PP
 Common Options
-These options are common to all types of services and repositories.
-.TP
-.I \-d, \-\-disable
-Disable the service (but don't remove it).
-.TP
-.I \-e, \-\-enable
-Enable a disabled service.
-.TP
-.I \-r, \-\-refresh
-Enable auto-refresh of the service.
-.TP
-.I \-R, \-\-no\-refresh
-Disable auto-refresh of the service.
-.TP
-.I \-n, \-\-name
-Set a descriptive name for the service.
-.TP
-.I \-a, \-\-all
-Apply changes to all services.
-.TP
-.I \-l, \-\-local
-Apply changes to all local services.
-.TP
-.I \-t, \-\-remote
-Apply changes to all remote services.
-.TP
-.I \-m, \-\-medium\-type <type>
-Apply changes to services of specified type.
-
-.TP
+.RS 4
+These options are common to all types of services and repositories\&.
+.RE
+.PP
+\fB\-d\fR, \fB\-\-disable\fR
+.RS 4
+Disable the service (but don\(cqt remove it)\&.
+.RE
+.PP
+\fB\-e\fR, \fB\-\-enable\fR
+.RS 4
+Enable a disabled service\&.
+.RE
+.PP
+\fB\-r\fR, \fB\-\-refresh\fR
+.RS 4
+Enable auto\-refresh of the service\&.
+.RE
+.PP
+\fB\-R\fR, \fB\-\-no\-refresh\fR
+.RS 4
+Disable auto\-refresh of the service\&.
+.RE
+.PP
+\fB\-n\fR, \fB\-\-name\fR
+.RS 4
+Set a descriptive name for the service\&.
+.RE
+.PP
+\fB\-a\fR, \fB\-\-all\fR
+.RS 4
+Apply changes to all services\&.
+.RE
+.PP
+\fB\-l\fR, \fB\-\-local\fR
+.RS 4
+Apply changes to all local services\&.
+.RE
+.PP
+\fB\-t\fR, \fB\-\-remote\fR
+.RS 4
+Apply changes to all remote services\&.
+.RE
+.PP
+\fB\-m\fR, \fB\-\-medium\-type\fR \fItype\fR
+.RS 4
+Apply changes to services of specified type\&.
+.RE
+.PP
 RIS Service Specific Options
-These options are ignored by services other than Repository Index Services.
-
-.TP
-.I \-i, --ar-to-enable <alias>
-Schedule an RIS service repository to be enabled at next service refresh.
-.TP
-.I \-I, --ar-to-disable <alias>
-Schedule an RIS service repository to be disabled at next service refresh.
-.TP
-.I \-j, --rr-to-enable <alias>
-Remove a RIS service repository to enable.
-.TP
-.I \-J, --rr-to-disable <alias>
-Remove a RIS service repository to disable.
-.TP
-.I \-k, --cl-to-enable
-Clear the list of RIS repositories to enable.
-.TP
-.I \-K, --cl-to-disable
-Clear the list of RIS repositories to disable.
-
-
-.TP
-.B services (ls) [options]
-List services defined on the system.
-
-.TP
-.I \-u, \-\-uri
-Show also base URI of repositories.
-.TP
-.I \-p, \-\-priority
-Show also repository priority.
-.TP
-.I \-d, \-\-details
-Show more information like URI, priority, type.
-.TP
-.I \-r, \-\-with\-repos
-Show also repositories belonging to the services.
-.TP
-.I \-P, \-\-sort\-by\-priority
-Sort the list by repository priority.
-.TP
-.I \-E, \-\-show\-enabled\-only
-Show enabled services only. If used together with \fI\-\-with\-repos\fR a disabled
-service owning (manually) enabled repositories is shown as well.
-.TP
-.I \-U, \-\-sort-by-uri
-Sort the list by URI.
-.TP
-.I \-N, \-\-sort\-by\-name
-Sort the list by name.
-
-.TP
-.B refresh-services (refs) [options] <alias|name|#|URI> ...
-Refreshing a service means executing the service's special task.
-
-RIS services add, remove, or modify repositories on your system based on
-current content of the repository index. A differing enabled/disabled
-state caused by manually calling \fBmodify-repo\fR on a service repository
-however will not be reverted unless the \fI\-\-restore\-status\fR option is used,
-or the repository index explicitly requests the change.
-
-Services only manage defined repositories, they do not refresh them. To refresh also
-repositories, use \fI\-\-with\-repos\fR option or the \fBrefresh\fR command.
-
-.TP
-.I \-r, \-\-with\-repos
-Refresh also the service repositories.
-.TP
-.I \-R, \-\-restore\-status
-Also restore service repositories enabled/disabled state to the repository index default.
-Useful after you manually changed some service repositories enabled state.
-
-
-.SS Package Locks Management
-Package locks serve the purpose of preventing changes to the set of installed
-packages on the system. The locks are stored in form of a \fIquery\fR in
-/etc/zypp/locks file (see also locks(5)).
-Packages matching this query are then forbidden to change their installed
-status; an installed package can't be removed, not installed package can't be installed.
-When requesting to install or remove such locked package, you will get a dependency problem
-dialog.
-
-.TP
-.B locks (ll)
-List currently active package locks.
-
-.TP
-.B addlock (al) [options] <package-name> ...
-Add a package lock. Specify packages to lock by exact name or by a glob pattern using '*' and '?'
-wildcard characters.
-
-.TP
-.I \-r, \-\-repo <alias|name|#|URI>
-Restrict the lock to the specified repository.
-.TP
-.I \-t, \-\-type <type>
-Lock only packages of specified type (default: package).
-See section \fBPackage Types\fR for list
-of available package types.
-
-.TP
-.B removelock (rl) [options] <lock-number|package-name> ...
-Remove specified package lock. Specify the lock to remove by its number obtained with \fBzypper locks\fR
-or by the package name.
-
-.TP
-.I \-r, \-\-repo <alias|name|#|URI>
-Restrict the lock to the specified repository.
-.TP
-.I \-t, \-\-type <type>
-Restrict the lock to packages of specified type (default: package).
-See section \fBPackage Types\fR for list
-of available package types.
-
-
-.TP
-.B cleanlocks (cl)
-Remove unused locks.
-
-This command looks for locks that do not currently (with regard to
-repositories used) lock any package and for each such lock it asks user
-whether to remove it.
-
-
-.SS Other Commands
-
-.TP
-.B versioncmp (vcmp) <version1> <version2>
-Compare the versions supplied as arguments and tell whether version1 is older
-or newer than version2 or the two version strings match.
-
-The default output is in human-friendly form. If \fB--terse\fR global option
-is used, the result is an integer number, negative/positive if version1 is
-older/newer than version2, zero if they match.
-
-.TP
-.I \-m, \-\-match
-Takes missing release number as any release. For example
-.br
-$ zypper vcmp -m 0.15.3 0.15.3-2
-.br
-0.15.3 matches 0.15.3-2
-.br
-$ zypper vcmp 0.15.3 0.15.3-2
-.br
-0.15.3 is older than 0.15.3-2
-
-.TP
-.B targetos (tos)
-Shows the ID string of the target operating system. The string has a form of
-\fBdistroname-arch\fR. The string is determined by libzypp, the \fBdistroname\fR
-is read from <current-rootdir>/etc/products.d/baseproduct and the architecture
-is determined from uname and CPU flags.
-
-.TP
-.B licenses
-Prints a report about \fBlicenses\fR and \fBEULA\fRs of installed packages
-to standard output.
-
-First, a list of all packages and their licenses and/or EULAs is shown.
-This is followed by a summary, including the total number of installed
-packages, the number of installed
-packages with EULAs that required a confirmation from the user. Since the
-EULAs are not stored on the system and can only be read from repository
-metadata, the summary includes also the number of installed packages
-that have their counterpart in repositories. The report ends with a list
-of all licenses uses by the installed packages.
-
-This command can be useful for companies redistributiong a custom
-distribution (like appliances) to figure out what licenses they are bound by.
-
-.TP
-.B download
-Download rpms specified on the commandline to a local directory.
-
-Per default packages are downloaded to the libzypp package cache
-(/var/cache/zypp/packages), but this can be changed by using the
-global \fI--pkg-cache-dir\fR option.
-
-In XML output a \fB<download-result>\fR node is written for each
-package zypper tried to downlad. Upon success the local path is
-is found in \fBdownload-result/localpath@path\fR.
-
-.TP
-.I \-\-all-matches
-Download all versions matching the commandline arguments. Otherwise only the best version of
-each matching package is downloaded.
-
-.TP
-.I \-\-dry-run
-Don't download any package, just report what would be done.
-
-.TP
-.B source-download
-Download source rpms for all installed packages to a local directory.
-
-.TP
-.I \-d, \-\-directory <dir>
-Download all source rpms to this directory. Default is \fB/var/cache/zypper/source-download\fR.
-
-.TP
-.I \-\-delete
-Delete extraneous source rpms in the local directory. This is the default.
-
-.TP
-.I \-\-no-delete
-Do not delete extraneous source rpms.
-
-.TP
-.I \-\-status
-Don't download any source rpms, but show which source rpms are missing or extraneous.
-
-.TP
-.B ps
-After each upgrade or removal of packages, there may be running processes
-on the system which continue to use meanwhile deleted files. \fBzypper ps\fR
-lists all processes using deleted files, together with the corresponding files,
-and a service name hint, in case it's a known service. This gives a hint which
-services may need to be restarted after an update. Usually programs which continue
-to use deleted shared libraries.
-The list contains the following information:
-
-* PID\ \ \ \ \ \ ID of the process
-.br
-* PPID\ \ \ \ \ ID of the parent process
-.br
-* UID\ \ \ \ \ \ ID of the user running the process
-.br
-* Login\ \ \ \ login name of the user running the process
-.br
-* Command\ \ command used to execute the process
-.br
-* Service\ \ guessed name of the service. If an init script exists for this
- \ \ \ \ \ \ \ \ \ \ service, you can do "rcservicename restart" to restart it.
-.br
-* Files\ \ \ \ the list of the deleted files
+.RS 4
+These options are ignored by services other than Repository Index Services\&.
+.RE
+.PP
+\fB\-i\fR, \fB\-\-ar\-to\-enable\fR \fIalias\fR
+.RS 4
+Schedule an RIS service repository to be enabled at next service refresh\&.
+.RE
+.PP
+\fB\-I\fR, \fB\-\-ar\-to\-disable\fR \fIalias\fR
+.RS 4
+Schedule an RIS service repository to be disabled at next service refresh\&.
+.RE
+.PP
+\fB\-j\fR, \fB\-\-rr\-to\-enable\fR \fIalias\fR
+.RS 4
+Remove a RIS service repository to enable\&.
+.RE
+.PP
+\fB\-J\fR, \fB\-\-rr\-to\-disable\fR "alias\*(Aq
+.RS 4
+Remove a RIS service repository to disable\&.
+.RE
+.PP
+\fB\-k\fR, \fB\-\-cl\-to\-enable\fR
+.RS 4
+Clear the list of RIS repositories to enable\&.
+.RE
+.PP
+\fB\-K\fR, \fB\-\-cl\-to\-disable\fR
+.RS 4
+Clear the list of RIS repositories to disable\&.
+.RE
+.RE
+.PP
+\fBservices\fR (\fBls\fR) [\fIoptions\fR]
+.RS 4
+List services defined on the system\&.
+.PP
+\fB\-u\fR, \fB\-\-uri\fR
+.RS 4
+Show also base URI of repositories\&.
+.RE
+.PP
+\fB\-p\fR, \fB\-\-priority\fR
+.RS 4
+Show also repository priority\&.
+.RE
+.PP
+\fB\-d\fR, \fB\-\-details\fR
+.RS 4
+Show more information like URI, priority, type\&.
+.RE
+.PP
+\fB\-r\fR, \fB\-\-with\-repos\fR
+.RS 4
+Show also repositories belonging to the services\&.
+.RE
+.PP
+\fB\-P\fR, \fB\-\-sort\-by\-priority\fR
+.RS 4
+Sort the list by repository priority\&.
+.RE
+.PP
+\fB\-E\fR, \fB\-\-show\-enabled\-only\fR
+.RS 4
+Show enabled services only\&. If used together with
+\fB\-\-with\-repos\fR
+a disabled services owning (manually) enabled repositories are shown as well\&.
+.RE
+.PP
+\fB\-U\fR, \fB\-\-sort\-by\-uri\fR
+.RS 4
+Sort the list by URI\&.
+.RE
+.PP
+\fB\-N\fR, \fB\-\-sort\-by\-name\fR
+.RS 4
+Sort the list by name\&.
+.RE
+.RE
+.PP
+\fBrefresh\-services\fR (\fBrefs\fR) [\fIoptions\fR] \fIalias\fR|\fIname\fR|\fI#\fR|\fIURI\fR\&...
+.RS 4
+Refreshing a service means executing the service\(cqs special task\&.
+
+RIS services add, remove, or modify repositories on your system based on current content of the repository index\&. A differing enabled/disabled state caused by manually calling
+\fBmodify\-repo\fR
+on a service repository however will not be reverted unless the
+\fB\-\-restore\-status\fR
+option is used, or the repository index explicitly requests the change\&.
+
+Services only manage defined repositories, they do not refresh them\&. To refresh also repositories, use
+\fB\-\-with\-repos\fR
+option or the
+\fBrefresh\fR
+command\&.
+.PP
+\fB\-f\fR, \fB\-\-force\fR
+.RS 4
+Force a complete refresh of specified services\&. This option will cause both the download of raw metadata and parsing of the metadata to be forced even if everything indicates a refresh is not needed\&.
+.RE
+.PP
+\fB\-r\fR, \fB\-\-with\-repos\fR
+.RS 4
+Refresh also the service repositories\&.
+.RE
+.PP
+\fB\-R\fR, \fB\-\-restore\-status\fR
+.RS 4
+Also restore service repositories enabled/disabled state to the repository index default\&. Useful after you manually changed some service repositories enabled state\&.
+.RE
+.RE
+.SS "Package Locks Management"
+.sp
+Package locks serve the purpose of preventing changes to the set of installed packages on the system\&. The locks are stored in form of a \fIquery\fR in /etc/zypp/locks file (see also locks(5))\&. Packages matching this query are then forbidden to change their installed status; an installed package can\(cqt be removed, not installed package can\(cqt be installed\&. When requesting to install or remove such locked package, you will get a dependency problem dialog\&.
+.PP
+\fBlocks\fR (\fBll\fR)
+.RS 4
+List currently active package locks\&.
+.RE
+.PP
+\fBaddlock\fR (\fBal\fR) [\fIoptions\fR] \fIpackage\-name\fR\&...
+.RS 4
+Add a package lock\&. Specify packages to lock by exact name or by a glob pattern using
+\fB*\fR
+and
+\fI\fB?\fR\fR
+wildcard characters\&.
+.PP
+\fB\-r\fR, \fB\-\-repo\fR \fIalias\fR|\fIname\fR|\fI#\fR|\fIURI\fR
+.RS 4
+Restrict the lock to the specified repository\&.
+.RE
+.PP
+\fB\-t\fR, \fB\-\-type\fR \fItype\fR
+.RS 4
+Lock only packages of specified type (default: package)\&. See section
+\fBPackage Types\fR
+for list of available package types\&.
+.RE
+.RE
+.PP
+\fBremovelock\fR (\fBrl\fR) [\fIoptions\fR] \fIlock\-number\fR|\fIpackage\-name\fR\&...
+.RS 4
+Remove specified package lock\&. Specify the lock to remove by its number obtained with
+\fBzypper locks\fR
+or by the package name\&.
+.PP
+\fB\-r\fR, \fB\-\-repo\fR \fIalias\fR|\fIname\fR|\fI#\fR|\fIURI\fR
+.RS 4
+Restrict the lock to the specified repository\&.
+.RE
+.PP
+\fB\-t\fR, \fB\-\-type\fR \fItype\fR
+.RS 4
+Restrict the lock to packages of specified type (default: package)\&. See section
+\fBPackage Types\fR
+for list of available package types\&.
+.RE
+.RE
+.PP
+\fBcleanlocks\fR (\fBcl\fR)
+.RS 4
+Remove unused locks\&.
 
+This command looks for locks that do not currently (with regard to repositories used) lock any package and for each such lock it asks user whether to remove it\&.
+.RE
+.SS "Other Commands"
+.PP
+\fBversioncmp\fR (\fBvcmp\fR) \fIversion1\fR \fIversion2\fR
+.RS 4
+Compare the versions supplied as arguments and tell whether version1 is older or newer than version2 or the two version strings match\&.
 
-.SH "GLOBAL OPTIONS"
+The default output is in human\-friendly form\&. If
+\fB\-\-terse\fR
+global option is used, the result is an integer number, negative/positive if version1 is older/newer than version2, zero if they match\&.
+.PP
+\fB\-m\fR, \fB\-\-match\fR
+.RS 4
+Takes missing release number as any release\&.
+.PP
+For example:
+.RS 4
+.PP
+$ \fBzypper vcmp \-m 0\&.15\&.3 0\&.15\&.3\-2\fR
+.RS 4
+0\&.15\&.3
+\fImatches\fR
+0\&.15\&.3\-2
+.RE
+.PP
+$ \fBzypper vcmp 0\&.15\&.3 0\&.15\&.3\-2\fR
+.RS 4
+0\&.15\&.3
+\fIis older than\fR
+0\&.15\&.3\-2
+.RE
+.RE
+.RE
+.RE
+.PP
+\fBtargetos\fR (\fBtos\fR)
+.RS 4
+Shows the ID string of the target operating system\&. The string has a form of
+\fIdistroname\-architecture\fR\&. The string is determined by libzypp, the
+\fIdistroname\fR
+is read from (\fIcurrent\-rootdir\fR)\fB/etc/products\&.d/baseproduct\fR
+and the
+\fIarchitecture\fR
+is determined from
+\fBuname\fR
+and
+\fICPU flags\fR\&.
+.RE
+.PP
+\fBlicenses\fR
+.RS 4
+Prints a report about
+\fIlicenses\fR
+and \*(AqEULA\(cqs of installed packages to standard output\&.
 
-.TP
-.I \-h, \-\-help
-Help. If a \fBcommand\fR is specified together with --help option, command specific help is displayed.
-.TP
-.I \-V, \-\-version
-Print zypper version number and exit.
-.TP
-.I \-c, \-\-config <file>
-Use specified zypper config file instead of the default files.
-Other command line options specified together with --config and having
-their counterpart in the config file are still prefered.
-The order of preference with --config is as follows:
-
-* Command line options
-.br
-* --config <file>
-
-[ /etc/zypp/zypp.conf ] (system-wide defaults for all libzypp based applications)
-
-See also FILES section for more information.
-.TP
-.I \-v, \-\-verbose
-Increase verbosity. For debugging output specify this option twice.
-.TP
-.I \-q, \-\-quiet
-Suppress normal output. Brief (esp. result notification) messages and error messages will still be printed, though. If used together with conflicting --verbose option, the --verbose option takes preference.
-.TP
-.I \-A, \-\-no\-abbrev
-Do not abbreviate text in tables. By default zypper will try to abbreviate
-texts in some columns so that the table fits the width of the screen. If you
-need to see the whole text, use this option.
-.TP
-.I \-t, \-\-terse
-Terse output for machine consumption.
-.TP
-.I \-s, \-\-table\-style
-Specifies table style to use. Table style is identified by an integer number. TODO
-.TP
-.I \-n, \-\-non\-interactive
-Switches to non-interactive mode. In this mode zypper doesn't ask user to type answers to various prompts, but uses default answers automatically. The behaviour of this option is somewhat different than that of options like '--yes', since zypper can answer different answers to different questions. The answers also depend on other options like '--no-gpg-checks'.
-.TP
-.I \-x, \-\-xmlout
-Switches to XML output. This option is useful for scripts or graphical frontends
-using zypper.
-.TP
-.I \-i, \-\-ignore\-unknown
-Ignore unknown packages. This option is useful for scripts.
-.TP
-.I \-D, \-\-reposd\-dir <dir>
-Use the specified directory to look for the repository definition (*.repo) files.
-The default value is /etc/zypp/repos.d.
-.TP
-.I \-C, \-\-cache\-dir <dir>
-Use an alternative root directory for all caches.
-The default value is /var/cache/zypp.
-.TP
-.I \ \ \ \ \-\-raw\-cache\-dir <dir>
-Use the specified directory for storing raw copies of repository metadata files.
-The default value is /var/cache/zypp/raw.
-.TP
-.I \ \ \ \ \-\-solv\-cache\-dir <dir>
-Use the specified directory to store the repository metadata cache database files (solv files).
-The default value is /var/cache/zypp/solv.
-.TP
-.I \ \ \ \ \-\-pkg\-cache\-dir <dir>
-Use the specified directory for storing downloaded rpm packages. (see \fBaddrepo --keep-packages\fR)
-The default value is /var/cache/zypp/packages.
-.TP
-.I \ \ \ \ \-\-userdata <string>
-User data is expected to be a simple string without special chars or embedded newlines and may serve as
-transaction id. It will be written to all install history log entries created throughout this specific
-zypper call. It will also be passed on to zypp plugins executed during commit. This will enable e.g. a
-btrfs plugin to tag created snapshots with this string. For zypper itself this string has no special
-meaning.
-.LP
+First, a list of all packages and their licenses and/or EULAs is shown\&. This is followed by a summary, including the total number of installed packages, the number of installed packages with EULAs that required a confirmation from the user\&. Since the EULAs are not stored on the system and can only be read from repository metadata, the summary includes also the number of installed packages that have their counterpart in repositories\&. The report ends with a list of all licenses uses by the installed packages\&.
+
+This command can be useful for companies redistributing a custom distribution (like appliances) to figure out what licenses they are bound by\&.
+.RE
+.PP
+\fBdownload\fR
+.RS 4
+Download rpms specified on the commandline to a local directory\&.
+
+Per default packages are downloaded to the libzypp package cache (\fB/var/cache/zypp/packages\fR; for non\-root users
+\fB$XDG_CACHE_HOME/zypp/packages\fR), but this can be changed by using the global
+\fB\-\-pkg\-cache\-dir\fR
+option\&.
+
+In XML output a
+\fB<download\-result>\fR
+node is written for each package zypper tried to downlad\&. Upon success the local path is is found in
+\fBdownload\-result/localpath@path\fR\&.
+.PP
+\fB\-\-all\-matches\fR
+.RS 4
+Download all versions matching the commandline arguments\&. Otherwise only the best version of each matching package is downloaded\&.
+.RE
+.PP
+\fB\-\-dry\-run\fR
+.RS 4
+Don\(cqt download any package, just report what would be done\&.
+.RE
+.RE
+.PP
+\fBsource\-download\fR
+.RS 4
+Download source rpms for all installed packages to a local directory\&.
+.PP
+\fB\-d\fR, \fB\-\-directory\fR \fIdir\fR
+.RS 4
+Download all source rpms to this directory\&. Default is
+\fB/var/cache/zypper/source\-download\fR\&.
+.RE
+.PP
+\fB\-\-delete\fR
+.RS 4
+Delete extraneous source rpms in the local directory\&. This is the default\&.
+.RE
+.PP
+\fB\-\-no\-delete\fR
+.RS 4
+Do not delete extraneous source rpms\&.
+.RE
+.PP
+\fB\-\-status\fR
+.RS 4
+Don\(cqt download any source rpms, but show which source rpms are missing or extraneous\&.
+.RE
+.RE
+.PP
+\fBps\fR
+.RS 4
+After each upgrade or removal of packages, there may be running processes on the system which continue to use meanwhile deleted files\&.
+\fBzypper ps\fR
+lists all processes using deleted files, together with the corresponding files, and a service name hint, in case it\(cqs a known service\&. This gives a hint which services may need to be restarted after an update\&. Usually programs which continue to use deleted shared libraries\&. The list contains the following information:
+.TS
+tab(:);
+lt lt
+lt lt
+lt lt
+lt lt
+lt lt
+lt lt
+lt lt.
+T{
+\fBPID\fR
+T}:T{
+ID of the process
+T}
+T{
+\fBPPID\fR
+T}:T{
+ID of the parent process
+T}
+T{
+\fBUID\fR
+T}:T{
+ID of the user running the process
+T}
+T{
+\fBLogin\fR
+T}:T{
+Login name of the user running the process
+T}
+T{
+\fBCommand\fR
+T}:T{
+Command used to execute the process
+T}
+T{
+\fBService\fR
+T}:T{
+Guessed name of the service\&. If an init script exists for this service, you can do "rcservicename restart" to restart it\&.
+T}
+T{
+\fBFiles\fR
+T}:T{
+The list of the deleted files
+T}
+.TE
+.sp 1
+.RE
+.SH "GLOBAL OPTIONS"
+.PP
+\fB\-h\fR, \fB\-\-help\fR
+.RS 4
+Help\&. If a
+\fIcommand\fR
+is specified together with
+\fB\-\-help\fR
+option, command specific help is displayed\&.
+.RE
+.PP
+\fB\-V\fR, \fB\-\-version\fR
+.RS 4
+Print zypper version number and exit\&.
+.RE
+.PP
+\fB\-c\fR, \fB\-\-config\fR \fIfile\fR
+.RS 4
+Use specified zypper config file instead of the default files\&. Other command line options specified together with
+\fB\-\-config\fR
+and having their counterpart in the config file are still preferred\&. The order of preference with
+\fB\-\-config\fR
+is as follows:
+.sp
+.RS 4
+.ie n \{\
+\h'-04' 1.\h'+01'\c
+.\}
+.el \{\
+.sp -1
+.IP "  1." 4.2
+.\}
+Command line options
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04' 2.\h'+01'\c
+.\}
+.el \{\
+.sp -1
+.IP "  2." 4.2
+.\}
+\fB\-\-config \fR\fB\fIfile\fR\fR
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04' 3.\h'+01'\c
+.\}
+.el \{\
+.sp -1
+.IP "  3." 4.2
+.\}
+[\fB/etc/zypp/zypp\&.conf\fR] (system\-wide defaults for all libzypp based applications)
+.RE
+.sp
+See also
+\fBFILES\fR
+section for more information\&.
+.RE
+.PP
+\fB\-v\fR, \fB\-\-verbose\fR
+.RS 4
+Increase verbosity\&. For debugging output specify this option twice\&.
+.RE
+.PP
+\fB\-q\fR, \fB\-\-quiet\fR
+.RS 4
+Suppress normal output\&. Brief (esp\&. result notification) messages and error messages will still be printed, though\&. If used together with conflicting
+\fB\-\-verbose\fR
+option, the
+\fB\-\-verbose\fR
+option takes preference\&.
+.RE
+.PP
+\fB\-\-\fR[\fBno\-\fR]\fBcolor\fR
+.RS 4
+Whether to use colors in output if tty supports it\&. For details see the
+\fB[color]\fR
+section in
+\fBzypper\&.conf\fR\&.
+.RE
+.PP
+\fB\-A\fR, \fB\-\-no\-abbrev\fR
+.RS 4
+Do not abbreviate text in tables\&. By default zypper will try to abbreviate texts in some columns so that the table fits the width of the screen\&. If you need to see the whole text, use this option\&.
+.RE
+.PP
+\fB\-t\fR, \fB\-\-terse\fR
+.RS 4
+Terse output for machine consumption\&. Implies
+\fB\-\-no\-abbrev\fR
+and
+\fB\-\-no\-color\fR\&.
+.RE
+.PP
+\fB\-s\fR, \fB\-\-table\-style\fR
+.RS 4
+Specifies table style to use\&. Table style is identified by an integer number\&. TODO
+.RE
+.PP
+\fB\-n\fR, \fB\-\-non\-interactive\fR
+.RS 4
+Switches to non\-interactive mode\&. In this mode zypper doesn\(cqt ask user to type answers to various prompts, but uses default answers automatically\&. The behaviour of this option is somewhat different than that of options like
+\fB\-\-yes\fR, since zypper can answer different answers to different questions\&. The answers also depend on other options like
+\fB\-\-no\-gpg\-checks\fR\&.
+.RE
+.PP
+\fB\-x\fR, \fB\-\-xmlout\fR
+.RS 4
+Switches to XML output\&. This option is useful for scripts or graphical frontends using zypper\&.
+.RE
+.PP
+\fB\-i\fR, \fB\-\-ignore\-unknown\fR
+.RS 4
+Ignore unknown packages\&. This option is useful for scripts\&.
+.RE
+.PP
+\fB\-D\fR, \fB\-\-reposd\-dir\fR \fIdir\fR
+.RS 4
+Use the specified directory to look for the repository definition (\fB\&.repo\fR) files\&. The default value is
+\fB/etc/zypp/repos\&.d\fR\&.
+.RE
+.PP
+\fB\-C\fR, \fB\-\-cache\-dir\fR \fIdir\fR
+.RS 4
+Use an alternative root directory for all caches\&. The default value is
+\fB/var/cache/zypp\fR\&.
+.RE
+.PP
+\fB\-\-raw\-cache\-dir\fR \fIdir\fR
+.RS 4
+Use the specified directory for storing raw copies of repository metadata files\&. The default value is
+\fB/var/cache/zypp/raw\fR\&.
+.RE
+.PP
+\fB\-\-solv\-cache\-dir\fR \fIdir\fR
+.RS 4
+Use the specified directory to store the repository metadata cache database files (solv files)\&. The default value is
+\fB/var/cache/zypp/solv\fR\&.
+.RE
+.PP
+\fB\-\-pkg\-cache\-dir\fR \fIdir\fR
+.RS 4
+Use the specified directory for storing downloaded rpm packages\&. (see
+\fBaddrepo \-\-keep\-packages\fR) The default value is
+\fB/var/cache/zypp/packages\fR\&.
+.RE
+.PP
+\fB\-\-userdata\fR \fIstring\fR
+.RS 4
+User data is expected to be a simple string without special chars or embedded newlines and may serve as transaction id\&. It will be written to all install history log entries created throughout this specific zypper call\&. It will also be passed on to zypp plugins executed during commit\&. This will enable e\&.g\&. a btrfs plugin to tag created snapshots with this string\&. For zypper itself this string has no special meaning\&.
+.RE
+.PP
 Repository Options:
-.TP
-.I \ \ \ \ \-\-no\-gpg\-checks
-Ignore GPG check failures and continue. If a GPG issue occurs when using this
-option zypper prints and logs a warning and automatically continues without
-interrupting the operation. Use this option with caution, as you can easily
-overlook security problems by using it.
-.TP
-.I \ \ \ \ \-\-gpg\-auto\-import\-keys
-If new repository signing key is found, do not ask what to do; trust and
-import it automatically. This option causes that the new key is imported
-also in non-interactive mode, where it would otherwise got rejected.
-.TP
-.I \-p, \-\-plus\-repo <URI>
-Use an additional repository for this operation. The repository aliased tmp#
-and named by the specified URI will be added for this operation and removed
-at the end. You can specify this option multiple times.
-.TP
-.I \ \ \ \ \-\-plus\-content <tag>
-Additionaly use disabled repositories providing a specific keyword. Disabled repositories are refreshed
-and those providing the specifies keyword are temporarily endabled. To enable for example repositories
-which may provide additional \fB-debuginfo\fR or \fB-debugsource\fR packages use \fI--plus-content debug\fR.
-You can specify this option multiple times.
-.TP
-.I \ \ \ \ \-\-disable\-repositories
-Do not read metadata from repositories. This option will prevent loading of
-packages from repositories, thus making zypper work only with the installed
-packages (if \-\-disable\-system\-resolvables was not specified).
-.TP
-.I \ \ \ \ \-\-no\-refresh
-Do not auto-refresh repositories (ignore the auto-refresh setting). Useful to save
-time when doing operations like search, if there is not a need to have
-a completely up to date metadata.
-.TP
-.I \ \ \ \ \-\-no\-cd
-Ignore CD/DVD repositories. When this option is specified, zypper acts as if
-the CD/DVD repositories were not defined at all.
-.TP
-.I \ \ \ \ \-\-no\-remote
-Ignore remote repositories like http, ftp, smb and similar. This makes using
-zypper easier when being offline. When this option is specified, zypper acts
-as if the remote repositories were not defined at all.
-.LP
+.RS 4
+.RE
+.PP
+\fB\-\-no\-gpg\-checks\fR
+.RS 4
+Ignore GPG check failures and continue\&. If a GPG issue occurs when using this option zypper prints and logs a warning and automatically continues without interrupting the operation\&. Use this option with caution, as you can easily overlook security problems by using it\&.
+.RE
+.PP
+\fB\-\-gpg\-auto\-import\-keys\fR
+.RS 4
+If new repository signing key is found, do not ask what to do; trust and import it automatically\&. This option causes that the new key is imported also in non\-interactive mode, where it would otherwise got rejected\&.
+.RE
+.PP
+\fB\-p\fR, \fB\-\-plus\-repo\fR \fIURI\fR
+.RS 4
+Use an additional repository for this operation\&. The repository aliased tmp# and named by the specified URI will be added for this operation and removed at the end\&. You can specify this option multiple times\&.
+.RE
+.PP
+\fB\-\-plus\-content\fR \fItag\fR
+.RS 4
+Additionaly use disabled repositories providing a specific keyword\&. Disabled repositories are refreshed and those providing the specified
+\fItag\fR
+keyword are temporarily endabled\&. To enable for example repositories which may provide additional
+\fB\-debuginfo\fR
+or
+\fB\-debugsource\fR
+packages use
+\fB\-\-plus\-content debug\fR\&. You can specify this option multiple times\&.
+.RE
+.PP
+\fB\-\-disable\-repositories\fR
+.RS 4
+Do not read metadata from repositories\&. This option will prevent loading of packages from repositories, thus making zypper work only with the installed packages (if
+\fB\-\-disable\-system\-resolvables\fR
+was not specified)\&.
+.RE
+.PP
+\fB\-\-no\-refresh\fR
+.RS 4
+Do not auto\-refresh repositories (ignore the auto\-refresh setting)\&. Useful to save time when doing operations like search, if there is not a need to have a completely up to date metadata\&.
+.RE
+.PP
+\fB\-\-no\-cd\fR
+.RS 4
+Ignore CD/DVD repositories\&. When this option is specified, zypper acts as if the CD/DVD repositories were not defined at all\&.
+.RE
+.PP
+\fB\-\-no\-remote\fR
+.RS 4
+Ignore remote repositories like http, ftp, smb and similar\&. This makes using zypper easier when being offline\&. When this option is specified, zypper acts as if the remote repositories were not defined at all\&.
+.RE
+.PP
+\fB\-\-releasever\fR \fIversion\fR
+.RS 4
+Set the value of the
+\fB$releasever\fR
+variable in all
+\fB\&.repo\fR
+files (default:
+\fIcurrent distribution version\fR)\&. This can be used to switch to new distribution repositories when performing a distribution upgrade\&. See section
+\fBRepository Management\fR
+and the
+\fBdist\-upgrade\fR
+(\fBdup\fR) command for details\&.
+.PP
+To check where you already use \fB$releasever\fR call:
+.RS 4
+\fBzypper \-\-releasever @\-\-HERE\-\-@ lr \-u\fR
+.RE
+.RE
+.PP
 Target Options:
-.TP
-.I \-R, \-\-root <dir>
-Operates on a different root directory. This option influences the location
-of the repos.d directory and the metadata cache directory and also causes rpm
-to be run with the --root option to do the actual installation or removal of
-packages. Note that the ZYpp lock is still created in the original system,
-as well as temporary files. See also the FILES section.
-.TP
-.I \ \ \ \ \-\-disable\-system\-resolvables
-This option serves mainly for testing purposes. It will cause zypper to act
-as if there were no packages installed in the system. Use with caution as you
-can damage your system using this option.
-
-
+.RS 4
+.RE
+.PP
+\fB\-R\fR, \fB\-\-root\fR \fIdir\fR
+.RS 4
+Operates on a different root directory\&. This option influences the location of the repos\&.d directory and the metadata cache directory and also causes rpm to be run with the
+\fB\-\-root\fR
+option to do the actual installation or removal of packages\&. See also the
+\fBFILES\fR
+section\&.
+.RE
+.PP
+\fB\-\-disable\-system\-resolvables\fR
+.RS 4
+This option serves mainly for testing purposes\&. It will cause zypper to act as if there were no packages installed in the system\&. Use with caution as you can damage your system using this option\&.
+.RE
 .SH "FILES"
-.TP
-.B /etc/zypp/zypper.conf, $HOME/.zypper.conf
-Global (system-wide) and user's configuration file for zypper.
-These files are read when zypper starts up and \fI--config\fR option
-is not used.
-
-User's settings are prefered over global settings.
-Similarly, command line options override the settings in either of
-these files. To sum it up, the order of preference is as follows
-(from highest to lowest):
-
-* Command line options
-.br
-* $HOME/.zypper.conf
-.br
-* /etc/zypp/zypper.conf
-
-[ /etc/zypp/zypp.conf ] (system-wide defaults for all libzypp based applications)
-
-See the comments in /etc/zypp/zypper.conf for a list and description
-of available options.
-.TP
-.B /etc/zypp/zypp.conf
-ZYpp configuration file affecting all libzypp based applications.
-See the comments in the file for desciption of configurable properties.
-Many locations of files and directories listed in this section are
-configurable via zypp.conf. The location for this file itself can be
-redefined only by setting $ZYPP_CONF in the environment.
-
-.TP
-.B /etc/zypp/locks
-File with package lock definitions, see locks(5) manual page for details.
-The package lock commands (addlock, removelock, etc.) can be used
-to manipulate this file.
-
-This file is used by all ZYpp-based applications.
-.TP
-.B /etc/zypp/repos.d
-Directory containing repository definition (*.repo) files.
-You can use the Repository Management commands to manipulate these files,
-or you can edit them yourself. In either case, after doing the modifications,
-executing \fBzypper refresh\fR is strongly recommended.
-
-This directory is used by all ZYpp-based applications.
-
-You can use the \-\-reposd\-dir global option to use an alternative directory
-for this purpose or the \-\-root option to make this directory relative to the
-specified root directory.
-.TP
-.B /etc/zypp/services.d
-Directory containing service definition (*.service) files.
-You can use the Service Management Commands to manipulate theese files, or
-you can edit them youself. Running \fBzypper refs\fR is recommended after
-modifications have been done.
-
-This directory is used by all ZYpp-based applications.
-.TP
-.B /var/cache/zypp/raw
-Directory for storing raw metadata contained in repositories.
-This directory is used by all ZYpp-based applications.
-Use the \-\-raw\-cache\-dir global option to use an alternative directory
-for this purpose or the \-\-root option to make this directory relative to the
-specified root directory.
-.TP
-.B /var/cache/zypp/solv
-Directory containing preparsed metadata in form of \fBsolv\fR files.
-This directory is used by all ZYpp-based applications.
-.TP
-.B /var/cache/zypp/packages
-If \fBkeeppackages\fR property is set for a repository (see the
-\fBmodifyrepo\fR command), all the RPM file downloaded during installation
-will be kept here. See also the \fBclean\fR command for cleaning these
-cache directories.
-
-This directory is used by all ZYpp-based applications.
-.TP
-.B /var/log/zypp/history
-Installation history log.
-.TP
-.B ~/.zypper_history
-Command history for the shell.
-
+.PP
+\fB/etc/zypp/zypper\&.conf\fR, \fB$HOME/\&.zypper\&.conf\fR
+.RS 4
+Global (system\-wide) and user\(cqs configuration file for zypper\&. These files are read when zypper starts up and
+\fB\-\-config\fR
+option is not used\&.
+
+User\(cqs settings are preferred over global settings\&. Similarly, command line options override the settings in either of these files\&. To sum it up, the order of preference is as follows (from highest to lowest):
+.sp
+.RS 4
+.ie n \{\
+\h'-04' 1.\h'+01'\c
+.\}
+.el \{\
+.sp -1
+.IP "  1." 4.2
+.\}
+\fICommand line options\fR
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04' 2.\h'+01'\c
+.\}
+.el \{\
+.sp -1
+.IP "  2." 4.2
+.\}
+\fB$HOME/\&.zypper\&.conf\fR
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04' 3.\h'+01'\c
+.\}
+.el \{\
+.sp -1
+.IP "  3." 4.2
+.\}
+\fB/etc/zypp/zypper\&.conf\fR
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04' 4.\h'+01'\c
+.\}
+.el \{\
+.sp -1
+.IP "  4." 4.2
+.\}
+[\fB/etc/zypp/zypp\&.conf\fR] (system\-wide defaults for all libzypp based applications)
+.RE
+.sp
+See the comments in
+\fB/etc/zypp/zypper\&.conf\fR
+for a list and description of available options\&.
+.RE
+.PP
+\fB/etc/zypp/zypp\&.conf\fR
+.RS 4
+ZYpp configuration file affecting all libzypp based applications\&. See the comments in the file for description of configurable properties\&. Many locations of files and directories listed in this section are configurable via zypp\&.conf\&. The location for this file itself can be redefined only by setting
+\fB$ZYPP_CONF\fR
+in the environment\&.
+.RE
+.PP
+\fB/etc/zypp/locks\fR
+.RS 4
+File with package lock definitions, see
+\fIlocks(5)\fR
+manual page for details\&. The package lock commands (\fBaddlock\fR,
+\fBremovelock\fR, etc\&.) can be used to manipulate this file\&.
+
+This file is used by all ZYpp\-based applications\&.
+.RE
+.PP
+\fB/etc/zypp/repos\&.d\fR
+.RS 4
+Directory containing repository definition (\fI*\&.repo\fR) files\&. You can use the Repository Management commands to manipulate these files, or you can edit them yourself\&. In either case, after doing the modifications, executing
+\fBzypper refresh\fR
+is strongly recommended\&.
+
+You can use the
+\fB\-\-reposd\-dir\fR
+global option to use an alternative directory for this purpose or the
+\fB\-\-root\fR
+option to make this directory relative to the specified root directory\&.
+
+This directory is used by all ZYpp\-based applications\&.
+.RE
+.PP
+\fB/etc/zypp/services\&.d\fR
+.RS 4
+Directory containing service definition (\fI*\&.service\fR) files\&. You can use the Service Management Commands to manipulate these files, or you can edit them yourself\&. Running
+\fBzypper refs\fR
+is recommended after modifications have been done\&.
+
+This directory is used by all ZYpp\-based applications\&.
+.RE
+.PP
+\fB/var/cache/zypp/raw\fR
+.RS 4
+Directory for storing raw metadata contained in repositories\&. Use the
+\fB\-\-raw\-cache\-dir\fR
+global option to use an alternative directory for this purpose or the
+\fB\-\-root\fR
+option to make this directory relative to the specified root directory\&.
+
+This directory is used by all ZYpp\-based applications\&.
+.RE
+.PP
+\fB/var/cache/zypp/solv\fR
+.RS 4
+Directory containing preparsed metadata in form of
+\fIsolv\fR
+files\&.
+
+This directory is used by all ZYpp\-based applications\&.
+.RE
+.PP
+\fB/var/cache/zypp/packages\fR
+.RS 4
+If
+\fBkeeppackages\fR
+property is set for a repository (see the
+\fBmodifyrepo\fR
+command), all the RPM file downloaded during installation will be kept here\&. See also the
+\fBclean\fR
+command for cleaning these cache directories\&.
+
+This directory is used by all ZYpp\-based applications\&.
+.RE
+.PP
+\fB/var/log/zypp/history\fR
+.RS 4
+Installation history log\&.
+.RE
+.PP
+\fB~/\&.zypper_history\fR
+.RS 4
+Command history for the zypper shell (see the
+\fBshell\fR
+command)\&.
+.RE
 .SH "EXIT CODES"
-.LP
-There are several exit codes defined for zypper for use e.g. within
-scripts. These codes are defined in header file src/zypper-main.h
-found in zypper source package. Codes from interval (1-5) denote an
-error, numbers (100-105) provide a specific information, 0
-represents a normal successful run. Following is a list of these
-codes with descriptions.
-.TP
-0 - ZYPPER_EXIT_OK
-Successfull run of zypper with no special info.
-.TP
-1 - ZYPPER_EXIT_ERR_BUG
-Unexpected situation occured, probably caused by a bug.
-.TP
-2 - ZYPPER_EXIT_ERR_SYNTAX
-zypper was invoked with an invalid command or option, or a bad syntax.
-.TP
-3 - ZYPPER_EXIT_ERR_INVALID_ARGS
-Some of provided arguments were invalid. E.g. an invalid URI was provided to the addrepo command.
-.TP
-4 - ZYPPER_EXIT_ERR_ZYPP
-A problem is reported by ZYPP library.
-.TP
-5 - ZYPPER_EXIT_ERR_PRIVILEGES
-User invoking zypper has insufficient privileges for specified operation.
-.TP
-6 - ZYPPER_EXIT_NO_REPOS
-No repositories are defined.
-.TP
-7 - ZYPPER_EXIT_ZYPP_LOCKED
-The ZYPP library is locked, e.g. packagekit is running.
-.TP
-100 - ZYPPER_EXIT_INF_UPDATE_NEEDED
-Returned by the patch-check command if there are patches available for installation.
-.TP
-101 - ZYPPER_EXIT_INF_SEC_UPDATE_NEEDED
-Returned by the patch-check command if there are security patches available for installation.
-.TP
-102 - ZYPPER_EXIT_INF_REBOOT_NEEDED
-Returned after a successfull installation of a patch which requires reboot of computer.
-.TP
-103 - ZYPPER_EXIT_INF_RESTART_NEEDED
-Returned after a successfull installation of a patch which requires restart of the package manager itself. This means that one of patches to be installed affects the package manager itself and the command used (e.g. zypper update) needs to be executed once again to install any remaining patches.
-.TP
-104 - ZYPPER_EXIT_INF_CAP_NOT_FOUND
-Returned by the \fBinstall\fR and the \fBremove\fR command in case any of the
-arguments does not match any of the available (or installed) package names
-or other capabilities.
-.TP
-105 - ZYPPER_EXIT_ON_SIGNAL
-Returned upon exiting after receiving a SIGINT or SIGTERM.
-
-
+.sp
+There are several exit codes defined for zypper for use e\&.g\&. within scripts\&. These codes are defined in header file src/zypper\-main\&.h found in zypper source package\&. Codes from interval (1\-5) denote an error, numbers (100\-105) provide a specific information, 0 represents a normal successful run\&. Following is a list of these codes with descriptions\&.
+.PP
+\fB0\fR \- \fBZYPPER_EXIT_OK\fR
+.RS 4
+Successfull run of zypper with no special info\&.
+.RE
+.PP
+\fB1\fR \- \fBZYPPER_EXIT_ERR_BUG\fR
+.RS 4
+Unexpected situation occurred, probably caused by a bug\&.
+.RE
+.PP
+\fB2\fR \- \fBZYPPER_EXIT_ERR_SYNTAX\fR
+.RS 4
+zypper was invoked with an invalid command or option, or a bad syntax\&.
+.RE
+.PP
+\fB3\fR \- \fBZYPPER_EXIT_ERR_INVALID_ARGS\fR
+.RS 4
+Some of provided arguments were invalid\&. E\&.g\&. an invalid URI was provided to the
+\fBaddrepo\fR
+command\&.
+.RE
+.PP
+\fB4\fR \- \fBZYPPER_EXIT_ERR_ZYPP\fR
+.RS 4
+A problem is reported by ZYPP library\&.
+.RE
+.PP
+\fB5\fR \- \fBZYPPER_EXIT_ERR_PRIVILEGES\fR
+.RS 4
+User invoking zypper has insufficient privileges for specified operation\&.
+.RE
+.PP
+\fB6\fR \- \fBZYPPER_EXIT_NO_REPOS\fR
+.RS 4
+No repositories are defined\&.
+.RE
+.PP
+\fB7\fR \- \fBZYPPER_EXIT_ZYPP_LOCKED\fR
+.RS 4
+The ZYPP library is locked, e\&.g\&. packagekit is running\&.
+.RE
+.PP
+\fB100\fR \- \fBZYPPER_EXIT_INF_UPDATE_NEEDED\fR
+.RS 4
+Returned by the patch\-check command if there are patches available for installation\&.
+.RE
+.PP
+\fB101\fR \- \fBZYPPER_EXIT_INF_SEC_UPDATE_NEEDED\fR
+.RS 4
+Returned by the patch\-check command if there are security patches available for installation\&.
+.RE
+.PP
+\fB102\fR \- \fBZYPPER_EXIT_INF_REBOOT_NEEDED\fR
+.RS 4
+Returned after a successfull installation of a patch which requires reboot of computer\&.
+.RE
+.PP
+\fB103\fR \- \fBZYPPER_EXIT_INF_RESTART_NEEDED\fR
+.RS 4
+Returned after a successful installation of a patch which requires restart of the package manager itself\&. This means that one of patches to be installed affects the package manager itself and the command used (e\&.g\&.
+\fBzypper update\fR) needs to be executed once again to install any remaining patches\&.
+.RE
+.PP
+\fB104\fR \- \fBZYPPER_EXIT_INF_CAP_NOT_FOUND\fR
+.RS 4
+Returned by the
+\fBinstall\fR
+and the
+\fBremove\fR
+command in case any of the arguments does not match any of the available (or installed) package names or other capabilities\&.
+.RE
+.PP
+\fB105\fR \- \fBZYPPER_EXIT_ON_SIGNAL\fR
+.RS 4
+Returned upon exiting after receiving a SIGINT or SIGTERM\&.
+.RE
 .SH "HOMEPAGE"
-
-http://en.opensuse.org/Portal:Zypper
-
+.sp
+https://github\&.com/openSUSE/zypper
 .SH "AUTHORS"
-.LP
-Martin Vidner <mvidner@suse.cz>
-.br
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+Martin Vidner <mvidner@suse\&.cz>
 Jan Kupec <>
-.br
-Michael Andres <ma@suse.de>
-.br
-Duncan Mac-Vicar <dmacvicar@suse.de>
-.br
-Josef Reidinger <jreidinger@suse.cz>
-.br
-Stanislav Visnovsky <visnov@suse.cz>
-
+Michael Andres <ma@suse\&.de>
+Duncan Mac\-Vicar <dmacvicar@suse\&.de>
+Josef Reidinger <jreidinger@suse\&.cz>
+Stanislav Visnovsky <visnov@suse\&.cz>
+.fi
+.if n \{\
+.RE
+.\}
 .SH "SEE ALSO"
-.LP
-locks(5), zypper-log(8), YaST2(8)
+.sp
+locks(5), zypper\-log(8), YaST2(8)
diff --git a/doc/zypper.8.txt b/doc/zypper.8.txt
new file mode 100644 (file)
index 0000000..283da30
--- /dev/null
@@ -0,0 +1,1573 @@
+zypper(8)
+=========
+:man manual: ZYPPER
+:man source: zypper
+:nop:
+
+
+NAME
+----
+zypper - Command-line interface to ZYpp system management library (libzypp)
+
+
+SYNOPSIS
+--------
+*zypper* ['--global-opts'] 'command' ['--command-opts'] ['command-arguments']
+
+*zypper* *help* 'command'
+
+
+DESCRIPTION
+-----------
+zypper is a command-line interface to ZYpp system management library (libzypp). It can be used to install, update, remove software, manage repositories, perform various queries, and more.
+
+
+CONCEPTS
+--------
+Most of the following concepts are common for all applications based on the libzypp package management library, but there are some zypper specifics.
+
+Repositories
+~~~~~~~~~~~~
+Libzypp works with package metadata, that is information about packages and their relations extracted from RPM packages and other data like patch information, pattern definitions, etc. These data are stored together with the RPM files in folders called 'repositories'. Repositories can be placed on various media like an HTTP or FTP server, DVD, or a folder on a local disc.
+
+There is a special set of commands in zypper intended to manipulate repositories. Also many commands and options take a repository as an argument. See section *COMMANDS*, subsection *Repository Management* for more details.
+
+Resource Identifiers (URI)
+~~~~~~~~~~~~~~~~~~~~~~~~~~
+To specify locations of repositories or other resources (RPM files, .repo files) you can use any type of URIs supported by libzypp. See section *COMMANDS*, subsection *Repository Management* for a complete list and usage examples.
+
+Zypper also accepts special URIs identifying openSUSE Build Service (OBS) repositories in the *addrepo* command. These URIs have the form of *obs://*'project'*/*['platform'], where 'project' is the name of the OBS project and 'platform' is the target platform (OS) for which the repository is intended. If 'platform' is omitted, the *obs.platform* value from zypper.conf is used. See also other options in the [obs] section of zypper.conf.
+
+For example: *obs://server:http/openSUSE_11.3*.
+
+In addition to these URIs you can use plain directory and file paths in which case zypper automatically treats them as *dir:/*'path' URI.
+
+Refresh
+~~~~~~~
+Refreshing a repository means downloading metadata of packages from the medium (if needed), storing it in local cache (typically under */var/cache/zypp/raw/*'alias' directory) and preparsing the metadata into '.solv' files (building the solv cache), typically under */var/cache/zypp/solv/*'alias'.
+
+The metadata get refreshed either automatically or on user request. An 'automatic refresh' takes place right before reading metadata from the database if the *auto-refresh is enabled* for the repository and the metadata is reported to be out of date. If the 'auto-refresh is disabled', the repository will only be refreshed on user request. You can request a refresh by calling *zypper refresh* (see the documentation of the *refresh* command for details).
+
+The repository metadata are checked for changes before actually doing the refresh. A change is detected by downloading one or two metadata index files (small files) and comparing the checksums of the cached ones and the remote ones. If the files differ, the repository is out of date and will be refreshed.
+
+To delay the up-to-date check (and thus the automatic refresh) for a certain number of minutes, edit the value of the *repo.refresh.delay* attribute of ZYpp config file (*/etc/zypp/zypp.conf*). This means, zypper will not even try to download and check the index files, and you will be able to use zypper for operations like search or info without internet access or root privileges.
+
+Services
+~~~~~~~~
+Services are one level above repositories and serve to manage repositories or to do some special tasks. Libzypp currently supports 'Repository Index Service' (RIS) and 'Plugin Service'.
+
+Repository Index Service (RIS) is a special type of repository which contains a list of other repositories. This list can be generated dynamically by the server according to some URI parameters or user name, or can be static. Once such service is added to your system, zypper takes care of adding, modifying, or removing these repositories on your system to reflect the current list. See section *Service Management* and http://old-en.opensuse.org/Standards/Repository_Index_Service for more details.
+
+Package Types
+~~~~~~~~~~~~~
+Zypper works with several types of resource objects, called 'resolvables'. A resolvable might be a *package*, *patch*, *pattern*, *product*; basically any 'kind of object' with dependencies to other objects.
+
+*package*::
+       An ordinary RPM package.
+*patch*::
+       A released patch conflicts with the affected/vulnerable versions of a collection of packages. As long as any of these affected/vulnerable versions are installed, the conflict triggers and the patch is classified as *needed*. Selecting the patch, the conflict is resolved by updating all installed and affected/vulnerable packages to a version providing the fix. When updating the packages zypper always aims for the latest available version.
+*pattern*::
+       A group of packages required or recommended to install some functionality.
+*product*::
+       A group of packages which are necessary to install a product.
+*srcpackage*::
+       Source code package (.src.rpm). This type works in *search* and *install* commands.
+*application*::
+       Focuses on packages a user might want to install and hide away supporting packages which are selected via package dependencies anyway (see 'http://people.freedesktop.org/~hughsient/appdata/')
+
+Throughout this manual we will often refer to resolvables simply as 'packages' and to resolvable types as 'package type' or 'kind'. These type names can be used as arguments of *--type* option in several commands like *install*, *info*, or *search*. Commands should also allow to specify resolvables as 'KIND'*:*'NAME' (e.g. *patch:openSUSE-2014-7*).
+
+Package Dependencies
+~~~~~~~~~~~~~~~~~~~~
+Software packages depend on each other in various ways. Packages usually 'require' or 'recommend' other packages, but they can also 'conflict' with other packages. Packages can also support specific hardware or language settings. Zypper uses a 'dependency solver' to find out what packages need to be installed to satisfy the user's request. See http://old-en.opensuse.org/Software_Management/Dependencies for more information.
+
+Package File Conflicts
+~~~~~~~~~~~~~~~~~~~~~~
+File conflicts happen when two packages attempt to install files with the same name but different contents. This may happen if you are installing a newer version of a package without erasing the older version, of if two unrelated packages each install a file with the same name.
+
+As checking for file conflicts requires access to the full filelist of each package being installed, zypper will check for file conflict only if all packages are downloaded in advance (see *--download-in-advance*).
+
+As the reason for file conflicts usually is a poor package design or lack of coordination between the the people building the packages, they are not easy to resolve. By using the *--replacefiles* option you can force zypper to replace the conflicting files. Nevertheless this may damage the package whose file gets replaced.
+
+COMMANDS
+--------
+zypper provides a number of 'commands'. Each command accepts the options listed in the *GLOBAL OPTIONS* section. These options must be specified 'before' the command name. In addition, many commands have specific options, which are listed in this section. These command-specific options must be specified 'after' the name of the command and 'before' any of the command arguments.
+
+General Commands
+~~~~~~~~~~~~~~~~
+*help* ['command']::
+       Shows help texts. If invoked without any argument (just *zypper* or *zypper help*), zypper displays global help text which lists all available global options and commands.
+       +
+       If invoked with a 'command' name argument, zypper displays help for the specified command, if such command exists. Long as well as short variants of the command names can be used.
+       +
+       For your convenience, *zypper help* can also be invoked in any of the following ways:
+
+[horizontal]
+       ;; $ *zypper -h*|*--help* ['command']
+       ;; $ *zypper* ['command'] *-h*|*--help*
+
+
+*shell* (*sh*)::
+       Starts a shell for entering multiple commands in one session. Exit the shell using *exit*, *quit*, or 'Ctrl-D'.
+       +
+       The shell support is not complete so expect bugs there. However, there's no urgent need to use the shell since libzypp became so fast thanks to the SAT solver and its tools (openSUSE 11.0), but still, you're welcome to experiment with it.
+
+
+Package Management Commands
+~~~~~~~~~~~~~~~~~~~~~~~~~~~
+*info* (*if*) ['options'] 'name'...::
+       Displays detailed information about the specified packages.
+       +
+       For each specified package, zypper finds the best available version in defined repositories and shows information for this package.
++
+--
+       *-r*, *--repo* 'alias'|'name'|'#'|'URI'::
+               Work only with the repository specified by the alias, name, number or URI. This option can be used multiple times.
+
+       *-t*, *--type* 'type'::
+               Type of package (default: package). See section *Package Types* for list of available package types.
+       *--provides*::
+               Show symbols the package provides.
+
+       *--requires*::
+               Show symbols the package requires.
+
+       *--conflicts*::
+               Show symbols the package conflicts with.
+
+       *--obsoletes*::
+               Show symbols the package obsoletes.
+
+       *--recommends*::
+               Show symbols the package recommends.
+
+       *--suggests*::
+               Show symbols the package suggests.
+
+       Examples: :: {nop}
+
+               $ *zypper info workrave*;;
+               Show information about 'package workrave'
+
+               $ *zypper info -t patch libzypp*;;
+               Show information about 'patch libzypp'
+
+               $ *zypper info -t pattern lamp_server*;;
+               Show information about 'pattern lamp_server'
+--
+
+*install* (*in*) ['options'] 'name'|'capability'|'rpm_file_uri'...::
+       Install or update packages.
+
+       The packages can be selected by their 'name' or by a 'capability' they provide.;;
+               +
+               A 'capability' is formed by "'NAME'[*.*'ARCH'][ 'OP EDITION']", where 'ARCH' is an architecture code, 'OP' is one of *<*, *\<=*, *=*, *>=*, or *>* and 'EDITION' is "'VERSION'[*-*'RELEASE']". For example: *zypper=0.8.8-2*
+               +
+               The 'NAME' component of a capability is not only a package name but any symbol provided by packages: */bin/vi*, *libcurl.so.3*, *perl(Time::ParseDate)*. Just remember to quote to protect the special characters from the shell, for example: *zypper\>0.8.10* or *\'zypper>0.8.10'*.
+               +
+               If 'EDITION' is not specified, the newest installable version will be installed. This also means that if the package is already installed and newer versions are available, it will get upgraded to the newest installable version.
+               +
+               If 'ARCH' is not specified, or the last dot of the capability name string is not followed by known architecture, the solver will treat the whole string as a capability name. If the ARCH is known, the solver will select a package matching that architecture and complain if such package cannot be found.
+
+       Zypper is also able to install 'plain RPM files' while trying to satisfy their dependencies using packages from defined repositories. You can install a plain RPM file by specifying its location in the install command arguments either as a local path or an URI. E.g.: ;;
+               +
+               $ *zypper install ~/rpms/foo.rpm http://some.site/bar.rpm*.
+               +
+               Zypper will report packages that it cannot find. Further, in interactive mode, zypper proceeds with installation of the rest of requested packages, and it will abort immediately in non-interactive mode. In both cases zypper returns *ZYPPER_EXIT_INF_CAP_NOT_FOUND* after finishing the operation.
+               +
+               Zypper will download the files into its cache directory (/var/cache/zypper/RPMS), add this directory as a temporary *plaindir* repository and mark the respective packages for installation.
+
+       In the install command, you can specify also packages you wish to remove in addition to the packages you wish to install, by prepending their names by a '-' or '~' character. For example: ;;
+               +
+               $ '*zypper install vim -emacs*'{nbsp}
+               +
+               $ *zypper remove emacs +vim*{nbsp}
+               +
+               will both 'install vim' and 'remove emacs'. Note that if you choose to use *-* with the first package you specify, you need to write *--* before it to prevent its interpretation as a command option:
+               +
+               $ *zypper install -- -boring-game great-game great-game-manual*{nbsp}
+
++
+--
+       -r, --repo alias|name|#|URI::
+               Work only with the repository specified by the alias, name, number or URI. This option can be used multiple times.
+               +
+               Using --repo is 'discouraged' as it currently hides unmentioned repositories from the resolver, leading to inexpertly decisions. In the future --repo will become an alias for *--from*.
+
+       *-t*, *--type* 'type'::
+               Type of package to install (default: package). See section *Package Types* for list of available package types. Use '*zypper se -t* type' ['name'] to look for available items of this type and '*zypper info -t* type name' to display more detailed information about the item.
+               +
+               If 'patch' is specified, zypper will install and/or remove packages to satisfy specified patch. This is a way to ensure that specific bug fix is installed. Use *zypper list-patches* to look for available 'needed' patches.
+               +
+               If 'product' or 'pattern' are specified, zypper ensures that all required (and optionally recommended) packages are installed.
+
+       *-n*, *--name*::
+               Select packages by their name, don't try to select by capabilities.
+
+       *-f*, *--force*::
+               Install even if the item is already installed (reinstall), downgraded or changes vendor or architecture.
+
+       *--oldpackage*::
+               Allow to replace a newer item with an older one. Handy if you are doing a rollback. Unlike --force it will not enforce a reinstall, if the item is already installed with the requested version.
+
+       *--from* 'alias|name|#|URI'::
+               Select packages from specified repository. If strings specified as arguments to the install command match packages in repositories specified in this option, they will be marked for installation. This option currently implies *--name*, but allows using wildcards for specifying packages.
+
+       *-C*, *--capability*::
+               Select packages by capabilities.
+
+       *-l*, *--auto-agree-with-licenses*::
+               Automatically say 'yes' to third party license confirmation prompt. By using this option, you choose to agree with licenses of all third-party software this command will install. This option is particularly useful for administrators installing the same set of packages on multiple machines (by an automated process) and have the licenses confirmed before.
+
+       *--debug-solver*::
+               Create solver test case for debugging. Use this option, if you think the dependencies were not solved all right and attach the resulting /var/log/zypper.solverTestCase directory to your bug report. To use this option, simply add it to the problematic install or remove command.
+
+       *--no-recommends*::
+               By default, zypper installs also packages recommended by the requested ones. This option causes the recomended packages to be ignored and only the required ones to be installed.
+
+       *--replacefiles*::
+               Install the packages even if they replace files from other, already installed, packages. Default is to treat file conflicts as an error. *--download-as-needed* disables the file conflict check because access to all packages file lists is needed in advance in order to perform the check.
+
+       *-R*, *--no-force-resolution*::
+               Do not force the solver to find a solution. Instead, report dependency problem and prompt the user to resolve it manually.
+
+       *--force-resolution*::
+               Force the solver to find a solution, even if it would mean removing all packages with unfulfilled requirements. The default behavior is 'force in the interactive mode' and 'no-force in the non-interactive mode'. If this option is specified, it takes the preference.
+
+       *-D*, *--dry-run*::
+               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.
+
+       *--details*::
+               Show the detailed installation summary.
+
+       Download-and-install mode options: :: {nop}
+
+       *-d*, *--download-only*::
+               Only download the packages for later installation.
+
+       *--download-in-advance*::
+               First download all packages, then start installing.
+
+       *--download-in-heaps*::
+               Download a minimal set of packages that can be installed without leaving
+               the system in broken state, and install them. Then download and install another
+               heap until all are installed. This helps to keep the system in consistent state
+               without the need to download 'all' packages in advance, which combines the
+               advantages of *--download-in-advance* and *--download-as-needed*.
+               This is the default mode.
+               +
+               NOTE: While the resolver is not capable of building heaps, this behaves the same as *--download-in-advance*.
+
+       *--download-as-needed*::
+               Download one package, install it immediately, and continue with the rest
+               until all are installed.
+
+       *--download* 'mode'::
+               Use the specified download-and-install mode. Available modes are:
+               *only*, *in-advance*, *in-heaps*, *as-needed*.
+               See corresponding *--download-*'mode' options for their description.
+
+       Examples: :: {nop}
+
+               $ *zypper install -t pattern lamp_server*;;
+               Install lamp_server pattern.
+
+               $ *zypper install --no-recommends gv*;;
+               Install GhostScript viewer, but ignore recommended packages.
+
+               $ *zypper install virtualbox-ose-2.0.6*;; {nop}
+               $ *zypper install virtualbox-ose=2.0.6*;; {nop}
+               $ *zypper install virtualbox-ose = 2.0.6*;;
+               Install version 2.0.6 of virtualbox-ose package.
+--
+
+*source-install* (*si*) 'name'...::
+       Install specified source packages and their build dependencies. If the name of a binary package is given, the corresponding source package is looked up and installed instead.
+       +
+       This command will try to find the newest available versions of the source packages and uses *rpm -i* to install them and the packages that are required to build the source package.
+       +
+       Note that the source packages must be available in repositories you are using. You can check whether a repository contains any source packages using the following command:
+
+       ;; $ '*zypper search -t srcpackage -r* alias'|'name'|'#'|'URI'
+
++
+--
+       *-d*, *--build-deps-only*::
+               Install only build dependencies of specified packages.
+
+       *-D*, *--no-build-deps*::
+               Don't install build dependencies.
+
+       *-r*, *--repo* 'alias'|'name'|'#'|'URI'::
+               Work only with the repository specified by the alias, name, number, or URI. This option can be used multiple times.
+
+       *--download-only*::
+               Only download the packages, do not install.
+
+       Examples: :: {nop}
+
+               $ *zypper si -d dbus-1*;;
+               Install build dependencies of dbus-1 source package.
+--
+
+*verify* (*ve*) ['options']::
+       Check whether dependencies of installed packages are satisfied.
+       +
+       In case that any dependency problems are found, zypper suggests packages to install or remove to fix them.
++
+--
+       *--no-recommends*::
+               By default, zypper installs also packages recommended by the requested ones (the ones needed to fix broken dependencies in this case). This option causes the recommended packages to be ignored and only the required ones to be installed.
+
+       *-D*, *--dry-run*::
+               Test the repair, do not actually do anything to the system.
+
+       *--details*::
+               Show the detailed installation summary.
+
+       *-r*, *--repo* 'alias'|'name'|'#'|'URI'::
+               Work only with the repository specified by the alias, name, number, or URI. This option can be used multiple times.
+
+       *--debug-solver*::
+               Create solver test case for debugging. See the install command for details.
+--
+
+*install-new-recommends* (*inr*) ['options']::
+       Install newly added packages recommended by already installed ones. This can typically be used to install language packages recently added to repositories or drivers for newly added hardware.
++
+--
+       *-r*, *--repo* 'alias'|'name'|'#'|'URI'::
+               Work only with the repository specified by the alias, name, number, or URI. This option can be used multiple times.
+
+       *-D*, *--dry-run*::
+               Test the installation, do not actually install anything.
+
+       *--details*::
+               Show the detailed installation summary.
+
+       *--debug-solver*::
+               Create solver test case for debugging. See the install command for details.
+
+       This command also accepts the *Download-and-install mode options* described in the *install* command.:: {nop}
+--
+
+*remove* (*rm*) ['options'] 'name'...:: {nop}
+*remove* (*rm*) ['options'] *--capability* 'capability'...::
+       Remove (uninstall) packages.
+       +
+       The packages can be selected by their name or by a capability they provide. For details on package selection see the *install* command description.
++
+--
+       *-r*, *--repo* 'alias'|'name'|'#'|'URI'::
+               Work only with the repository specified by the alias, name, number, or URI. This option can be used multiple times.
+
+       *-t*, *--type* 'type'::
+               Type of package (default: package). See section *Package Types* for list of available package types.
+               +
+               Since *patches* are not installed in sense of copying files or recording a database entry, they cannot be uninstalled, even though zypper shows them as installed. The installed status is determined solely based on the installed status of its required dependencies. If these dependencies are satisfied, the patch is rendered installed.
+
+       *-n*, *--name*::
+               Select packages by their name (default).
+
+       *-C*, *--capability*::
+               Select packages by capabilities.
+
+       *--debug-solver*::
+               Create solver test case for debugging. See the install command for details.
+
+       *-R*, *--no-force-resolution*::
+               Do not force the solver to find a solution. Instead, report dependency problem and prompt the user to resolve it manually.
+
+       *--force-resolution*::
+               Force the solver to find a solution, even if it would mean removing all packages with unfulfilled requirements.
+               +
+               The default behavior is 'force' in the 'interactive mode' and 'no-force' in the 'non-interactive mode'. If this option is specified, it takes the preference.
+
+       *-u*, *--clean-deps*::
+               Automatically remove dependencies which become unneeded after removal of requested packages.
+
+       *-U*, *--no-clean-deps*::
+               No automatic removal of unneeded dependencies.
+
+       *-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.
+
+       *--details*::
+               Show the detailed installation summary.
+--
+
+Update Management Commands
+~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+*list-updates* (*lu*) ['options']::
+       List available updates.
+       +
+       This command will list only installable updates, i.e. updates which have no dependency problems, or which do not change package vendor. This list is what the *update* command will propose to install. To list all packages for which newer version are available, use *--all* option.
++
+--
+       *-t*, *--type* 'type'::
+               Type of package (default: package). See section *Package Types* for list of available package types.
+               +
+               If *patch* is specified, zypper acts as if the *list-patches* command was executed.
+
+       *-r*, *--repo* 'alias'|'name'|'#'|'URI'::
+               Work only with the repository specified by the alias, name, number, or URI. This option can be used multiple times.
+
+       *-a*, *--all*::
+               List all packages for which newer versions are available, regardless whether they are installable or not.
+
+       *--best-effort*::
+               See the *update* command for description.
+--
+
+*update* (*up*) ['options'] ['packagename']...::
+       Update installed packages with newer versions, where possible.
+       +
+       This command will not update packages which would require change of package vendor unless the vendor is specified in */etc/zypp/vendors.d*, or which would require manual resolution of problems with dependencies. Such non-installable updates will then be listed in separate section of the summary as "'The following package updates will NOT be installed:'".
+       +
+       To update individual packages, specify one or more package names. You can use the *** and *?* wildcard characters in the package names to specify multiple packages matching the pattern.
++
+--
+       *-t*, *--type* 'type'::
+               Type of package (default: package). See section *Package Types* for list of available package types.
+               +
+               If *patch* is specified, zypper acts as if the *patches* command was executed.
+
+       *-r*, *--repo* 'alias'|'name'|'#'|'URI'::
+               Work only with the repository specified by the alias, name, number, or URI. This option can be used multiple times.
+
+       *--skip-interactive*::
+               This will skip interactive patches, that is, those that need reboot, contain a message, or update a package whose license needs to be confirmed.
+
+       *--with-interactive*::
+               Avoid skipping of interactive patches when in non-interactive mode.
+
+       *-l*, *--auto-agree-with-licenses*::
+               Automatically say 'yes' to third party license confirmation prompt. By using this option, you choose to agree with licenses of all third-party software this command will install. This option is particularly useful for administrators installing the same set of packages on multiple machines (by an automated process) and have the licenses confirmed before.
+
+       *--debug-solver*::
+               Create solver test case for debugging. See the install command for details.
+
+       *--no-recommends*::
+               By default, zypper installs also packages recommended by the requested ones. This option causes the recommended packages to be ignored and only the required ones to be installed.
+
+       *--replacefiles*::
+               Install the packages even if they replace files from other, already installed, packages. Default is to treat file conflicts as an error. *--download-as-needed* disables the fileconflict check because access to all packages filelists is needed in advance in order to perform the check.
+
+       *-R*, *--no-force-resolution*::
+               Do not force the solver to find a solution. Instead, report dependency problem and prompt the user to resolve it manually.
+
+       *--force-resolution*::
+               Force the solver to find a solution, even if it would mean removing all packages with unfulfilled requirements.
+               +
+               The default behavior is 'no-force'. If this option is specified, it takes the preference.
+
+       *-D*, *--dry-run*::
+               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.
+
+       *--details*::
+               Show the detailed installation summary.
+
+       *--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 of a package with higher version than the installed one and leaves the rest on the dependency solver. This method is always used for packages, and is optional for products and patterns. It is not applicable to patches.
+
+       This command also accepts the download-and-install mode options described in the *install* command description.:: {nop}
+--
+
+*list-patches* (*lp*) ['options']::
+       List all available needed patches.
+       +
+       This command is similar to *zypper list-updates -t patch*.
+       +
+       Note that 'optional arguments' of some of the following options must be specified using *=* instead of a space.
++
+--
+       *-b*, *--bugzilla*[*=*'#']::
+               List available needed patches for all Bugzilla issues, or issues whose number matches the given string.
+
+       *--cve*[*=*'#']::
+               List available needed patches for all CVE issues, or issues whose number matches the given string.
+
+       *--date* 'YYYY-MM-DD'::
+               List patches issued up to the specified date.
+
+       *-g*, *--category* 'category'::
+               List available patches in the specified category.
+
+       *--issues*[*=*'string']::
+               Look for issues whose number, summary, or description matches the specified 'string'. Issues found by number are displayed separately from those found by descriptions. In the latter case, use '*zypper patch-info* patchname' to get information about issues the patch fixes.
+
+       *-a*, *--all::
+               By default, only patches that are relevant and needed on your system are listed. This option causes all available released patches to be listed. This option can be combined with all the rest of the *list-updates* command options.
+
+       *-r*, *--repo* 'alias'|'name'|'#'|'URI'::
+               Work only with the repository specified by the alias, name, number, or URI. This option can be used multiple times.
+--
+
+*patch-check* (*pchk*)::
+       Check for patches. Displays a count of applicable patches and how many of them have the security category.
+       +
+       See also the *EXIT CODES* section for details on exit status of *0*, *100*, and *101* returned by this command.
++
+--
+       *-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.
+--
+
+*patch* ['options']::
+       Install all available needed patches.
+       +
+       If there are patches that affect the package management itself, those will
+       be installed first and you will be asked to run the *patch* command again.
+       +
+       This command is similar to *zypper update -t patch*.
++
+--
+       *-b*, *--bugzilla* '#'::
+               Install patch fixing a Bugzilla issue specified by number. Use *list-patches --bugzilla* command to get a list of available needed patches for specific issues.
+
+       *--cve* '#'::
+               Install patch fixing a MITRE's CVE issue specified by number. Use *list-patches --cve* command to get a list of available needed patches for specific issues.
+
+       *--date* 'YYYY-MM-DD'::
+               Install patches issued up to the specified date.
+
+       *-g*, *--category* 'category'::
+               Install all patches in the specified category. Use *list-patches --category* command to get a list of available patches for a specific category.
+
+       *-r*, *--repo* 'alias'|'name'|'#'|'URI'::
+               Work only with the repository specified by the alias, name, number, or URI. This option can be used multiple times.
+
+       *--skip-interactive*::
+               Skip interactive patches.
+
+       *--with-interactive*::
+               Avoid skipping of  interactive patches when in non-interactive mode.
+
+       *-l*, *--auto-agree-with-licenses*::
+               See the *update* command for description of this option.
+
+       *--no-recommends*::
+               By default, zypper installs also packages recommended by the requested ones. This option causes the recommended packages to be ignored and only the required ones to be installed.
+
+       *--replacefiles*::
+               Install the packages even if they replace files from other, already installed, packages. Default is to treat file conflicts as an error. *--download-as-needed* disables the fileconflict check because access to all packages filelists is needed in advance in order to perform the check.
+
+       *--debug-solver*::
+               Create test case for debugging of dependency resolver.
+
+       *-D*, *--dry-run*::
+               Test the update, do not actually update.
+
+
+       *--details*::
+               Show the detailed installation summary.
+
+       This command also accepts the *download-and-install* mode options described in the *install* command description.:: {nop}
+--
+
+*dist-upgrade* (*dup*) ['options']::
+       Perform a distribution upgrade. This command applies the state of (specified) repositories onto the system; upgrades (or even downgrades) installed packages to versions found in repositories, removes packages that are no longer in the repositories and pose a dependency problem for the upgrade, handles package splits and renames, etc.
+       +
+       If no repositories are specified via the *--from* option, zypper will do the upgrade with all defined repositories. This can be a problem if the system contains conflicting repositories, like repositories for two different distribution releases. This often happens if one forgets to remove an older release repository after adding a new one, say openSUSE 13.1 and openSUSE 13.2.
+       +
+       For all repositories which have the distribution version within their URL (like http://download.opensuse.org/distribution/'13.1'/repo/oss) using the *$releasever* variable instead may be helpful (http://download.opensuse.org/distribution/*$releasever*/repo/oss). The variable is per default substituted by the current distributions version ('13.1') This value can be overwritten using the *--releasever* global option. Calling *zypper --releasever 13.2*'...' will cause these repos to use the new location (http://download.opensuse.org/distribution/'13.2'/repo/oss) without need to add/remove anything. Once the *dup* is performed, *$releasever* will default to the new distribution version. See section *Repository Management* for more info about variable substitution.
+       +
+       Note: distribution upgrades in openSUSE are currently only supported between consecutive releases. To upgrade multiple releases, upgrade each consecutive release one at a time. For more details see *http://en.opensuse.org/SDB:System_upgrade* and the 'openSUSE release notes' at *http://doc.opensuse.org/release-notes/*.
++
+--
+       *--from* 'alias'|'name'|'#'|'URI'::
+               Restricts the upgrade to the specified repositories (the option can be used multiple times) only, but can satisfy dependencies also from the rest of enabled repositories.
+
+       -r, --repo alias|name|#|URI::
+               Work only with the repository specified by the alias, name, number, or URI.
+               +
+               Using --repo is 'discouraged' as it currently hides unmentioned repositories from the resolver, leading to inexpertly decisions. In the future --repo will become an alias for *--from*.
+
+       *-l*, *--auto-agree-with-licenses*::
+               Automatically say 'yes' to third party license confirmation prompt. By using this option, you choose to agree with licenses of all third-party software this command will install. This option is particularly useful for administrators installing the same set of packages on multiple machines (by an automated process) and have the licenses confirmed before.
+
+       *--no-recommends*::
+               By default, zypper installs also packages recommended by the requested ones. This option causes the recommended packages to be ignored and only the required ones to be installed.
+
+       *--replacefiles*::
+               Install the packages even if they replace files from other, already installed, packages. Default is to treat file conflicts as an error. *--download-as-needed* disables the fileconflict check because access to all packages filelists is needed in advance in order to perform the check.
+
+       *--debug-solver*::
+               Create solver test case for debugging. See the install command for details.
+
+       *-D*, *--dry-run*::
+               Test the upgrade, do not actually install or update any package. This option will add the *--test* option to the rpm commands run by the dist-upgrade command.
+
+       *--details*::
+               Show the detailed installation summary.
+
+       This command also accepts the download-and-install mode options described in the *install* command description.:: {nop}
+
+       Examples: :: {nop}
+
+               $ *zypper dup --from factory --from packman*;;
+               Upgrade the system to the lates versions provided by the 'factory' and 'packman' repositories.
+--
+
+Query Commands
+~~~~~~~~~~~~~~
+*search* (*se*) ['options'] ['querystring'|'capability']...::
+       Search for packages matching any of the given search strings. *** and '*?* wildcard' characters can be used within search strings. If the search string is enclosed in */*  (e.g. */^k.*e$/*) it's interpreted as a 'regular expression'. See the *install* command for details about how to specify a 'capability'.
+       +
+       Results of the search are printed in a table. with columns *S*+tatus+, *Name*, *Type* of package, *Version*, *Arch*+itecture+ and *Repository*. The *S*+tatus+ column can contain the following values:
++
+--
+[horizontal]
+       *i*;;   installed
+       *v*;;   a different version is installed
+       'empty';;       neither of the former cases
+--
++
+{nop}
+       The *v* status is only shown if the version or the repository matters (see *--details* or *--repo*), and the installed version  differs from the one listed or is from a repository other than specified.
+       +
+       This command accepts the following options:
++
+--
+       *--match-substrings*::
+               Matches for search strings may be partial words (default).
+
+       *--match-words*::
+               Matches for search strings may only be whole words.
+
+       *--match-exact*::
+               Searches for an exact name of the package.
+
+       *--provides*::
+               Search for packages which provide the search strings.
+
+       *--requires*::
+               Search for packages which require the search strings.
+
+       *--recommends*::
+               Search for packages which recommend the search strings.
+
+       *--suggests*::
+               Search for packages which suggest the search strings.
+
+       *--conflicts*::
+               Search for packages conflicting with the search strings.
+
+       *--obsoletes*::
+               Search for packages which obsolete the search strings.
+
+       *-n*, *--name*::
+               Useful together with dependency options, otherwise searching in package name is default.
+
+       *-f*, *--file-list*::
+               Search in file list of packages.
+
+       *-d*, *--search-descriptions*::
+               Search also in summaries and descriptions.
+
+       *-C*, *--case-sensitive*::
+               Perform case-sensitive search.
+
+       *-i*, *--installed-only*::
+               Show only packages that are already installed.
+
+       *-u*, *--uninstalled-only*::
+               Show only packages that are not currently installed.
+
+       *-t*, *--type* 'type'::
+               Search only for packages of specified type. See section *Package Types* for list of available package types. Multiple *--type* options are allowed.
+               +
+               See also the type-specific query commands like *packages*, *patterns*, etc.
+
+       *-r*, *--repo* 'alias'|'name'|'#'|'URI'::
+               Work only with the repository specified by the alias, name, number, or URI. This option can be used multiple times.
+
+       *--sort-by-name*::
+               Sort packages by name (default).
+
+       *--sort-by-repo*::
+               Sort packages by repository, not by name.
+
+       *-s*, *--details*::
+               Show all available versions of mayching packages, each version in each repository on a separate line.
+
+       *-v*, *--verbose*::
+               Like *--details* with additional information where the search has matched (useful when searching for dependencies, e.g. *--provides*).
+
+       Examples: :: {nop}
+
+               $ *zypper se \'yast+++*+++'*;;
+               Search for YaST packages (quote the string to prevent the shell from expanding the wildcard).
+
+               $ *zypper se -s --match-exact kernel-default*;;
+               Show all available versions of package kernel-default
+
+               $ *zypper se -dC --match-words RSI*;;
+               Look for RSI acronym (case-sensitively), also in summaries and descriptions.
+--
+
+*packages* (*pa*) ['options'] ['repository']...::
+       List all available packages or all packages from specified repositories. Similar to *zypper search -s -t package*.
++
+--
+       *-r*, *--repo* 'alias'|'name'|'#'|'URI'::
+               Just another means to specify repositories.
+
+       *-i*, *--installed-only*::
+               Show only installed packages.
+
+       *-u*, *--uninstalled-only*::
+               Show only packages which are not installed.
+
+       *--orphaned*::
+               Show packages which are orphaned (without repository).
+
+       *--suggested*::
+               Show packages which are suggested.
+
+       *--recommended*::
+               Show packages which are recommended.
+
+       *--unneeded*::
+               Show packages which are unneeded.
+--
+
+*patches* (*pch*) ['options'] ['repository']...::
+       List all available patches from specified repositories, including those not needed. Similar to *zypper search -s -t patch*.
++
+--
+       *-r*, *--repo* 'alias'|name'|'#'|'URI'::
+               Just another means to specify repositories.
+--
+
+*patterns* (*pt*) ['options'] ['repository']...::
+       List all available patterns or all patterns from specified repositories. Similar to *zypper search -s -t pattern*.
++
+--
+       *-r*, *--repo* 'alias'|'name'|'#'|'URI'::
+               Just another means to specify repositories.
+
+       *-i*, *--installed-only*::
+               Show only installed patterns.
+
+       *-u*, *--uninstalled-only*::
+               Show only patterns which are not installed.
+--
+
+*products* (*pd*) ['options'] ['repository']...::
+       List all available products or all products from specified repositories. Similar to *zypper search -s -t product*, but shows also the type of the product (*base*, *add-on*).
++
+--
+       *-r*, *--repo* ''alias'|'name'|'#'|'URI'::
+               Just another means to specify repositories.
+
+       *-i*, *--installed-only*::
+                       Show only installed products.
+
+       *-u*, *--uninstalled-only*::
+               Show only products which are not installed.
+--
+
+*what-provides* (*wp*) 'capability'::
+       List all packages providing the specified capability. See also the *install* command for info about specifying 'capabilities'.
++
+--
+       The command line is automatically transformed into the appropriate *search* command, e.g.: :: {nop}
+
+               $ *zypper what-provides \'zypper>1.6'*;; {nop}
+
+               $ *zypper se --provides --match-exact \'zypper>1.6'*;; {nop}
+--
+
+Repository Management
+~~~~~~~~~~~~~~~~~~~~~
+Zypper is able to work with YaST, RPM-MD (yum) software repositories, and plain directories containing .rpm files.
+
+Repositories are primarily identified using their 'URI' or 'alias'. Alias serves as a shorthand for the long URI or name of the repository. The 'name' of the repository should briefly describe the repository and is shown to the user in tables and messages. The name is not required, and if not known, the alias is shown instead. The alias is required and uniquely identifies the repository on the system.
+
+The 'alias', 'name', 'URI', or the 'number' from *zypper repos* list can be used to specify a repository as an argument of various zypper commands and options like *refresh*, *--repo*, or *--from*.
+
+Apart from the above, repositories have several other properties which can be set using the commands described in this section below, or by manually editing the repository definition files (*.repo* files, see section *FILES*).
+
+Variable substitution:
+^^^^^^^^^^^^^^^^^^^^^^
+
+You can use the following built-in variables within a *.repo* or *.service* files 'name' and 'URI' values:
+
+       *$arch*:::
+               Use this variable to refer to the system's CPU architecture.
+
+       *$basearch*:::
+               Use this variable to refer to the base architecture of the system. For example, iX86 machines have a base architecture of *i386*, while AMD64 and Intel64 have *x86_64*.
+
+       *$releasever*:::
+       *$releasever_major*:::
+       *$releasever_minor*:::
+               Use this variable to refer to the version of your openSUSE or SUSE Linux. The value is obtained from the '/product/version' XML-node in */etc/products.d/baseproduct*.
+               +
+               This is useful for related repositories like packman (*http://ftp.gwdg.de/pub/linux/packman/suse/$releasever*), which shall always fit the installed distribution, even after a distribution upgrade. To help performing a distribution upgrade, the value of *$releasever* can be overwritten using the *--releasever* global option. This way you can easily switch all repositories using *$releasever* to the new version (provided the server layouts did not change and new repos are already available).
+               +
+               In addition *$releasever_major* will be set to the leading portion up to (but not including) the 1st dot; *$releasever_minor* to the trailing portion after the 1st dot. If there's no dot in *$releasever*, *$releasever_major* is the same as *$releasever* and *$releasever_minor* is empty.
+
+       Remember to protect the *$* when using these variables on a shell command line: :::
+               zypper ar -f http://ftp.gwdg.de/pub/linux/packman/suse/*\$*{nop}releasever packman
+
+       If a variable is followed by an alphanumeric character or underscore it needs to be enclosed in *{}*: :::
+               zypper ar -f http://ftp.gwdg.de/pub/linux/packman/suse/*\${*'releasever'*}*{nop}_packman
+
+       Bash style definition of default *${*'variable'*:-*'word'*}* and alternate *${*'variable'*:+*'word'*}* values: :::
+               SLE-*${*'releasever_major'*}${*'releasever_minor'*:+*-SP-'$releasever_minor'*}*
+
+       To check where you already use *$releasever* call: :::
+               *zypper --releasever @--HERE--@ lr -u*
+
+
+Supported URI formats:
+^^^^^^^^^^^^^^^^^^^^^^
+
+       'scheme'*:* [*//*['user'[*:*'password']'*@*']'host'[*:*'port']] */*'path' [*?*'query'] [*#*'fragment']:::
+               Special characters occurring in URI components (like a '*@*' in a password) must be %-encoded ('*%40*').
+
+       CD or DVD drive:::
+               Optionally with 'devices' list for probing.
+[horizontal]
+               ;; *cd:///*
+               ;; *dvd:/subdir*'?devices=/dev/sr0,/dev/sr1'
+
+       FTP/HTTP/HTTPS directory tree:::
+               The ftp URL scheme supports absolute and relative paths to the default ftp server directory (RFC1738, Section 3.2.2). To use an absolute path, you have to prepend the path with an additional slash, what results in a */%2f* combination (second */* encoded to *%2f*) at the begin of the URL path. This is important, especially in user authenticated ftp, where the users home is usually the default directory of the server (except when the server chroots into the users home directory).
+               +
+               Explicit proxy settings may be passed via optional parameters 'proxy', 'proxyport', 'proxyuser' and 'proxypass'.
+               +
+               HTTP authentication methods to use can be defined as comma separated list via optional parameter 'auth'. Valid methods are e.g. 'basic', 'digest', 'ntlm', 'negotiate'. Note, that this list depends on the list of methods supported by the curl library.
+[horizontal]
+               ;; *ftp://user:pass@server/path/to/media/dir*
+               ;; *ftp://user:pass@server/%2fhome/user/path/to/media/dir*
+               ;; *http://user:pass@server/path*
+               ;; *https://user:pass@server/path*'?proxy=foo&proxyuser=me&proxypass=pw'
+
+       Disk volume (partition):::
+               Mandatory *device* parameter specifying the name of the block device to mount. The name of the optional 'filesystem' defaults to "auto".
+
+               ;; *hd:/subdir?device=/dev/sda1*'&filesystem=reiserfs'
+
+       Local directory tree:::
+
+               ;; *dir:/directory/name*
+
+       Media in an ISO image (loopback mounted):::
+               +
+               Mandatory *iso* parameter specifying the name of the iso file. Optional 'url' parameter specifying the URL to the directory containing the iso file. Optional 'mnt' parameter specifying the preferred attach point for the source media url. Optional 'filesystem' name of the filesystem used in the iso file. Defaults to "auto".
+[horizontal]
+               ;; *iso:/?iso=CD1.iso*'&url=nfs://server/path/to/media'
+               ;; *iso:/?iso=CD1.iso*'&url=hd:/?device=/dev/hda'
+               ;; *iso:/subdir?iso=DVD1.iso*'&url=nfs://nfs-server/directory&mnt=/nfs/attach/point&filesystem=udf'
+
+       NFS exported directory tree:::
+               To use NFSv4 either use schema 'tnfsv4://' or pass an optional parameter 'type=nfs4'. Additional 'mountoptions' can be passed as comma separated list. Defaults to "ro".
+[horizontal]
+               ;; *nfs://nfs-server/exported/path*
+               ;; *nfs://nfs-server/exported/path*'?mountoptions=ro&type=nfs4'
+               ;; *nfs4://nfs-server/exported/path*'?mountoptions=ro'
+
+       CIFS/SMB directory tree:::
+               There is no difference between cifs and smb scheme (any more). In both cases the 'cifs' filesystem is used. Additional 'mountoptions' can be passed as comma separated list. Defaults to "ro,guest". Specify "noguest" to turn off "guest". This is necessary if Samba is configured to reject guest connections.
+               +
+               Optional 'workgroup' or 'domain' parameter set the name of the workgroup. As alternative to passing 'username:password' in the URI authority the parameters 'user' and 'pass' can be used.
+[horizontal]
+               ;; *smb://servername/share/path/on/the/share*
+               ;; *cifs://usenr:passw@servername/share/path/on/the/share*'?mountoptions=ro,noguest'
+               ;; *cifs://usern:passw@servername/share/path/on/the/share*'?workgroup=mygroup'
+               ;; *cifs://servername/share/path/on/the/share*'?user=usern&pass=passw'
+
+{nop}
+~~~~~
+
+*addrepo* (*ar*) ['options'] 'URI' 'alias':: {nop}
+*addrepo* (*ar*) ['options'] 'FILE'*.repo*::
+       Add a new repository specified by URI and assign specified alias to it or specify URI to a .repo file.
+       +
+       Newly added repositories have auto-refresh disabled by default (except for repositories imported from a .repo, having the auto-refresh enabled). To enable auto-refresh, use the *--refresh* option of the *modifyrepo* command.
+       +
+       Also, this command does not automatically refresh the newly added repositories. The repositories will get refreshed when used for the first time, or you can use the *refresh* command after finishing your modifications with **repo* commands. See also *METADATA REFRESH POLICY* section for more details.
++
+--
+       *-r*, *--repo* 'file'*.repo*::
+               Read URI and alias from specified .repo file
+
+       *-t*, *--type* 'type'::
+               Type of repository (yast2, rpm-md, or plaindir) in case the autodetection fails. There are several aliases defined for these types:
+[horizontal]
+               *yast2* ;;      susetags, yast, YaST, YaST2, YAST
+               *rpm-md* ;;     repomd, rpmmd, yum, YUM
+               *plaindir*;;    Plaindir
+
+       *-d*, *--disable*::
+               Add the repository as disabled. Repositories are added as enabled by default.
+
+       *-c*, *--check*::
+               Probe given URI.
+
+       *-C*, *--nocheck*::
+               Don't probe URI, probe later during refresh.
+
+       *-n*, *--name*::
+               Specify descriptive name for the repository.
+
+       *-k*, *--keep-packages*::
+               Enable RPM files caching for the repository.
+
+       *-K*, *--no-keep-packages*::
+               Disable RPM files caching.
+
+       *-f*, *--refresh*::
+               Enable autorefresh of the repository. The autorefresh is disabled by default when adding new repositories.
+
+       Examples: :: {nop}
+
+               $ *zypper ar -c -n \'Packman 11.1 repo' http://packman.iu-bremen.de/suse/11.1 packman*;;
+               Add a HTTP repository, probe it, name it 'Packman 11.1 repo', and use 'packman' as alias.
+
+               $ *zypper ar http://download.opensuse.org/repositories/zypp:/svn/openSUSE_Factory/zypp:svn.repo*;; {nop}
+               $ *zypper ar myreposbackup.repo*;;
+               Add repositories from a .repo file.
+--
+
+*removerepo* (*rr*) ['options'] 'alias'|'name'|'#'|'URI'...::
+       Delete repositories specified by aliases, names, numbers or URIs.
++
+--
+       *--loose-auth*::
+               Ignore user authentication data in the URI
+
+       *--loose-query*::
+               Ignore query string in the URI
+--
+
+*repos* (*lr*) ['options'] ['repo']...::
+       List all defined repositories or show detailed information about those specified as arguments
+       +
+       The following data can be printed for each repository found on the sytem: '#' (repository number), 'Alias' (unique identifier), 'Name', 'Enabled' (whether the repository is enabled), 'Refresh' (whether auto-refresh is enabled for the repository), 'Priority', 'Type' (repository meta-data type: rpm-md, yast2, plaindir). Which of the data is shown is determined by command line options listed below and the main.repoListColumns setting from zypper.conf. By default, #, Alias, Name, Enabled, and Refresh is shown.
+       +
+       Repository number is a unique identifier of the repository in current set of repositories. If you add, remove or change a repository, the numbers may change. Keep that in mind when using the numbers with the repository handling commands. On the other hand, using the alias instead of the number is always safe.
+       +
+       To show detailed information about specific repositories, specify them as arguments, either by alias, name, number from simple *zypper lr*, or by URI; e.g. fB *zypper lr factory*, or *zypper lr 2*.
++
+--
+       *-e*, *--export* 'FILE'*.repo*|'-'::
+               This option causes zypper to write repository definition of all defined repositories into a single file in repo file format. If *-* is specified instead of a file name, the repositories will be written to the standard output.
+
+       *-a*, *--alias*::
+               Add alias column to the output.
+
+       *-n*, *--name*::
+               Add name column to the output.
+
+       *-u*, *--uri*::
+               Add base URI column to the output.
+
+       *-p*, *--priority*::
+               Add repository priority column to the output.
+
+       *-r*, *--refresh*::
+               Add the autorefresh column to the output.
+
+       *-d*, *--details*::
+               Show more information like URI, priority, type, etc.
+
+       *-E*, *--show-enabled-only*::
+               Show enabled repositories only.
+
+       *-U*, *--sort-by-uri*::
+               Add base URI column and sort the list it.
+
+       *-P*, *--sort-by-priority*::
+               Add repository priority column and sort the list by it.
+
+       *-A*, *--sort-by-alias*::
+               Sort the list by alias.
+
+       *-N*, *--sort-by-name*::
+               Sort the list by name.
+
+       Examples: :: {nop}
+
+               $ *zypper repos -e myreposbackup.repo* ;;
+               Backup your repository setup:
+
+               $ *zypper lr -pu* ;;
+               List repositories with their URIs and priorities:
+--
+
+*renamerepo* (*nr*) 'alias'|'name'|'#'|'URI' 'new-alias'::
+       Assign new alias to the repository specified by alias, name, number, or URI.
++
+--
+       Examples: :: {nop}
+
+               $ *zypper nr 8 myrepo* ;;
+               Rename repository 'number 8' to *myrepo* (useful if the repo has some
+               dreadful alias which is not usable on the command line).
+--
+
+*modifyrepo* (*mr*) 'options' 'alias'|'name'|'#'|'URI'...:: {nop}
+*modifyrepo* (*mr*) 'options' *--all*|*--remote*|*--local*|*--medium-type*::
+       Modify properties of repositories specified by alias, name, number, or URI or one of the aggregate options.
++
+--
+       *-e*, *--enable*::
+               Enable the repository.
+
+       *-d*, *--disable*::
+               Disable the repository.
+
+       *-r*, *--refresh*::
+               Enable auto-refresh for the repository.
+
+       *-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.
+
+       *-k*, *--keep-packages*::
+               Enable RPM files caching.
+
+       *-K*, *--no-keep-packages*::
+               Disable RPM files caching.
+
+       *-a*, *--all*::
+               Apply changes to all repositories.
+
+       *-l*, *--local*::
+               Apply changes to all local repositories.
+
+       *-t*, *--remote*::
+               Apply changes to all remote repositories (http/https/ftp).
+
+       *-m*, *--medium-type* 'type'::
+               Apply changes to repositories of specified type. The type corresponds to the repository URI scheme identifier like http, dvd, etc. You can find complete list of valid types at http://en.opensuse.org/openSUSE:Libzypp_URIs.
+
+       Examples: :: {nop}
+
+               $ *zypper mr -kt*;;
+               Enable keeping of packages for all remote repositories.
+
+               $ *zypper mr -er updates*;;
+               Enable repository 'updates' and switch on autorefresh for the repo.
+
+               $ *zypper mr -da*;;
+               Disable all repositories.
+--
+
+*refresh* (*ref*) ['alias'|'name'|'#'|'URI']...::
+       Refresh repositories specified by their alias, name, number, or URI. If no repositories are specified, all enabled repositories will be refreshed.
+       +
+       See also *METADATA REFRESH POLICY* section for more details.
++
+--
+       *-f*, *--force*::
+               Force a complete refresh of specified repositories. This option will cause both the download of raw metadata and parsing of the metadata to be forced even if everything indicates a refresh is not needed.
+
+       *-b*, *--force-build*::
+               Force only reparsing of cached metadata and rebuilding of the database. Raw metadata download will not be forced.
+
+       *-d*, *--force-download*::
+               Force only download of current copy of repository metadata. Parsing and rebuild of the database will not be forced.
+
+       *-B*, *--build-only*::
+               Only parse the metadata and build the database, don't download raw metadata into the cache. This will enable you to repair damaged database from cached data without accessing network at all.
+
+       *-D*, *--download-only*::
+               Only download the raw metadata, don't parse it or build the database.
+
+       *-s*, *--services*::
+               Refresh also services before refreshing repositories.
+--
+
+*clean* (*cc*) ['options'] ['alias'|'name'|'#'|'URI']...::
+       Clean the local caches for all known or specified repositories. By default, only caches of downloaded packages are cleaned.
++
+--
+       *-m*, *--metadata*::
+               Clean repository metadata cache instead of package cache.
+
+       *-M*, *--raw-metadata*::
+               Clean repository raw metadata cache instead of package cache.
+
+       *-a*, *--all*::
+               Clean both repository metadata and package caches.
+--
+
+Service Management
+~~~~~~~~~~~~~~~~~~
+The *services*, *addservice*, *removeservice*, *modifyservice*, and *refresh-services* commands serve for manipulating services. A service is specified by its URI and needs to have a unique alias defined (among both services and repositories).
+
+Standalone repositories (not belonging to any service) are treated like services, too. The *ls* command will list them, *ms* command will modify them, etc. Repository specific options, like *--keep-packages* are not available here, though. You can use repository handling commands to manipulate them.
+
+*addservice* (*as*) ['options'] 'URI' 'alias'::
+       Adds a service specified by *URI* to the system. The 'alias' must be unique and serves to identify the service.
+       +
+       Newly added services are not refreshed automatically. Use the *refresh-services* command to refresh them. Zypper does not access the service URI when adding the service, so the type of the services is unknown until it is refreshed.
+       +
+       This command also allows to add also ordinary repositories when used with *--type* option, where you specify the type of the repository. See the addrepo command for the list of supported repository types.
++
+--
+       *-t*, *--type* 'type'::
+               Type of the service (possible values: *ris*) in case the autodetection fails. There are several aliases defined for this type:
+[horizontal]
+               *ris* ;;        RIS, nu, NU
+
+       *-d*, *--disable*::
+               Add the service as disabled.
+
+       *-n*, *--name*::
+               Specify descriptive name for the service.
+--
+
+*removeservice* (*rs*) ['options'] 'alias'|'name'|'#'|'URI'...::
+       Remove specified service from the system. Removing a service will also remove of all of its repositories.
++
+--
+       *--loose-auth*::
+               Ignore user authentication data in the URI.
+
+       *--loose-query*::
+               Ignore query string in the URI.
+--
+
+*modifyservice* (*ms*) 'options' 'alias'|'name'|'#'|'URI':: {nop}
+*modifyservice* (*ms*) 'options' *--all*|*--remote*|*--local*|*--medium-type*::
+       Modify properties of specified services.
++
+--
+       Common Options::
+               These options are common to all types of services and repositories.
+
+       *-d*, *--disable*::
+               Disable the service (but don't remove it).
+
+       *-e*, *--enable*::
+               Enable a disabled service.
+
+       *-r*, *--refresh*::
+               Enable auto-refresh of the service.
+
+       *-R*, *--no-refresh*::
+               Disable auto-refresh of the service.
+
+       *-n*, *--name*::
+               Set a descriptive name for the service.
+
+       *-a*, *--all*::
+               Apply changes to all services.
+
+       *-l*, *--local*::
+               Apply changes to all local services.
+
+       *-t*, *--remote*::
+               Apply changes to all remote services.
+
+       *-m*, *--medium-type* 'type'::
+               Apply changes to services of specified type.
+
+       RIS Service Specific Options::
+               These options are ignored by services other than Repository Index Services.
+
+       *-i*, *--ar-to-enable* 'alias'::
+               Schedule an RIS service repository to be enabled at next service refresh.
+
+       *-I*, *--ar-to-disable* 'alias'::
+               Schedule an RIS service repository to be disabled at next service refresh.
+
+       *-j*, *--rr-to-enable* 'alias'::
+               Remove a RIS service repository to enable.
+
+       *-J*, *--rr-to-disable* "alias'::
+               Remove a RIS service repository to disable.
+
+       *-k*, *--cl-to-enable*::
+               Clear the list of RIS repositories to enable.
+
+       *-K*, *--cl-to-disable*::
+               Clear the list of RIS repositories to disable.
+--
+
+*services* (*ls*) ['options']::
+       List services defined on the system.
++
+--
+       *-u*, *--uri*::
+               Show also base URI of repositories.
+
+       *-p*, *--priority*::
+               Show also repository priority.
+
+       *-d*, *--details*::
+               Show more information like URI, priority, type.
+
+       *-r*, *--with-repos*::
+               Show also repositories belonging to the services.
+
+       *-P*, *--sort-by-priority*::
+               Sort the list by repository priority.
+
+       *-E*, *--show-enabled-only*::
+               Show enabled services only. If used together with *--with-repos* a disabled services owning (manually) enabled repositories are shown as well.
+
+       *-U*, *--sort-by-uri*::
+               Sort the list by URI.
+
+       *-N*, *--sort-by-name*::
+               Sort the list by name.
+--
+
+*refresh-services* (*refs*) ['options'] 'alias'|'name'|'#'|'URI'...::
+       Refreshing a service means executing the service's special task.
+       +
+       RIS services add, remove, or modify repositories on your system based on current content of the repository index. A differing enabled/disabled state caused by manually calling *modify-repo* on a service repository however will not be reverted unless the *--restore-status* option is used, or the repository index explicitly requests the change.
+       +
+       Services only manage defined repositories, they do not refresh them. To refresh also repositories, use *--with-repos* option or the *refresh* command.
++
+--
+       *-f*, *--force*::
+               Force a complete refresh of specified services. This option will cause both the download of raw metadata and parsing of the metadata to be forced even if everything indicates a refresh is not needed.
+
+       *-r*, *--with-repos*::
+               Refresh also the service repositories.
+
+       *-R*, *--restore-status*::
+               Also restore service repositories enabled/disabled state to the repository index default. Useful after you manually changed some service repositories enabled state.
+--
+
+Package Locks Management
+~~~~~~~~~~~~~~~~~~~~~~~~
+Package locks serve the purpose of preventing changes to the set of installed packages on the system. The locks are stored in form of a 'query' in /etc/zypp/locks file (see also locks(5)). Packages matching this query are then forbidden to change their installed status; an installed package can't be removed, not installed package can't be installed. When requesting to install or remove such locked package, you will get a dependency problem dialog.
+
+*locks* (*ll*)::
+       List currently active package locks.
+
+*addlock* (*al*) ['options'] 'package-name'...::
+       Add a package lock. Specify packages to lock by exact name or by a glob pattern using *** and '*?*' wildcard characters.
++
+--
+       *-r*, *--repo* 'alias'|'name'|'#'|'URI'::
+               Restrict the lock to the specified repository.
+
+       *-t*, *--type* 'type'::
+               Lock only packages of specified type (default: package). See section *Package Types* for list of available package types.
+--
+
+*removelock* (*rl*) ['options'] 'lock-number'|'package-name'...::
+       Remove specified package lock. Specify the lock to remove by its number obtained with *zypper locks* or by the package name.
++
+--
+       *-r*, *--repo* 'alias'|'name'|'#'|'URI'::
+               Restrict the lock to the specified repository.
+
+       *-t*, *--type* 'type'::
+               Restrict the lock to packages of specified type (default: package). See section *Package Types* for list of available package types.
+--
+
+*cleanlocks* (*cl*)::
+       Remove unused locks.
+       +
+       This command looks for locks that do not currently (with regard to repositories used) lock any package and for each such lock it asks user whether to remove it.
+
+
+Other Commands
+~~~~~~~~~~~~~~
+*versioncmp* (*vcmp*) 'version1' 'version2'::
+       Compare the versions supplied as arguments and tell whether version1 is older or newer than version2 or the two version strings match.
+       +
+       The default output is in human-friendly form. If *--terse* global option is used, the result is an integer number, negative/positive if version1 is older/newer than version2, zero if they match.
++
+--
+       *-m*, *--match*::
+               Takes missing release number as any release.
+
+               For example: :::
+
+                       $ *zypper vcmp -m 0.15.3 0.15.3-2*;;
+                       0.15.3 'matches' 0.15.3-2
+
+                       $ *zypper vcmp 0.15.3 0.15.3-2*;;
+                       0.15.3 'is older than' 0.15.3-2
+--
+
+*targetos* (*tos*)::
+       Shows the ID string of the target operating system. The string has a form of 'distroname-architecture'. The string is determined by libzypp, the 'distroname' is read from ('current-rootdir')*/etc/products.d/baseproduct* and the 'architecture' is determined from *uname* and 'CPU flags'.
+
+*licenses*::
+       Prints a report about 'licenses' and 'EULA's of installed packages to standard output.
+       +
+       First, a list of all packages and their licenses and/or EULAs is shown. This is followed by a summary, including the total number of installed packages, the number of installed packages with EULAs that required a confirmation from the user. Since the EULAs are not stored on the system and can only be read from repository metadata, the summary includes also the number of installed packages that have their counterpart in repositories. The report ends with a list of all licenses uses by the installed packages.
+       +
+       This command can be useful for companies redistributing a custom distribution (like appliances) to figure out what licenses they are bound by.
+
+*download*::
+       Download rpms specified on the commandline to a local directory.
+       +
+       Per default packages are downloaded to the libzypp package cache (*/var/cache/zypp/packages*; for non-root users *$XDG_CACHE_HOME/zypp/packages*), but this can be changed by using the global *--pkg-cache-dir* option.
+       +
+       In XML output a *<download-result>* node is written for each package zypper tried to downlad. Upon success the local path is is found in *download-result/localpath@path*.
++
+--
+       *--all-matches*::
+               Download all versions matching the commandline arguments. Otherwise only the best version of
+       each matching package is downloaded.
+
+       *--dry-run*::
+               Don't download any package, just report what would be done.
+--
+
+*source-download*::
+       Download source rpms for all installed packages to a local directory.
++
+--
+       *-d*, *--directory* 'dir'::
+               Download all source rpms to this directory. Default is */var/cache/zypper/source-download*.
+
+       *--delete*::
+               Delete extraneous source rpms in the local directory. This is the default.
+
+       *--no-delete*::
+               Do not delete extraneous source rpms.
+
+       *--status*::
+               Don't download any source rpms, but show which source rpms are missing or extraneous.
+--
+
+*ps*::
+       After each upgrade or removal of packages, there may be running processes on the system which continue to use meanwhile deleted files. *zypper ps* lists all processes using deleted files, together with the corresponding files, and a service name hint, in case it's a known service. This gives a hint which services may need to be restarted after an update. Usually programs which continue to use deleted shared libraries. The list contains the following information:
+
+[horizontal]
+       *PID*;;         ID of the process
+       *PPID*;;        ID of the parent process
+       *UID*;;         ID of the user running the process
+       *Login*;;       Login name of the user running the process
+       *Command*;;     Command used to execute the process
+       *Service*;;     Guessed name of the service. If an init script exists for this service, you can do "rcservicename restart" to restart it.
+       *Files*;;       The list of the deleted files
+
+
+GLOBAL OPTIONS
+--------------
+
+*-h*, *--help*::
+       Help. If a 'command' is specified together with *--help* option, command specific help is displayed.
+
+*-V*, *--version*::
+       Print zypper version number and exit.
+
+*-c*, *--config* 'file'::
+       Use specified zypper config file instead of the default files. Other command line options specified together with *--config* and having their counterpart in the config file are still preferred. The order of preference with *--config* is as follows:
+
+       . Command line options
+       . *--config 'file'*
+       . [*/etc/zypp/zypp.conf*] (system-wide defaults for all libzypp based applications)
+
++
+{nop}  See also *FILES* section for more information.
+
+*-v*, *--verbose*::
+       Increase verbosity. For debugging output specify this option twice.
+
+*-q*, *--quiet*::
+       Suppress normal output. Brief (esp. result notification) messages and error messages will still be printed, though. If used together with conflicting *--verbose* option, the *--verbose* option takes preference.
+
+*--*[*no-*]*color*::
+       Whether to use colors in output if tty supports it. For details see the *[color]* section in *zypper.conf*.
+
+*-A*, *--no-abbrev*::
+       Do not abbreviate text in tables. By default zypper will try to abbreviate texts in some columns so that the table fits the width of the screen. If you need to see the whole text, use this option.
+
+*-t*, *--terse*::
+       Terse output for machine consumption. Implies *--no-abbrev* and *--no-color*.
+
+*-s*, *--table-style*::
+       Specifies table style to use. Table style is identified by an integer number. TODO
+
+*-n*, *--non-interactive*::
+       Switches to non-interactive mode. In this mode zypper doesn't ask user to type answers to various prompts, but uses default answers automatically. The behaviour of this option is somewhat different than that of options like *--yes*, since zypper can answer different answers to different questions. The answers also depend on other options like *--no-gpg-checks*.
+
+*-x*, *--xmlout*::
+       Switches to XML output. This option is useful for scripts or graphical frontends using zypper.
+
+*-i*, *--ignore-unknown*::
+       Ignore unknown packages. This option is useful for scripts.
+
+*-D*, *--reposd-dir* 'dir'::
+       Use the specified directory to look for the repository definition (*.repo*) files. The default value is */etc/zypp/repos.d*.
+
+*-C*, *--cache-dir* 'dir'::
+       Use an alternative root directory for all caches. The default value is */var/cache/zypp*.
+
+*--raw-cache-dir* 'dir'::
+       Use the specified directory for storing raw copies of repository metadata files. The default value is */var/cache/zypp/raw*.
+
+*--solv-cache-dir* 'dir'::
+       Use the specified directory to store the repository metadata cache database files (solv files). The default value is */var/cache/zypp/solv*.
+
+*--pkg-cache-dir* 'dir'::
+       Use the specified directory for storing downloaded rpm packages. (see *addrepo --keep-packages*) The default value is */var/cache/zypp/packages*.
+
+*--userdata* 'string'::
+       User data is expected to be a simple string without special chars or embedded newlines and may serve as transaction id. It will be written to all install history log entries created throughout this specific zypper call. It will also be passed on to zypp plugins executed during commit. This will enable e.g. a btrfs plugin to tag created snapshots with this string. For zypper itself this string has no special meaning.
+
+Repository Options: :: {nop}
+
+*--no-gpg-checks*::
+       Ignore GPG check failures and continue. If a GPG issue occurs when using this option zypper prints and logs a warning and automatically continues without interrupting the operation. Use this option with caution, as you can easily overlook security problems by using it.
+
+*--gpg-auto-import-keys*::
+       If new repository signing key is found, do not ask what to do; trust and import it automatically. This option causes that the new key is imported also in non-interactive mode, where it would otherwise got rejected.
+
+*-p*, *--plus-repo* 'URI'::
+       Use an additional repository for this operation. The repository aliased tmp# and named by the specified URI will be added for this operation and removed at the end. You can specify this option multiple times.
+
+*--plus-content* 'tag'::
+       Additionaly use disabled repositories providing a specific keyword. Disabled repositories are refreshed and those providing the specified 'tag' keyword are temporarily endabled. To enable for example repositories which may provide additional *-debuginfo* or *-debugsource* packages use *--plus-content debug*. You can specify this option multiple times.
+
+*--disable-repositories*::
+       Do not read metadata from repositories. This option will prevent loading of packages from repositories, thus making zypper work only with the installed packages (if *--disable-system-resolvables* was not specified).
+
+*--no-refresh*::
+       Do not auto-refresh repositories (ignore the auto-refresh setting). Useful to save time when doing operations like search, if there is not a need to have a completely up to date metadata.
+
+*--no-cd*::
+       Ignore CD/DVD repositories. When this option is specified, zypper acts as if the CD/DVD repositories were not defined at all.
+
+*--no-remote*::
+       Ignore remote repositories like http, ftp, smb and similar. This makes using zypper easier when being offline. When this option is specified, zypper acts as if the remote repositories were not defined at all.
+
+*--releasever* 'version'::
+       Set the value of the *$releasever* variable in all *.repo* files (default: 'current distribution version'). This can be used to switch to new distribution repositories when performing a distribution upgrade. See section *Repository Management* and the *dist-upgrade* (*dup*) command for details.
+       +
+       To check where you already use *$releasever* call: :::
+               *zypper --releasever @--HERE--@ lr -u*
+
+Target Options: :: {nop}
+
+*-R*, *--root* 'dir'::
+       Operates on a different root directory. This option influences the location of the repos.d directory and the metadata cache directory and also causes rpm to be run with the *--root* option to do the actual installation or removal of packages. See also the *FILES* section.
+
+*--disable-system-resolvables*::
+       This option serves mainly for testing purposes. It will cause zypper to act as if there were no packages installed in the system. Use with caution as you can damage your system using this option.
+
+
+FILES
+-----
+*/etc/zypp/zypper.conf*, *$HOME/.zypper.conf*::
+       Global (system-wide) and user's configuration file for zypper. These files are read when zypper starts up and *--config* option is not used.
+       +
+       User's settings are preferred over global settings. Similarly, command line options override the settings in either of these files. To sum it up, the order of preference is as follows (from highest to lowest):
++
+--
+       . 'Command line options'
+       . *$HOME/.zypper.conf*
+       . */etc/zypp/zypper.conf*
+       . [*/etc/zypp/zypp.conf*] (system-wide defaults for all libzypp based applications)
+--
++
+{nop}  See the comments in */etc/zypp/zypper.conf* for a list and description of available options.
+
+*/etc/zypp/zypp.conf*::
+       ZYpp configuration file affecting all libzypp based applications. See the comments in the file for description of configurable properties. Many locations of files and directories listed in this section are configurable via zypp.conf. The location for this file itself can be redefined only by setting *$ZYPP_CONF* in the environment.
+
+*/etc/zypp/locks*::
+       File with package lock definitions, see 'locks(5)' manual page for details. The package lock commands (*addlock*, *removelock*, etc.) can be used to manipulate this file.
+       +
+       This file is used by all ZYpp-based applications.
+
+*/etc/zypp/repos.d*::
+       Directory containing repository definition ('\*.repo') files. You can use the Repository Management commands to manipulate these files, or you can edit them yourself. In either case, after doing the modifications, executing *zypper refresh* is strongly recommended.
+       +
+       You can use the *--reposd-dir* global option to use an alternative directory for this purpose or the *--root* option to make this directory relative to the specified root directory.
+       +
+       This directory is used by all ZYpp-based applications.
+
+*/etc/zypp/services.d*::
+       Directory containing service definition ('\*.service') files. You can use the Service Management Commands to manipulate these files, or you can edit them yourself. Running *zypper refs* is recommended after modifications have been done.
+       +
+       This directory is used by all ZYpp-based applications.
+
+*/var/cache/zypp/raw*::
+       Directory for storing raw metadata contained in repositories. Use the *--raw-cache-dir* global option to use an alternative directory for this purpose or the *--root* option to make this directory relative to the specified root directory.
+       +
+       This directory is used by all ZYpp-based applications.
+
+*/var/cache/zypp/solv*::
+       Directory containing preparsed metadata in form of 'solv' files.
+       +
+       This directory is used by all ZYpp-based applications.
+
+*/var/cache/zypp/packages*::
+       If *keeppackages* property is set for a repository (see the *modifyrepo* command), all the RPM file downloaded during installation will be kept here. See also the *clean* command for cleaning these cache directories.
+       +
+       This directory is used by all ZYpp-based applications.
+
+*/var/log/zypp/history*::
+       Installation history log.
+
+*~/.zypper_history*::
+       Command history for the zypper shell (see the *shell* command).
+
+
+EXIT CODES
+----------
+There are several exit codes defined for zypper for use e.g. within scripts. These codes are defined in header file src/zypper-main.h found in zypper source package. Codes from interval (1-5) denote an error, numbers (100-105) provide a specific information, 0 represents a normal successful run. Following is a list of these codes with descriptions.
+
+*0* - *ZYPPER_EXIT_OK*::
+       Successfull run of zypper with no special info.
+*1* - *ZYPPER_EXIT_ERR_BUG*::
+       Unexpected situation occurred, probably caused by a bug.
+*2* - *ZYPPER_EXIT_ERR_SYNTAX*::
+       zypper was invoked with an invalid command or option, or a bad syntax.
+*3* - *ZYPPER_EXIT_ERR_INVALID_ARGS*::
+       Some of provided arguments were invalid. E.g. an invalid URI was provided to the *addrepo* command.
+*4* - *ZYPPER_EXIT_ERR_ZYPP*::
+       A problem is reported by ZYPP library.
+*5* - *ZYPPER_EXIT_ERR_PRIVILEGES*::
+       User invoking zypper has insufficient privileges for specified operation.
+*6* - *ZYPPER_EXIT_NO_REPOS*::
+       No repositories are defined.
+*7* - *ZYPPER_EXIT_ZYPP_LOCKED*::
+       The ZYPP library is locked, e.g. packagekit is running.
+*100* - *ZYPPER_EXIT_INF_UPDATE_NEEDED*::
+       Returned by the patch-check command if there are patches available for installation.
+*101* - *ZYPPER_EXIT_INF_SEC_UPDATE_NEEDED*::
+       Returned by the patch-check command if there are security patches available for installation.
+*102* - *ZYPPER_EXIT_INF_REBOOT_NEEDED*::
+       Returned after a successfull installation of a patch which requires reboot of computer.
+*103* - *ZYPPER_EXIT_INF_RESTART_NEEDED*::
+       Returned after a successful installation of a patch which requires restart of the package manager itself. This means that one of patches to be installed affects the package manager itself and the command used (e.g. *zypper update*) needs to be executed once again to install any remaining patches.
+*104* - *ZYPPER_EXIT_INF_CAP_NOT_FOUND*::
+       Returned by the *install* and the *remove* command in case any of the arguments does not match any of the available (or installed) package names or other capabilities.
+*105* - *ZYPPER_EXIT_ON_SIGNAL*::
+       Returned upon exiting after receiving a SIGINT or SIGTERM.
+
+
+HOMEPAGE
+--------
+https://github.com/openSUSE/zypper
+
+AUTHORS
+-------
+....................
+Martin Vidner <mvidner@suse.cz>
+Jan Kupec <>
+Michael Andres <ma@suse.de>
+Duncan Mac-Vicar <dmacvicar@suse.de>
+Josef Reidinger <jreidinger@suse.cz>
+Stanislav Visnovsky <visnov@suse.cz>
+....................
+
+
+SEE ALSO
+--------
+locks(5), zypper-log(8), YaST2(8)
index 6221a8e..0a68545 100755 (executable)
@@ -108,6 +108,18 @@ function newchangesentry() {
   echo ""
 }
 
+function is_fast_forward() {
+  git fetch
+  test "$(git rev-list HEAD..origin/$(git name-rev --name-only HEAD) --count)" == "0"
+}
+
+is_fast_forward || {
+  Recho "!!!"
+  Recho "!!! Branch is not fast-forward. Pull changes first."
+  Recho "!!!"
+  exit 7
+}
+
 git status --porcelain | grep '^[^ ?]' | grep -v "$VERSIONFILE\|$CHANGESFILE" && {
   Becho "!!! Files other than version and changes are added to the index."
   Becho "!!! Doing dryrun..."
index 61be43b..87aae4e 100644 (file)
@@ -1,4 +1,277 @@
 -------------------------------------------------------------------
+Wed Mar 11 11:58:26 CET 2015 - ma@suse.de
+
+- patch: A date limit must ignore newer patch candidates (bnc#919709)
+- Show locked packages in zypper summary (FATE#318326,FATE#318299)
+- modify repo: Notify about volatile changes to service repos (bnc#916254)
+- ps: Change column header from 'Login' to 'User' (bnc#915461)
+- man: add missing patch --date option
+- man: mention $releasever_major/minor repo variables
+- man: Update repo variable substitution (default and alternate values)
+- version 1.11.23
+
+-------------------------------------------------------------------
+Sun Mar  8 01:13:24 CET 2015 - ma@suse.de
+
+- Update zypper-po.tar.bz2
+
+-------------------------------------------------------------------
+Thu Mar  5 01:13:23 CET 2015 - ma@suse.de
+
+- Update zypper-po.tar.bz2
+
+-------------------------------------------------------------------
+Thu Feb 26 01:13:57 CET 2015 - ma@suse.de
+
+- Update zypper-po.tar.bz2
+
+-------------------------------------------------------------------
+Sun Feb 22 01:13:25 CET 2015 - ma@suse.de
+
+- Update zypper-po.tar.bz2
+
+-------------------------------------------------------------------
+Thu Feb 19 01:13:24 CET 2015 - ma@suse.de
+
+- Update zypper-po.tar.bz2
+
+-------------------------------------------------------------------
+Sun Feb 15 01:14:11 CET 2015 - ma@suse.de
+
+- Update zypper-po.tar.bz2
+
+-------------------------------------------------------------------
+Thu Feb 12 01:14:15 CET 2015 - ma@suse.de
+
+- Update zypper-po.tar.bz2
+
+-------------------------------------------------------------------
+Sun Feb  8 01:13:23 CET 2015 - ma@suse.de
+
+- Update zypper-po.tar.bz2
+
+-------------------------------------------------------------------
+Thu Feb  5 01:14:01 CET 2015 - ma@suse.de
+
+- Update zypper-po.tar.bz2
+
+-------------------------------------------------------------------
+Sun Feb  1 01:13:21 CET 2015 - ma@suse.de
+
+- Update zypper-po.tar.bz2
+
+-------------------------------------------------------------------
+Thu Jan 29 01:13:20 CET 2015 - ma@suse.de
+
+- Update zypper-po.tar.bz2
+
+-------------------------------------------------------------------
+Sun Jan 25 01:13:25 CET 2015 - ma@suse.de
+
+- Update zypper-po.tar.bz2
+
+-------------------------------------------------------------------
+Fri Jan 23 17:14:16 CET 2015 - ma@suse.de
+
+- repos(lr): Fix wrong exit status using the --xmlout option (bnc#914258)
+- version 1.11.22
+
+-------------------------------------------------------------------
+Fri Jan 23 16:27:38 CET 2015 - ma@suse.de
+
+- Refresh plugin services on 'lr' 'ls -r' and 'ref' (bnc#893294)(FATE#318117)
+  Repositories provided by a plugin service (SUSE Manager) must always
+  be (auto-)refreshed to reflect server side changes immediately.
+- zypper.conf: new color/pkglistHighlightAttribute (bnc#914284)
+  Tune the color atrribute used for package list highlighting.
+- version 1.11.21
+
+-------------------------------------------------------------------
+Thu Jan 22 01:14:19 CET 2015 - ma@suse.de
+
+- Update zypper-po.tar.bz2
+
+-------------------------------------------------------------------
+Sun Jan 18 01:13:20 CET 2015 - ma@suse.de
+
+- Update zypper-po.tar.bz2
+
+-------------------------------------------------------------------
+Wed Jan 14 11:30:43 CET 2015 - ma@suse.de
+
+- New global option --releasever: Set the value of the $releasever
+  variable in all .repo files. This can be used to switch to new 
+  distribution repositories when performing a distribution upgrade.
+  (bnc#911658)
+- BuildRequires:  libzypp-devel >= 14.34.0
+- Clarify legacy warning (bnc#911335)
+- version 1.11.20
+
+-------------------------------------------------------------------
+Sun Jan 11 01:13:23 CET 2015 - ma@suse.de
+
+- Update zypper-po.tar.bz2
+
+-------------------------------------------------------------------
+Thu Jan  8 01:13:53 CET 2015 - ma@suse.de
+
+- Update zypper-po.tar.bz2
+
+-------------------------------------------------------------------
+Wed Jan  7 08:33:43 CET 2015 - ma@suse.de
+
+- Update zypper-po.tar.bz2
+
+-------------------------------------------------------------------
+Thu Jan  1 01:13:55 CET 2015 - ma@suse.de
+
+- Update zypper-po.tar.bz2
+
+-------------------------------------------------------------------
+Sun Dec 21 01:14:18 CET 2014 - ma@suse.de
+
+- Update zypper-po.tar.bz2
+
+-------------------------------------------------------------------
+Fri Dec 19 13:41:55 CET 2014 - ma@suse.de
+
+- info: show new product:registerflavor attribute (bnc#896224)
+- version 1.11.19
+
+-------------------------------------------------------------------
+Thu Dec 18 01:13:39 CET 2014 - ma@suse.de
+
+- Update zypper-po.tar.bz2
+
+-------------------------------------------------------------------
+Wed Dec 17 19:06:29 CET 2014 - ma@suse.de
+
+- Update zypper-po.tar.bz2
+
+-------------------------------------------------------------------
+Wed Dec 17 18:38:43 CET 2014 - ma@suse.de
+
+- Enhance 'Digest verification failed' message (FATE#315008)
+- Enhance message text when skipping repos due to an error (bnc#909244)
+- zypper.conf: fix wrong default mentioned in comment
+- zypper-log(8): Update man page
+- version 1.11.18
+
+-------------------------------------------------------------------
+Thu Dec 11 15:22:41 CET 2014 - ma@suse.de
+
+- Add --[no-]color global option
+- Fix additional spaces in zypper output and
+  new colorization code (bnc#908345)
+- properly reset auto-retry counter (bnc#906549)
+- man: improve patch description (bnc#904737)
+- version 1.11.17
+
+-------------------------------------------------------------------
+Tue Nov 11 17:12:56 CET 2014 - ma@suse.de
+
+- Warn about repositories with 'gpgcheck=0' (bnc#848054)
+- search: fix --verbose implies --details
+- Enhance 'Digest verification failed' dialog (FATE#315008)
+- Summary: quote names including spaces (bnc#903675)
+- version 1.11.16
+
+-------------------------------------------------------------------
+Mon Nov  3 15:54:47 CET 2014 - ma@suse.de
+
+- Provide missing man pages (fixes #51)
+- Create man pages from asciidoc (fixes #53)
+- Warn if legacy CLI options are used (bnc#899781)
+- version 1.11.15
+
+-------------------------------------------------------------------
+Thu Oct 16 11:03:31 CEST 2014 - ma@suse.de
+
+- Update zypper-po.tar.bz2
+
+-------------------------------------------------------------------
+Mon Oct 13 16:29:48 CEST 2014 - ma@suse.de
+
+- Update zypper-po.tar.bz2
+
+-------------------------------------------------------------------
+Sun Oct 12 01:13:20 CEST 2014 - ma@suse.de
+
+- Update zypper-po.tar.bz2 (bnc#899603)
+
+-------------------------------------------------------------------
+Fri Oct 10 16:01:39 CEST 2014 - ma@suse.de
+
+- Update zypper-po.tar.bz2
+
+-------------------------------------------------------------------
+Thu Oct  9 01:13:26 CEST 2014 - ma@suse.de
+
+- Update zypper-po.tar.bz2
+
+-------------------------------------------------------------------
+Sun Oct  5 01:15:20 CEST 2014 - ma@suse.de
+
+- Update zypper-po.tar.bz2
+
+-------------------------------------------------------------------
+Sun Sep 28 01:14:15 CEST 2014 - ma@suse.de
+
+- Update zypper-po.tar.bz2
+
+-------------------------------------------------------------------
+Thu Sep 25 17:57:51 CEST 2014 - ma@suse.de
+
+- Trigger appdata plugin when system repos have changed (bnc#866257)
+- SLE-12 (suse_version 1315) uses it's own translations set (bnc#897176)
+- version 1.11.14
+
+-------------------------------------------------------------------
+Sun Sep 21 01:13:38 CEST 2014 - ma@suse.de
+
+- Update zypper-po.tar.bz2
+
+-------------------------------------------------------------------
+Thu Sep 18 15:47:42 CEST 2014 - ma@suse.de
+
+- Update zypper-po.tar.bz2
+
+-------------------------------------------------------------------
+Fri Sep  5 13:12:04 CEST 2014 - ma@suse.de
+
+- Adapt to new zypp api (bnc#892579)
+- version 1.11.13
+
+-------------------------------------------------------------------
+Thu Sep  4 01:14:52 CEST 2014 - ma@suse.de
+
+- Update zypper-po.tar.bz2
+
+-------------------------------------------------------------------
+Fri Aug 29 15:06:07 CEST 2014 - ma@suse.de
+
+- download: use $XDG_CACHE_HOME/zypp/packages for non-root user 
+  (bnc#891515)
+- download --dry-run: list packages we would download
+- Accept -f,--force option with refresh-services(refs)
+- version 1.11.12
+
+-------------------------------------------------------------------
+Sun Aug 24 01:16:08 CEST 2014 - ma@suse.de
+
+- Update zypper-po.tar.bz2
+
+-------------------------------------------------------------------
+Thu Aug 21 01:17:35 CEST 2014 - ma@suse.de
+
+- Update zypper-po.tar.bz2
+
+-------------------------------------------------------------------
+Mon Aug 18 14:01:30 CEST 2014 - ma@suse.de
+
+- Update zypper-po.tar.bz2
+
+-------------------------------------------------------------------
 Fri Jul 25 13:08:33 CEST 2014 - ma@suse.de
 
 - Rephrase 'verify' help text (bnc#885499)
index c5b318c..1116dc1 100755 (executable)
@@ -12,4 +12,4 @@ SRCFILES=`find src \
                                 -o -name "*.cpp"`
 
 #calling xgettext with the sourcefiles
-xgettext --no-wrap --add-comments --add-location --keyword=_ --keyword=_:1,2 --keyword=__ --keyword=N_ --keyword=_PL:1,2 --foreign-user --copyright-holder="SuSE Linux Products GmbH, Nuernberg" --default-domain=zypper --output="$POTFILE" $SRCFILES
+xgettext -L C++ --boost --no-wrap --add-comments --add-location --keyword=_ --keyword=_:1,2 --keyword=__ --keyword=N_ --keyword=_PL:1,2 --foreign-user --copyright-holder="SuSE Linux GmbH, Nuernberg" --package-name=zypper --default-domain=zypper --output="$POTFILE" $SRCFILES
index 579ddf9..ff5aa47 100644 (file)
Binary files a/po/sle-zypper-po.tar.bz2 and b/po/sle-zypper-po.tar.bz2 differ
index 00340bf..3e892ab 100644 (file)
Binary files a/po/zypper-po.tar.bz2 and b/po/zypper-po.tar.bz2 differ
index 84f2269..b7a8840 100644 (file)
@@ -21,6 +21,7 @@ SET (zypper_HEADERS
   update.h
   download.h
   source-download.h
+  configtest.h
   solve-commit.h
   PackageArgs.h
   SolverRequester.h
@@ -45,6 +46,7 @@ SET( zypper_SRCS
   update.cc
   download.cc
   source-download.cc
+  configtest.cc
   solve-commit.cc
   PackageArgs.cc
   RequestFeedback.cc
@@ -72,6 +74,7 @@ SET( zypper_out_SRCS
 
 SET( zypper_utils_HEADERS
   utils/Augeas.h
+  utils/ansi.h
   utils/colors.h
   utils/console.h
   utils/getopt.h
index 7ce3a30..5e7d516 100644 (file)
@@ -86,6 +86,8 @@ namespace
       _T( SHELL_QUIT_e )       | "quit"                | "exit" | "\004";
       _T( MOO_e )              | "moo";
 
+      _T( CONFIGTEST_e)                |  "configtest";
+
       _T( RUG_PATCH_INFO_e )   | "patch-info";
       _T( RUG_PATTERN_INFO_e ) | "pattern-info";
       _T( RUG_PRODUCT_INFO_e ) | "product-info";
index 4ca3f41..c424065 100644 (file)
@@ -76,6 +76,8 @@ struct ZypperCommand
   static const ZypperCommand SHELL_QUIT;
   static const ZypperCommand MOO;
 
+  static const ZypperCommand CONFIGTEST;
+
   //!@{
   static const ZypperCommand RUG_PATCH_INFO;
   static const ZypperCommand RUG_PATTERN_INFO;
@@ -150,6 +152,8 @@ struct ZypperCommand
     SHELL_QUIT_e,
     MOO_e,
 
+    CONFIGTEST_e,
+
     RUG_PATCH_INFO_e,
     RUG_PATTERN_INFO_e,
     RUG_PRODUCT_INFO_e,
index 5851a81..dae2c16 100644 (file)
@@ -5,12 +5,11 @@
                              |__/|_|  |_|
 \*---------------------------------------------------------------------------*/
 
-#include <iostream>
-#include <unordered_map>
 extern "C"
 {
   #include <libintl.h>
 }
+#include <iostream>
 
 #include <zypp/base/Logger.h>
 #include <zypp/base/Measure.h>
@@ -27,132 +26,175 @@ extern "C"
 #endif
 #define _(MSG) ::gettext(MSG)
 
-using namespace std;
 using namespace zypp;
-
-const ConfigOption ConfigOption::MAIN_SHOW_ALIAS(ConfigOption::MAIN_SHOW_ALIAS_e);
-const ConfigOption ConfigOption::MAIN_REPO_LIST_COLUMNS(ConfigOption::MAIN_REPO_LIST_COLUMNS_e);
-const ConfigOption ConfigOption::SOLVER_INSTALL_RECOMMENDS(ConfigOption::SOLVER_INSTALL_RECOMMENDS_e);
-const ConfigOption ConfigOption::SOLVER_FORCE_RESOLUTION_COMMANDS(ConfigOption::SOLVER_FORCE_RESOLUTION_COMMANDS_e);
-const ConfigOption ConfigOption::COLOR_USE_COLORS(ConfigOption::COLOR_USE_COLORS_e);
-const ConfigOption ConfigOption::COLOR_BACKGROUND(ConfigOption::COLOR_BACKGROUND_e);
-const ConfigOption ConfigOption::COLOR_RESULT(ConfigOption::COLOR_RESULT_e);
-const ConfigOption ConfigOption::COLOR_MSG_STATUS(ConfigOption::COLOR_MSG_STATUS_e);
-const ConfigOption ConfigOption::COLOR_MSG_ERROR(ConfigOption::COLOR_MSG_ERROR_e);
-const ConfigOption ConfigOption::COLOR_MSG_WARNING(ConfigOption::COLOR_MSG_WARNING_e);
-const ConfigOption ConfigOption::COLOR_POSITIVE(ConfigOption::COLOR_POSITIVE_e);
-const ConfigOption ConfigOption::COLOR_NEGATIVE(ConfigOption::COLOR_NEGATIVE_e);
-const ConfigOption ConfigOption::COLOR_HIGHLIGHT(ConfigOption::COLOR_HIGHLIGHT_e);
-const ConfigOption ConfigOption::COLOR_PROMPT_OPTION(ConfigOption::COLOR_PROMPT_OPTION_e);
-const ConfigOption ConfigOption::COLOR_PROMPT_SHORTHAND(ConfigOption::COLOR_PROMPT_SHORTHAND_e);
-const ConfigOption ConfigOption::OBS_BASE_URL(ConfigOption::OBS_BASE_URL_e);
-const ConfigOption ConfigOption::OBS_PLATFORM(ConfigOption::OBS_PLATFORM_e);
+using std::endl;
 
 //////////////////////////////////////////////////////////////////
 namespace
 {
-  typedef std::pair<std::string,ConfigOption::Option> OptionPair;
-  /* add new options here: */
-  const std::vector<OptionPair> & optionPairs()
+  /** Color names (case insensitive) accepted in the config file. */
+  ansi::Color namedColor( std::string name_r )
   {
-    static const std::vector<OptionPair> _data = {
-      { "main/showAlias",                      ConfigOption::MAIN_SHOW_ALIAS_e                 },
-      { "main/repoListColumns",                        ConfigOption::MAIN_REPO_LIST_COLUMNS_e          },
-      { "solver/installRecommends",            ConfigOption::SOLVER_INSTALL_RECOMMENDS_e       },
-      { "solver/forceResolutionCommands",      ConfigOption::SOLVER_FORCE_RESOLUTION_COMMANDS_e},
-      { "color/useColors",                     ConfigOption::COLOR_USE_COLORS_e                },
-      { "color/background",                    ConfigOption::COLOR_BACKGROUND_e                },
-      { "color/result",                                ConfigOption::COLOR_RESULT_e                    },
-      { "color/msgStatus",                     ConfigOption::COLOR_MSG_STATUS_e                },
-      { "color/msgError",                      ConfigOption::COLOR_MSG_ERROR_e                 },
-      { "color/msgWarning",                    ConfigOption::COLOR_MSG_WARNING_e               },
-      { "color/positive",                      ConfigOption::COLOR_POSITIVE_e                  },
-      { "color/negative",                      ConfigOption::COLOR_NEGATIVE_e                  },
-      { "color/highlight",                     ConfigOption::COLOR_HIGHLIGHT_e                 },
-      { "color/promptOption",                  ConfigOption::COLOR_PROMPT_OPTION_e             },
-      { "obs/baseUrl",                         ConfigOption::OBS_BASE_URL_e                    },
-      { "obs/platform",                                ConfigOption::OBS_PLATFORM_e                    }
+    static const std::map<std::string, ansi::Color> _def =  {
+      { "black",       ansi::Color::Black              },
+      { "darkgrey",    ansi::Color::BrightBlack        },
+      { "red",         ansi::Color::Red                },
+      { "green",       ansi::Color::Green              },
+      { "brown",       ansi::Color::Yellow             },
+      { "yellow",      ansi::Color::BrightYellow       },
+      { "blue",                ansi::Color::Blue               },
+      { "magenta",     ansi::Color::Magenta            },
+      { "purple",      ansi::Color::Magenta            },
+      { "cyan",                ansi::Color::Cyan               },
+      { "grey",                ansi::Color::White              },
+      { "white",       ansi::Color::BrightWhite        },
+      { "default",     ansi::Color::Default            },
+      { "",            ansi::Color::Default            },  // matches "bold" "light" "bright" NOT ""
     };
-    return _data;
+
+    ansi::Color ret = ansi::Color::nocolor();
+
+    if ( name_r.empty() )      // "" when undefined in config file
+      return ret;
+
+    name_r = str::toLower( name_r );
+
+    if ( str::hasPrefix( name_r, "bold" ) )
+    {
+      name_r.erase( 0, 4 );
+      ret <= ansi::Color::Attr::Bright;
+    }
+    else if (str::hasPrefix( name_r, "light" ) )
+    {
+      name_r.erase( 0, 5 );
+      ret <= ansi::Color::Attr::Bright;
+    }
+    else if (str::hasPrefix( name_r, "bright" ) )
+    {
+      name_r.erase( 0, 6 );
+      ret <= ansi::Color::Attr::Bright;
+    }
+
+    auto && it = _def.find( name_r );
+    if ( it == _def.end() )
+    {
+      ERR << "Unknown color name '" << name_r << "'" << endl;
+      ret = ansi::Color::Default;
+    }
+    else
+    {
+      ret = ( it->second < ret );
+    }
+    return ret;
   }
 } // namespace
 //////////////////////////////////////////////////////////////////
+
 //////////////////////////////////////////////////////////////////
-namespace std
+namespace
 {
-  template<>
-  struct hash<ConfigOption::Option>
-  {
-    size_t operator()( const ConfigOption::Option & __s ) const
-    { return __s; }
+  enum class ConfigOption {
+    MAIN_SHOW_ALIAS,
+    MAIN_REPO_LIST_COLUMNS,
+
+    SOLVER_INSTALL_RECOMMENDS,
+    SOLVER_FORCE_RESOLUTION_COMMANDS,
+
+    COLOR_USE_COLORS,
+    COLOR_RESULT,
+    COLOR_MSG_STATUS,
+    COLOR_MSG_ERROR,
+    COLOR_MSG_WARNING,
+    COLOR_PROMPT,
+    COLOR_PROMPT_OPTION,
+    COLOR_POSITIVE,
+    COLOR_CHANGE,
+    COLOR_NEGATIVE,
+    COLOR_HIGHLIGHT,
+    COLOR_LOWLIGHT,
+    COLOR_OSDEBUG,
+
+    COLOR_PKGLISTHIGHLIGHT,
+    COLOR_PKGLISTHIGHLIGHT_ATTRIBUTE,
+
+    OBS_BASE_URL,
+    OBS_PLATFORM
   };
-} // namespace std
-//////////////////////////////////////////////////////////////////
-
-ConfigOption::ConfigOption(const std::string & strval_r)
-  : _value(parse(strval_r))
-{}
 
-ConfigOption::Option ConfigOption::parse(const std::string & strval_r)
-{
-  static std::unordered_map<std::string,ConfigOption::Option> _index = [](){
-    // index into optionPairs
-    std::unordered_map<std::string,ConfigOption::Option> data;
-    for ( const auto & p : optionPairs() )
-      data[p.first] = p.second;
-    return data;
-  }();
-
-  auto it( _index.find( strval_r ) );
-  if ( it == _index.end() )
+  const std::vector<std::pair<std::string,ConfigOption>> & optionPairs()
   {
-    ZYPP_THROW(zypp::Exception(
-      zypp::str::form(_("Unknown configuration option '%s'"), strval_r.c_str())));
+    static const std::vector<std::pair<std::string,ConfigOption>> _data = {
+      { "main/showAlias",                      ConfigOption::MAIN_SHOW_ALIAS                   },
+      { "main/repoListColumns",                        ConfigOption::MAIN_REPO_LIST_COLUMNS            },
+      { "solver/installRecommends",            ConfigOption::SOLVER_INSTALL_RECOMMENDS         },
+      { "solver/forceResolutionCommands",      ConfigOption::SOLVER_FORCE_RESOLUTION_COMMANDS  },
+
+      { "color/useColors",                     ConfigOption::COLOR_USE_COLORS                  },
+      //"color/background"                     LEGACY
+      { "color/result",                                ConfigOption::COLOR_RESULT                      },
+      { "color/msgStatus",                     ConfigOption::COLOR_MSG_STATUS                  },
+      { "color/msgError",                      ConfigOption::COLOR_MSG_ERROR                   },
+      { "color/msgWarning",                    ConfigOption::COLOR_MSG_WARNING                 },
+      { "color/prompt",                                ConfigOption::COLOR_PROMPT                      },
+      { "color/promptOption",                  ConfigOption::COLOR_PROMPT_OPTION               },
+      { "color/positive",                      ConfigOption::COLOR_POSITIVE                    },
+      { "color/change",                                ConfigOption::COLOR_CHANGE                      },
+      { "color/negative",                      ConfigOption::COLOR_NEGATIVE                    },
+      { "color/highlight",                     ConfigOption::COLOR_HIGHLIGHT                   },
+      { "color/lowlight",                      ConfigOption::COLOR_LOWLIGHT                    },
+      { "color/osdebug",                       ConfigOption::COLOR_OSDEBUG                     },
+
+      { "color/pkglistHighlight",              ConfigOption::COLOR_PKGLISTHIGHLIGHT            },
+      { "color/pkglistHighlightAttribute",     ConfigOption::COLOR_PKGLISTHIGHLIGHT_ATTRIBUTE  },
+
+      { "obs/baseUrl",                         ConfigOption::OBS_BASE_URL                      },
+      { "obs/platform",                                ConfigOption::OBS_PLATFORM                      }
+    };
+    return _data;
   }
-  return it->second;
-}
 
-string ConfigOption::asString() const
-{
-  static std::unordered_map<ConfigOption::Option,std::string> _index = [](){
-    // index into optionPairs
-    std::unordered_map<ConfigOption::Option,std::string> data;
+  std::string asString( ConfigOption value_r )
+  {
     for ( const auto & p : optionPairs() )
-      data[p.second] = p.first;
-    return data;
-  }();
-
-  auto it( _index.find( _value ) );
-  if ( it != _index.end() )
-    return it->second;
-  return string();
-}
+    {
+      if ( p.second == value_r )
+       return p.first;
+    }
+    return std::string();
+  }
 
+} // namespace
+//////////////////////////////////////////////////////////////////
 
 Config::Config()
   : repo_list_columns("anr")
   , solver_installRecommends(!ZConfig::instance().solver_onlyRequires())
-  , do_colors        (false)
-  , color_useColors  ("never")
-  , color_background (false)    // dark background
-  , color_result     ("white")  // default colors for dark background
-  , color_msgStatus  ("grey")   // if background is actually light, these
-  , color_msgError   ("red")    // colors will be overwritten in read()
-  , color_msgWarning ("purple")
-  , color_positive   ("green")
-  , color_negative   ("red")
-  , color_highlight  ("cyan")
-  , color_promptOption("grey")
+  , do_colors          (false)
+  , color_useColors    ("autodetect")
+  , color_result       (namedColor("default"))
+  , color_msgStatus    (namedColor("default"))
+  , color_msgError     (namedColor("red"))
+  , color_msgWarning   (namedColor("purple"))
+  , color_prompt       (namedColor("bold"))
+  , color_promptOption (ansi::Color::nocolor())        // follow color_prompt
+  , color_positive     (namedColor("green"))
+  , color_change       (namedColor("brown"))
+  , color_negative     (namedColor("red"))
+  , color_highlight    (namedColor("cyan"))
+  , color_lowlight     (namedColor("brown"))
+  , color_osdebug      (namedColor("default") < ansi::Color::Attr::Reverse)
+  , color_pkglistHighlight(true)
+  , color_pkglistHighlightAttribute(ansi::Color::nocolor())
   , obs_baseUrl("http://download.opensuse.org/repositories/")
   , obs_platform("openSUSE_Factory")
 {}
 
-void Config::read(const string & file)
+void Config::read( const std::string & file )
 {
   try
   {
     debug::Measure m("ReadConfig");
-    string s;
+    std::string s;
 
     Augeas augeas(file);
 
@@ -160,31 +202,31 @@ void Config::read(const string & file)
 
     // ---------------[ main ]--------------------------------------------------
 
-    s = augeas.getOption(ConfigOption::MAIN_SHOW_ALIAS.asString());
+    s = augeas.getOption(asString( ConfigOption::MAIN_SHOW_ALIAS ));
     if (!s.empty())
     {
       // using Repository::asUserString() will follow repoLabelIsAlias!
       ZConfig::instance().repoLabelIsAlias( str::strToBool(s, false) );
     }
 
-    s = augeas.getOption(ConfigOption::MAIN_REPO_LIST_COLUMNS.asString());
+    s = augeas.getOption(asString( ConfigOption::MAIN_REPO_LIST_COLUMNS ));
     if (!s.empty()) // TODO add some validation
       repo_list_columns = s;
 
     // ---------------[ solver ]------------------------------------------------
 
-    s = augeas.getOption(ConfigOption::SOLVER_INSTALL_RECOMMENDS.asString());
+    s = augeas.getOption(asString( ConfigOption::SOLVER_INSTALL_RECOMMENDS ));
     if (s.empty())
       solver_installRecommends = !ZConfig::instance().solver_onlyRequires();
     else
       solver_installRecommends = str::strToBool(s, true);
 
-    s = augeas.getOption(ConfigOption::SOLVER_FORCE_RESOLUTION_COMMANDS.asString());
+    s = augeas.getOption(asString( ConfigOption::SOLVER_FORCE_RESOLUTION_COMMANDS ));
     if (s.empty())
       solver_forceResolutionCommands.insert(ZypperCommand::REMOVE);
     else
     {
-      list<string> cmdstr;
+      std::list<std::string> cmdstr;
       str::split(s, std::back_inserter(cmdstr), ",");
       for_(c, cmdstr.begin(), cmdstr.end())
         solver_forceResolutionCommands.insert(ZypperCommand(str::trim(*c)));
@@ -193,91 +235,63 @@ void Config::read(const string & file)
 
     // ---------------[ colors ]------------------------------------------------
 
-    color_useColors = augeas.getOption(ConfigOption::COLOR_USE_COLORS.asString());
-    do_colors =
-      (color_useColors == "autodetect" && has_colors())
-      || color_useColors == "always";
-
-    ////// color/background //////
-
-    s = augeas.getOption(ConfigOption::COLOR_BACKGROUND.asString());
-    if (s == "light")
-      color_background = true;
-    else if (!s.empty() && s != "dark")
-      ERR << "invalid color/background value: " << s << endl;
-
-    Color c("");
-
-    ////// color/colorResult //////
-
-    c = Color(augeas.getOption(ConfigOption::COLOR_RESULT.asString()));
-    if (c.value().empty())
-    {
-      // set a default for light background
-      if (color_background)
-        color_result = Color("black");
-    }
-    else
-      color_result = c;
-
-    ////// color/colorMsgStatus //////
-
-    c = Color(augeas.getOption(ConfigOption::COLOR_MSG_STATUS.asString()));
-    if (c.value().empty())
+    s = augeas.getOption( asString( ConfigOption::COLOR_USE_COLORS ) );
+    if (!s.empty())
+      color_useColors = s;
+
+    do_colors = ( color_useColors == "autodetect" && has_colors() ) || color_useColors == "always";
+
+    ansi::Color c;
+    for ( const auto & el : std::initializer_list<std::pair<ansi::Color &, ConfigOption>> {
+      { color_result,          ConfigOption::COLOR_RESULT              },
+      { color_msgStatus,       ConfigOption::COLOR_MSG_STATUS          },
+      { color_msgError,                ConfigOption::COLOR_MSG_ERROR           },
+      { color_msgWarning,      ConfigOption::COLOR_MSG_WARNING         },
+      { color_prompt,          ConfigOption::COLOR_PROMPT              },
+      { color_promptOption,    ConfigOption::COLOR_PROMPT_OPTION       },
+      { color_positive,                ConfigOption::COLOR_POSITIVE            },
+      { color_change,          ConfigOption::COLOR_CHANGE              },
+      { color_negative,                ConfigOption::COLOR_NEGATIVE            },
+      { color_highlight,       ConfigOption::COLOR_HIGHLIGHT           },
+      { color_lowlight,                ConfigOption::COLOR_LOWLIGHT            },
+      { color_pkglistHighlightAttribute, ConfigOption::COLOR_PKGLISTHIGHLIGHT_ATTRIBUTE },
+    } )
     {
-      // set a default for light background
-      if (color_background)
-        color_msgStatus = Color("black");
+      c = namedColor( augeas.getOption( asString( el.second ) ) );
+      if ( c )
+       el.first = c;
+      // Fix color attributes: Default is mapped to Unchanged to allow
+      // using the ColorStreams default rather than the terminal default.
+      if ( el.second == ConfigOption::COLOR_PKGLISTHIGHLIGHT_ATTRIBUTE )       // currently the only one
+      {
+       ansi::Color & c( el.first );
+       if ( c.fg() == ansi::Color::Fg::Default )
+         c.fg( ansi::Color::Fg::Unchanged );
+       if ( c.bg() == ansi::Color::Bg::Default )
+         c.bg( ansi::Color::Bg::Unchanged );
+      }
     }
-    else
-      color_msgStatus = c;
-
-    ////// color/colorMsgError //////
-
-    c = Color(augeas.getOption(ConfigOption::COLOR_MSG_ERROR.asString()));
-    if (!c.value().empty())
-      color_msgError = c;
-
-    ////// color/colorMsgWarning //////
-
-    c = Color(augeas.getOption(ConfigOption::COLOR_MSG_WARNING.asString()));
-    if (!c.value().empty())
-      color_msgWarning = c;
-
-    ////// color/colorPositive //////
 
-    c = Color(augeas.getOption(ConfigOption::COLOR_POSITIVE.asString()));
-    if (!c.value().empty())
-      color_positive = c;
-
-    ////// color/colorNegative //////
-
-    c = Color(augeas.getOption(ConfigOption::COLOR_NEGATIVE.asString()));
-    if (!c.value().empty())
-      color_negative = c;
-
-    ////// color/highlight //////
-
-    c = Color(augeas.getOption(ConfigOption::COLOR_HIGHLIGHT.asString()));
-    if (!c.value().empty())
-      color_highlight = c;
-
-    ////// color/colorPromptOption //////
-
-    c = Color(augeas.getOption(ConfigOption::COLOR_PROMPT_OPTION.asString()));
-    if (c.value().empty())
+    s = augeas.getOption( asString( ConfigOption::COLOR_PKGLISTHIGHLIGHT ) );
+    if (!s.empty())
     {
-      // set a default for light background
-      if (color_background)
-        color_promptOption = Color("darkgrey");
+      if ( s == "all" )
+       color_pkglistHighlight = true;
+      else if ( s == "first" )
+       color_pkglistHighlight = indeterminate;
+      else if ( s == "no" )
+       color_pkglistHighlight = false;
+      else
+       WAR << "zypper.conf: color/pkglistHighlight: unknown value '" << s << "'" << endl;
     }
-    else
-      color_promptOption = c;
 
+    s = augeas.getOption("color/background");  // legacy
+    if ( !s.empty() )
+      WAR << "zypper.conf: ignore legacy option 'color/background'" << endl;
 
     // ---------------[ obs ]---------------------------------------------------
 
-    s = augeas.getOption(ConfigOption::OBS_BASE_URL.asString());
+    s = augeas.getOption(asString( ConfigOption::OBS_BASE_URL ));
     if (!s.empty())
     {
       try { obs_baseUrl = Url(s); }
@@ -287,7 +301,7 @@ void Config::read(const string & file)
       }
     }
 
-    s = augeas.getOption(ConfigOption::OBS_PLATFORM.asString());
+    s = augeas.getOption(asString( ConfigOption::OBS_PLATFORM ));
     if (!s.empty())
       obs_platform = s;
 
index 098cd79..f6f1f6c 100644 (file)
 #include <set>
 
 #include <zypp/Url.h>
+
 #include "Command.h"
 #include "utils/colors.h"
 
-class ConfigOption
-{
-public:
-  static const ConfigOption MAIN_SHOW_ALIAS;
-  static const ConfigOption MAIN_REPO_LIST_COLUMNS;
-
-  static const ConfigOption SOLVER_INSTALL_RECOMMENDS;
-  static const ConfigOption SOLVER_FORCE_RESOLUTION_COMMANDS;
-
-  static const ConfigOption COLOR_USE_COLORS;
-  static const ConfigOption COLOR_BACKGROUND;
-  static const ConfigOption COLOR_RESULT;
-  static const ConfigOption COLOR_MSG_STATUS;
-  static const ConfigOption COLOR_MSG_ERROR;
-  static const ConfigOption COLOR_MSG_WARNING;
-  static const ConfigOption COLOR_POSITIVE;
-  static const ConfigOption COLOR_NEGATIVE;
-  static const ConfigOption COLOR_HIGHLIGHT;
-  static const ConfigOption COLOR_PROMPT_OPTION;
-  static const ConfigOption COLOR_PROMPT_SHORTHAND;
-
-  static const ConfigOption OBS_BASE_URL;
-  static const ConfigOption OBS_PLATFORM;
-
-  enum Option
-  {
-    MAIN_SHOW_ALIAS_e,
-    MAIN_REPO_LIST_COLUMNS_e,
-
-    SOLVER_INSTALL_RECOMMENDS_e,
-    SOLVER_FORCE_RESOLUTION_COMMANDS_e,
-
-    COLOR_USE_COLORS_e,
-    COLOR_BACKGROUND_e,
-    COLOR_RESULT_e,
-    COLOR_MSG_STATUS_e,
-    COLOR_MSG_ERROR_e,
-    COLOR_MSG_WARNING_e,
-    COLOR_POSITIVE_e,
-    COLOR_NEGATIVE_e,
-    COLOR_HIGHLIGHT_e,
-    COLOR_PROMPT_OPTION_e,
-    COLOR_PROMPT_SHORTHAND_e,
-
-    OBS_BASE_URL_e,
-    OBS_PLATFORM_e
-  };
-
-  ConfigOption(Option option) : _value(option) {}
-
-  explicit ConfigOption(const std::string & strval_r);
-
-  Option toEnum() const { return _value; }
-
-  ConfigOption::Option parse(const std::string & strval_r);
-
-  std::string asString() const;
-
-private:
-  Option _value;
-};
-
-
 /**
  *
  */
@@ -104,20 +42,21 @@ struct Config
   /** zypper.conf: color.useColors */
   std::string color_useColors;
 
-  /**
-   * zypper.conf: color.background
-   * dark (false) or light (true)
-   */
-  bool color_background;
-
-  Color color_result;
-  Color color_msgStatus;
-  Color color_msgError;
-  Color color_msgWarning;
-  Color color_positive;
-  Color color_negative;
-  Color color_highlight;
-  Color color_promptOption;
+  ansi::Color color_result;
+  ansi::Color color_msgStatus;
+  ansi::Color color_msgError;
+  ansi::Color color_msgWarning;
+  ansi::Color color_prompt;
+  ansi::Color color_promptOption;
+  ansi::Color color_positive;
+  ansi::Color color_change;
+  ansi::Color color_negative;
+  ansi::Color color_highlight;
+  ansi::Color color_lowlight;
+  ansi::Color color_osdebug;
+
+  zypp::TriBool color_pkglistHighlight;        // true:all; indeterminate:first; false:no
+  ansi::Color   color_pkglistHighlightAttribute;
 
   /** zypper.conf: obs.baseUrl */
   zypp::Url obs_baseUrl;
index 79c5c9f..8ae3744 100644 (file)
@@ -353,6 +353,7 @@ void SolverRequester::updatePatches()
   // search twice: if there are none with restartSuggested(), retry on all
   // (in the first run, ignore_pkgmgmt == 0, in the second it is 1)
   bool any_marked = false;
+  bool dateLimit = ( _opts.date_limit != Date() );
   for (unsigned ignore_pkgmgmt = 0;
        !any_marked && ignore_pkgmgmt < 2; ++ignore_pkgmgmt)
   {
@@ -362,7 +363,22 @@ void SolverRequester::updatePatches()
       PackageSpec patch;
       patch.orig_str = (*it)->name();
       patch.parsed_cap = Capability((*it)->name());
-      if (installPatch(patch, (*it)->candidateObj(), ignore_pkgmgmt))
+
+      // bnc#919709: a date limit must ignore newer patch candidates
+      zypp::PoolItem candidateObj( (*it)->candidateObj() );
+      if ( dateLimit && asKind<Patch>(candidateObj)->timestamp() > _opts.date_limit )
+      {
+       for_( iit, (*it)->availableBegin(), (*it)->availableEnd() )
+       {
+         if ( asKind<Patch>(*iit)->timestamp() <= _opts.date_limit )
+         {
+           candidateObj = *iit;
+           break;
+         }
+       }
+      }
+
+      if (installPatch(patch, candidateObj, ignore_pkgmgmt))
         any_marked = true;
     }
 
index dc2c896..46fcbe0 100644 (file)
@@ -13,6 +13,7 @@
 #include <zypp/ZYppFactory.h>
 #include <zypp/base/LogTools.h>
 #include <zypp/base/Measure.h>
+#include <zypp/base/DtorReset.h>
 #include <zypp/ResPool.h>
 #include <zypp/Patch.h>
 #include <zypp/Package.h>
@@ -385,20 +386,48 @@ namespace
   }
 } // namespace
 ///////////////////////////////////////////////////////////////////
-void Summary::writeResolvableList(ostream & out, const ResPairSet & resolvables)
+void Summary::writeResolvableList(ostream & out, const ResPairSet & resolvables, ansi::Color color)
 {
-
   if ((_viewop & DETAILS) == 0)
   {
+    static const ColorString quoteCh( "\"", ColorContext::HIGHLIGHT );
+
+    zypp::TriBool pkglistHighlight = Zypper::instance()->config().color_pkglistHighlight;
+    ansi::Color   pkglistHighlightAttribute = Zypper::instance()->config().color_pkglistHighlightAttribute;
+    char firstCh = 0;
+
     ostringstream s;
     for (ResPairSet::const_iterator resit = resolvables.begin();
         resit != resolvables.end(); ++resit)
     {
       // name
-      s << ResPair2Name( *resit );
+      const std::string & name( ResPair2Name( *resit ) );
+      if ( name.empty() )
+       continue;
+
+      // quote names with spaces
+      bool quote = name.find_first_of( " " ) != std::string::npos;
+
+      // quote?
+      if ( quote ) s << quoteCh;
+
+      // highlight 1st char?
+      if ( pkglistHighlight || ( indeterminate(pkglistHighlight) && name[0] != firstCh ) )
+      {
+       s << ( color << pkglistHighlightAttribute << name[0] ) << name.c_str()+1;
+       if ( indeterminate(pkglistHighlight) )
+          firstCh = name[0];
+      }
+      else
+      {
+       s << name;
+      }
+
+      // quote?
+      if ( quote ) s << quoteCh;
 
       // version (if multiple versions are present)
-      if (!(_viewop & SHOW_VERSION) && multi_installed.find(resit->second->name()) != multi_installed.end())
+      if (multi_installed.find(resit->second->name()) != multi_installed.end())
       {
         if (resit->first && resit->first->edition() != resit->second->edition())
           s << "-" << resit->first->edition().asString()
@@ -508,9 +537,9 @@ void Summary::writeNewlyInstalled(ostream & out)
         "The following %d applications are going to be installed:",
         it->second.size());
     label = str::form( label.c_str(), it->second.size() );
-    out << endl << label << endl;
 
-    writeResolvableList(out, it->second);
+    out << endl << ( ColorContext::POSITIVE << label ) << endl;
+    writeResolvableList(out, it->second, ColorContext::POSITIVE);
   }
 }
 
@@ -518,7 +547,7 @@ void Summary::writeNewlyInstalled(ostream & out)
 
 void Summary::writeRemoved(ostream & out)
 {
-  ViewOptions vop = _viewop;
+  DtorReset guard( _viewop );
   unsetViewOption(SHOW_REPO); // never show repo here, it's always @System
   for_(it, _toremove.begin(), _toremove.end())
   {
@@ -549,11 +578,10 @@ void Summary::writeRemoved(ostream & out)
         "The following %d applications are going to be REMOVED:",
         it->second.size());
     label = str::form( label.c_str(), it->second.size() );
-    out << endl << label << endl;
 
-    writeResolvableList(out, it->second);
+    out << endl << ( ColorContext::NEGATIVE << label ) << endl;
+    writeResolvableList(out, it->second, ColorContext::NEGATIVE);
   }
-  _viewop = vop;
 }
 
 // --------------------------------------------------------------------------
@@ -589,9 +617,9 @@ void Summary::writeUpgraded(ostream & out)
         "The following %d applications are going to be upgraded:",
         it->second.size());
     label = str::form( label.c_str(), it->second.size() );
-    out << endl << label << endl;
 
-    writeResolvableList(out, it->second);
+    out << endl << ( ColorContext::POSITIVE << label ) << endl;
+    writeResolvableList(out, it->second, ColorContext::POSITIVE);
   }
 }
 
@@ -628,9 +656,9 @@ void Summary::writeDowngraded(ostream & out)
         "The following %d applications are going to be downgraded:",
         it->second.size());
     label = str::form( label.c_str(), it->second.size() );
-    out << endl << label << endl;
 
-    writeResolvableList(out, it->second);
+    out << endl << ( ColorContext::NEGATIVE << label ) << endl;
+    writeResolvableList(out, it->second, ColorContext::NEGATIVE);
   }
 }
 
@@ -662,14 +690,22 @@ void Summary::writeReinstalled(ostream & out)
         "The following %d products are going to be reinstalled:",
         it->second.size());
     else if (it->first == ResKind::application)
+    {
+      // Suppress 'reinstalled' message for applications.
+      // As applications don't have an edition, they are not updated
+      // if the package updates. Technically every app-package update
+      // is an 'application reinstall', because the providing package
+      // changes.
+      return;
       label = _PL(
         "The following application is going to be reinstalled:",
         "The following %d applications are going to be reinstalled:",
         it->second.size());
+    }
     label = str::form( label.c_str(), it->second.size() );
-    out << endl << label << endl;
 
-    writeResolvableList(out, it->second);
+    out << endl << ( ColorContext::CHANGE << label ) << endl;
+    writeResolvableList(out, it->second, ColorContext::CHANGE);
   }
 }
 
@@ -833,9 +869,9 @@ void Summary::writeRecommended(ostream & out)
         "The following %d recommended applications were automatically selected:",
         it->second.size());
     label = str::form( label.c_str(), it->second.size() );
-    out << endl << label << endl;
 
-    writeResolvableList(out, it->second);
+    out << endl << ( ColorContext::POSITIVE << label ) << endl;
+    writeResolvableList(out, it->second, ColorContext::POSITIVE);
   }
 
   for_(it, _noinstrec.begin(), _noinstrec.end())
@@ -877,8 +913,9 @@ void Summary::writeRecommended(ostream & out)
                     "The following %d packages are recommended, but will not be installed (only required packages will be installed):",
                     it->second.size() );
        label = str::form( label.c_str(), it->second.size() );
-       out << endl << label << endl;
-       writeResolvableList(out, notRequired);
+
+       out << endl << ( ColorContext::HIGHLIGHT << label ) << endl;
+       writeResolvableList(out, notRequired, ColorContext::HIGHLIGHT);
       }
       else
       {
@@ -887,9 +924,10 @@ void Summary::writeRecommended(ostream & out)
          label = _PL( "The following package is recommended, but will not be installed because it's unwanted (was manually removed before):",
                       "The following %d packages are recommended, but will not be installed because they are unwanted (were manually removed before):",
                       it->second.size() );
-       label = str::form( label.c_str(), it->second.size() );
-       out << endl << label << endl;
-         writeResolvableList(out, softLocked);
+         label = str::form( label.c_str(), it->second.size() );
+
+         out << endl << ( ColorContext::HIGHLIGHT << label ) << endl;
+         writeResolvableList(out, softLocked, ColorContext::HIGHLIGHT);
         }
         if ( !conflicts.empty() )
         {
@@ -897,8 +935,9 @@ void Summary::writeRecommended(ostream & out)
                       "The following %d packages are recommended, but will not be installed due to conflicts or dependency issues:",
                       it->second.size() );
          label = str::form( label.c_str(), it->second.size() );
-          out << endl << label << endl;
-          writeResolvableList(out, conflicts);
+
+         out << endl << ( ColorContext::HIGHLIGHT << label ) << endl;
+          writeResolvableList(out, conflicts, ColorContext::HIGHLIGHT);
         }
       }
     }
@@ -921,8 +960,9 @@ void Summary::writeRecommended(ostream & out)
                     "The following %d applications are recommended, but will not be installed:",
                     it->second.size() );
       label = str::form( label.c_str(), it->second.size() );
-      out << endl << label << endl;
-      writeResolvableList(out, it->second);
+
+      out << endl << ( ColorContext::HIGHLIGHT << label ) << endl;
+      writeResolvableList(out, it->second, ColorContext::HIGHLIGHT);
     }
   }
 
@@ -980,9 +1020,9 @@ void Summary::writeSuggested(ostream & out)
         "The following %d applications are suggested, but will not be installed:",
         it->second.size());
     label = str::form( label.c_str(), it->second.size() );
-    out << endl << label << endl;
 
-    writeResolvableList(out, it->second);
+    out << endl << ( ColorContext::HIGHLIGHT << label ) << endl;
+    writeResolvableList(out, it->second, ColorContext::HIGHLIGHT);
   }
 }
 
@@ -990,7 +1030,7 @@ void Summary::writeSuggested(ostream & out)
 
 void Summary::writeChangedArch(ostream & out)
 {
-  ViewOptions vop = _viewop;
+  DtorReset guard( _viewop );
   setViewOption(SHOW_ARCH); // always show arch here
   for_(it, _tochangearch.begin(), _tochangearch.end())
   {
@@ -1021,18 +1061,17 @@ void Summary::writeChangedArch(ostream & out)
         "The following %d applications are going to change architecture:",
         it->second.size());
     label = str::form( label.c_str(), it->second.size() );
-    out << endl << label << endl;
 
-    writeResolvableList(out, it->second);
+    out << endl << ( ColorContext::CHANGE << label ) << endl;
+    writeResolvableList(out, it->second, ColorContext::CHANGE);
   }
-  _viewop = vop;
 }
 
 // --------------------------------------------------------------------------
 
 void Summary::writeChangedVendor(ostream & out)
 {
-  ViewOptions vop = _viewop;
+  DtorReset guard( _viewop );
   setViewOption(SHOW_VENDOR); // always show vendor here
   for_(it, _tochangevendor.begin(), _tochangevendor.end())
   {
@@ -1063,11 +1102,10 @@ void Summary::writeChangedVendor(ostream & out)
         "The following %d applications are going to change vendor:",
         it->second.size());
     label = str::form( label.c_str(), it->second.size() );
-    out << endl << label << endl;
 
-    writeResolvableList(out, it->second);
+    out << endl << ( ColorContext::CHANGE << label ) << endl;
+    writeResolvableList(out, it->second, ColorContext::CHANGE);
   }
-  _viewop = vop;
 }
 
 // --------------------------------------------------------------------------
@@ -1084,9 +1122,9 @@ void Summary::writeUnsupported(ostream & out)
         "The following %d packages are not supported by their vendor:",
         it->second.size());
     label = str::form( label.c_str(), it->second.size() );
-    out << endl << label << endl;
 
-    writeResolvableList(out, it->second);
+    out << endl << ( ColorContext::HIGHLIGHT << label ) << endl;
+    writeResolvableList(out, it->second, ColorContext::HIGHLIGHT);
   }
 }
 
@@ -1104,9 +1142,9 @@ void Summary::writeNeedACC(ostream & out)
         "The following %d packages need additional customer contract to get support:",
         it->second.size());
     label = str::form( label.c_str(), it->second.size() );
-    out << endl << label << endl;
 
-    writeResolvableList(out, it->second);
+    out << endl << ( ColorContext::HIGHLIGHT << label ) << endl;
+    writeResolvableList(out, it->second, ColorContext::HIGHLIGHT);
   }
 }
 
@@ -1132,9 +1170,52 @@ void Summary::writeNotUpdated(std::ostream & out)
         "The following %d application updates will NOT be installed:",
         it->second.size());
     label = str::form( label.c_str(), it->second.size() );
-    out << endl << label << endl;
 
-    writeResolvableList(out, it->second);
+    out << endl << ( ColorContext::HIGHLIGHT << label ) << endl;
+    writeResolvableList(out, it->second, ColorContext::HIGHLIGHT);
+  }
+}
+
+void Summary::writeLocked(std::ostream & out)
+{
+  ResPairSet instlocks;        // locked + installed
+  ResPairSet avidents; // avaialble locked
+  ResPoolProxy selPool( ResPool::instance().proxy() );
+  for_( it, selPool.begin(), selPool.end() )
+  {
+    if ( (*it)->locked() )
+    {
+      if ( (*it)->hasInstalledObj() )
+       for_( iit, (*it)->installedBegin(), (*it)->installedEnd() )
+         instlocks.insert( ResPair( NULL, *iit ) );
+      else
+       avidents.insert( ResPair( NULL, (*it)->theObj() ) );
+    }
+  }
+  if ( ! ( instlocks.empty() && avidents.empty() ) )
+  {
+    string label = _PL(
+      "The following item is locked and will not be changed by any action:",
+      "The following %d items are locked and will not be changed by any action:",
+      ( instlocks.size() + avidents.size() )
+    );
+    label = str::form( label.c_str(), instlocks.size() + avidents.size() );
+    out << endl << ( ColorContext::HIGHLIGHT << label ) << endl;
+
+    if ( ! avidents.empty() )
+    {
+      DtorReset guard( _viewop );
+      _viewop = DEFAULT;       // always as plain name list
+      // translators: used as 'tag:' (i.e. followed by ':')
+      out << " " << _("Available") << ':' << endl;
+      writeResolvableList( out, avidents, ColorContext::HIGHLIGHT );
+    }
+    if ( ! instlocks.empty() )
+    {
+      // translators: used as 'tag:' (i.e. followed by ':')
+      out << " " << _("Installed") << ':' << endl;
+      writeResolvableList( out, instlocks, ColorContext::HIGHLIGHT );
+    }
   }
 }
 
@@ -1188,7 +1269,7 @@ void Summary::writePackageCounts(ostream & out)
   i = _toupgrade.find(ResKind::package);
   if (i != _toupgrade.end() && (count = i->second.size()) )
   {
-    fprint_color(s, str::form("%d ", count), COLOR_CONTEXT_HIGHLIGHT);
+    s << ( ColorContext::POSITIVE << count ) << " ";
     // translators: this text will be preceded by a number e.g. "5 packages to ..."
     s << _PL("package to upgrade", "packages to upgrade", count);
     gotcha = true;
@@ -1198,7 +1279,7 @@ void Summary::writePackageCounts(ostream & out)
   {
     if (gotcha)
       s << ", ";
-    fprint_color(s, str::form("%d ", count), COLOR_CONTEXT_HIGHLIGHT);
+    s << ( ColorContext::NEGATIVE << count ) << " ";
     if (gotcha)
       // translators: this text will be preceded by a number e.g. "5 to ..."
       s << _PL("to downgrade", "to downgrade", count);
@@ -1212,7 +1293,7 @@ void Summary::writePackageCounts(ostream & out)
   {
     if (gotcha)
       s << ", ";
-    fprint_color(s, str::form("%d ", count), COLOR_CONTEXT_HIGHLIGHT);
+    s << ( ColorContext::POSITIVE << count ) << " ";
     if (gotcha)
       // translators: this text will be preceded by a number e.g. "5 new"
       s << _PL("new", "new", count);
@@ -1226,7 +1307,7 @@ void Summary::writePackageCounts(ostream & out)
   {
     if (gotcha)
       s << ", ";
-    fprint_color(s, str::form("%d ", count), COLOR_CONTEXT_HIGHLIGHT);
+    s << ( ColorContext::CHANGE << count ) << " ";
     if (gotcha)
       // translators: this text will be preceded by a number e.g. "5 to ..."
       s << _PL("to reinstall", "to reinstall", count);
@@ -1240,7 +1321,7 @@ void Summary::writePackageCounts(ostream & out)
   {
     if (gotcha)
       s << ", ";
-    fprint_color(s, str::form("%d ", count), COLOR_CONTEXT_NEGATIVE);
+    s << ( ColorContext::NEGATIVE << count ) << " ";
     if (gotcha)
       // translators: this text will be preceded by a number e.g. "5 to ..."
       s << _PL("to remove", "to remove", count);
@@ -1254,7 +1335,7 @@ void Summary::writePackageCounts(ostream & out)
   {
     if (gotcha)
       s << ", ";
-    fprint_color(s, str::form("%d ", count), COLOR_CONTEXT_NEGATIVE);
+    s << ( ColorContext::CHANGE << count ) << " ";
     if (gotcha)
       // translators: this text will be preceded by a number e.g. "5 to ..."
       s << _PL("to change vendor", " to change vendor", count);
@@ -1268,7 +1349,7 @@ void Summary::writePackageCounts(ostream & out)
   {
     if (gotcha)
       s << ", ";
-    fprint_color(s, str::form("%d ", count), COLOR_CONTEXT_HIGHLIGHT);
+    s << ( ColorContext::CHANGE << count ) << " ";
     if (gotcha)
       // translators: this text will be preceded by a number e.g. "5 to ..."
       s << _PL("to change arch", "to change arch", count);
@@ -1282,7 +1363,7 @@ void Summary::writePackageCounts(ostream & out)
   {
     if (gotcha)
       s << ", ";
-    fprint_color(s, str::form("%d ", count), COLOR_CONTEXT_HIGHLIGHT);
+    s << ( ColorContext::POSITIVE << count ) << " ";
     if (gotcha)
       // translators: this text will be preceded by a number e.g. "5 new"
       s << _PL("source package", "source packages", count);
@@ -1311,6 +1392,7 @@ void Summary::dumpTo(ostream & out)
 
   _wrap_width = get_screen_width();
 
+  writeLocked(out);
   if (_viewop & SHOW_NOT_UPDATED)
     writeNotUpdated(out);
   writeNewlyInstalled(out);
index c25008a..df177fb 100644 (file)
@@ -83,6 +83,7 @@ public:
   void writeNotUpdated(std::ostream & out);
   void writePackageCounts(std::ostream & out);
   void writeDownloadAndInstalledSizeSummary(std::ostream & out);
+  void writeLocked(std::ostream & out);
 
 
   unsigned packagesToGetAndInstall() const
@@ -109,7 +110,7 @@ public:
 
 private:
   void readPool(const zypp::ResPool & pool);
-  void writeResolvableList(std::ostream & out, const ResPairSet & resolvables);
+  void writeResolvableList(std::ostream & out, const ResPairSet & resolvables, ansi::Color = ansi::Color::nocolor() );
   void writeXmlResolvableList(std::ostream & out, const KindToResPairSet & resolvables);
 
   void collectInstalledRecommends(const zypp::ResObject::constPtr & obj);
index 6f67a42..6fbcca8 100644 (file)
@@ -37,13 +37,15 @@ const char * lines[][3] = {
   { ":", "-", "+" },                                 ///< colon separated values
 };
 
-void TableRow::add (const string& s) {
+TableRow & TableRow::add (const string& s) {
   _columns.push_back (s);
+  return *this;
 }
 
-void TableRow::addDetail(const string& s)
+TableRow & TableRow::addDetail(const string& s)
 {
   _details.push_back(s);
+  return *this;
 }
 
 unsigned int TableRow::cols( void ) const {
@@ -65,8 +67,9 @@ void TableRow::dumbDumpTo (ostream &stream) const {
 
 void TableRow::dumpDetails(ostream &stream, const Table & parent) const
 {
-  unsigned int width = (parent._width > parent._screen_width)?parent._screen_width:parent._width;
-  string indent( (parent._max_width[0]+parent._max_width[1])/2, ' ' );
+  unsigned width = parent._screen_width;
+  //string indent( parent._max_width[0] + (parent._style == none ? 2 : 3), ' ' );
+  string indent( 4, ' ' );
 
   for ( vector<string>::const_iterator it = _details.begin(); it != _details.end(); ++it )
   {
@@ -101,7 +104,7 @@ void TableRow::dumpDetails(ostream &stream, const Table & parent) const
 
 void TableRow::dumpTo (ostream &stream, const Table & parent) const
 {
-  const char * vline = parent._style != none ? lines[parent._style][0] : "";
+  const char * vline = parent._style == none ? "" : lines[parent._style][0];
 
   unsigned int ssize = 0; // string size in columns
   bool seen_first = false;
@@ -129,7 +132,7 @@ void TableRow::dumpTo (ostream &stream, const Table & parent) const
         // table is wider than screen
         parent._width > parent._screen_width && (
         // the next table column would exceed the screen size
-        curpos + (int) parent._max_width[c] + (parent._style != none ? 2 : 3) >
+        curpos + (int) parent._max_width[c] + (parent._style == none ? 2 : 3) >
           parent._screen_width ||
         // or the user wishes to first break after the previous column
         parent._force_break_after == (int) (c - 1));
@@ -175,7 +178,7 @@ void TableRow::dumpTo (ostream &stream, const Table & parent) const
 
          if ( editionSep == 0 )
          {
-           fprint_color( stream, s, COLOR_CONTEXT_HIGHLIGHT );
+           stream << ( ColorContext::CHANGE << s );
          }
          else if ( editionSep == s.size() )
          {
@@ -183,8 +186,7 @@ void TableRow::dumpTo (ostream &stream, const Table & parent) const
          }
          else
          {
-           stream << s.substr( 0, editionSep );
-           fprint_color( stream, s.substr( editionSep ), COLOR_CONTEXT_HIGHLIGHT );
+           stream << s.substr( 0, editionSep ) << ( ColorContext::CHANGE << s.substr( editionSep ) );
          }
        }
        else
@@ -193,9 +195,7 @@ void TableRow::dumpTo (ostream &stream, const Table & parent) const
          editionSep = s.find( '-' );
          if ( editionSep != std::string::npos )
          {
-           stream << s.substr( 0, editionSep );
-           fprint_color( stream, "-", COLOR_CONTEXT_HIGHLIGHT );
-           stream << s.substr( editionSep+1 );
+           stream << s.substr( 0, editionSep ) << ( ColorContext::HIGHLIGHT << "-" ) << s.substr( editionSep+1 );
          }
          else  // no release part
          {
@@ -210,7 +210,7 @@ void TableRow::dumpTo (ostream &stream, const Table & parent) const
       stream.width (parent._max_width[c] - ssize);
     }
     stream << "";
-    curpos += parent._max_width[c] + (parent._style != none ? 2 : 3);
+    curpos += parent._max_width[c] + (parent._style == none ? 2 : 3);
   }
   stream << endl;
 
@@ -235,15 +235,15 @@ Table::Table()
   , _inHeader( false )
 {}
 
-void Table::add (const TableRow& tr) {
+Table & Table::add (const TableRow& tr) {
   _rows.push_back (tr);
-  updateColWidths (tr);
+  return *this;
 }
 
-void Table::setHeader (const TableHeader& tr) {
+Table & Table::setHeader (const TableHeader& tr) {
   _has_header = true;
   _header = tr;
-  updateColWidths (tr);
+  return *this;
 }
 
 void Table::allowAbbrev(unsigned column) {
@@ -254,27 +254,26 @@ void Table::allowAbbrev(unsigned column) {
   _abbrev_col[column] = true;
 }
 
-void Table::updateColWidths (const TableRow& tr) {
+void Table::updateColWidths (const TableRow& tr) const
+{
   // how much columns spearators add to the width of the table
   int sepwidth = _style == none ? 2 : 3;
   // initialize the width to -sepwidth (the first column does not have a line
   // on the left)
   _width = -sepwidth;
 
-  TableRow::container::const_iterator
-    i = tr._columns.begin (),
-    e = tr._columns.end ();
-  for (unsigned c = 0; i != e; ++i, ++c) {
-    // ensure that _max_width[c] exists
-    if (_max_col < c)
-    {
-      _max_col = c;
-      _max_width.resize (_max_col + 1);
-      _max_width[c] = 0;
-    }
+  // ensure that _max_width[col] exists
+  if ( _max_width.size() < tr._columns.size() )
+  {
+    _max_width.resize( tr._columns.size(), 0 );
+    _max_col = _max_width.size()-1;
+  }
 
-    unsigned &max = _max_width[c];
-    unsigned cur = mbs_width (*i);
+  unsigned c = 0;
+  for ( const auto & col : tr._columns )
+  {
+    unsigned &max = _max_width[c++];
+    unsigned cur = mbs_width (col);
 
     if (max < cur)
       max = cur;
@@ -306,6 +305,11 @@ void Table::dumpRule (ostream &stream) const {
 }
 
 void Table::dumpTo (ostream &stream) const {
+  // compute column sizes
+  if ( _has_header )
+    updateColWidths( _header );
+  for ( const auto & row : _rows )
+    updateColWidths( row );
 
   // reset column widths for columns that can be abbreviated
   //! \todo allow abbrev of multiple columns?
@@ -330,13 +334,8 @@ void Table::dumpTo (ostream &stream) const {
     dumpRule (stream);
   }
 
-  container::const_iterator
-    b = _rows.begin (),
-    e = _rows.end (),
-    i;
-  for (i = b; i != e; ++i) {
-    i->dumpTo (stream, *this);
-  }
+  for ( const auto & row : _rows )
+    row.dumpTo( stream, *this );
 }
 
 void Table::wrap(int force_break_after)
index acd0053..08e003e 100644 (file)
 #ifndef ZYPPER_TABULATOR_H
 #define ZYPPER_TABULATOR_H
 
+#include <iostream>
+#include <sstream>
 #include <string>
 #include <iosfwd>
+#include <set>
 #include <list>
 #include <vector>
 
 #include <zypp/base/String.h>
 
+#include "main.h"
+#include "utils/ansi.h"
+#include "utils/colors.h"
+
 using std::string;
 using std::ostream;
 using std::list;
@@ -51,9 +58,13 @@ public:
     _columns.reserve (c);
   }
 
-  void add (const string& s);
+  TableRow & add (const string& s);
+
+  TableRow & addDetail (const string& s);
 
-  void addDetail (const string& s);
+  template<class _Tp>
+  TableRow & addDetail( const _Tp & val_r )
+  { return addDetail( zypp::str::asString( val_r ) ); }
 
   // return number of columns
   unsigned int cols( void ) const;
@@ -78,8 +89,12 @@ public:
   const container & columns() const
   { return _columns; }
 
+  container & columns()
+  { return _columns; }
+
 private:
   container _columns;
+
   container _details;
 
   friend class Table;
@@ -89,16 +104,14 @@ private:
 template<class _Tp>
 TableRow & operator<<( TableRow & tr, const _Tp & val )
 {
-  tr.add( zypp::str::asString( val ) );
-  return tr;
+  return tr.add( zypp::str::asString( val ) );
 }
 
 /** \relates TableRow Add colummn. */
 template<class _Tp>
 TableRow & operator<<( TableRow && tr, const _Tp & val )
 {
-  tr.add( zypp::str::asString( val ) );
-  return tr;
+  return tr.add( zypp::str::asString( val ) );
 }
 
 class TableHeader : public TableRow {
@@ -119,8 +132,8 @@ public:
 
   static TableLineStyle defaultStyle;
 
-  void add (const TableRow& tr);
-  void setHeader (const TableHeader& tr);
+  Table & add (const TableRow& tr);
+  Table & setHeader (const TableHeader& tr);
   void dumpTo (ostream& stream) const;
   bool empty () const { return _rows.empty(); }
   void sort (unsigned by_column);       // columns start with 0...
@@ -145,18 +158,18 @@ public:
 
 private:
   void dumpRule (ostream &stream) const;
-  void updateColWidths (const TableRow& tr);
+  void updateColWidths (const TableRow& tr) const;
 
   bool _has_header;
   TableHeader _header;
   container _rows;
 
   //! maximum column index seen in this table
-  unsigned _max_col;
+  mutable unsigned _max_col;
   //! maximum width of respective columns
   mutable vector<unsigned> _max_width;
   //! table width (columns)
-  int _width;
+  mutable int _width;
   //! table line drawing style
   TableLineStyle _style;
   //! amount of space we have to print this table
@@ -204,14 +217,12 @@ namespace table
 
 inline
 Table& operator << (Table& table, const TableRow& tr) {
-  table.add (tr);
-  return table;
+  return table.add (tr);
 }
 
 inline
 Table& operator << (Table& table, const TableHeader& tr) {
-  table.setHeader (tr);
-  return table;
+  return table.setHeader (tr);
 }
 
 inline
@@ -219,6 +230,102 @@ ostream& operator << (ostream& stream, const Table& table) {
   table.dumpTo (stream);
   return stream;
 }
+
+///////////////////////////////////////////////////////////////////
+/// \class PropertyTable
+/// \brief Alligned key/value with multiline support
+/// Key       : value 1
+/// LongKey   : value 2
+/// Multiline :
+///     line 1
+///     line 2
+/// Next Key  : value 3
+///
+///////////////////////////////////////////////////////////////////
+class PropertyTable
+{
+public:
+  PropertyTable()
+  { _table.lineStyle( ::Colon ); }
+
+public:
+  ///////////////////////////////////////////////////////////////////
+  // Key / Value
+  template <class KeyType, class ValueType>
+  PropertyTable & add( const KeyType & key_r, const ValueType & val_r )
+  { _table << ( TableRow() << key_r << val_r ); return *this; }
+
+  template <class KeyType>
+  PropertyTable & add( const KeyType & key_r, bool val_r )
+  { _table << ( TableRow() << key_r << (val_r ? _("Yes") : _("No")) ); return *this; }
+
+  ///////////////////////////////////////////////////////////////////
+  // Key / Container<Value>
+  template <class KeyType, class _Iterator >
+  PropertyTable & add( const KeyType & key_r, _Iterator begin_r, _Iterator end_r )
+  {
+    TableRow r;
+    r << key_r;
+    if ( begin_r != end_r )
+    {
+      _Iterator first = begin_r++;
+      if ( begin_r != end_r )
+      {
+       unsigned cnt = 1;
+       r.addDetail( *first );  // list in details
+       while ( begin_r != end_r )
+       {
+         ++cnt;
+         r.addDetail( *(begin_r++) );
+       }
+       r << cnt;               // size as value
+      }
+      else
+       r << *first;            // only one value
+   }
+    else
+      r << "";                 // dummy to get the ":"
+    _table << r;
+    return *this;
+  }
+
+  template <class KeyType, class ContainerType>
+  PropertyTable & lst( const KeyType & key_r, const ContainerType & lst_r )
+  { return add( key_r, lst_r.begin(), lst_r.end() ); }
+
+  template <class KeyType, class ValueType>
+  PropertyTable & add( const KeyType & key_r, const std::set<ValueType> & lst_r )
+  { return lst( key_r, lst_r );  }
+  template <class KeyType, class ValueType>
+  PropertyTable & add( const KeyType & key_r, const std::list<ValueType> & lst_r )
+  { return lst( key_r, lst_r );  }
+  template <class KeyType, class ValueType>
+  PropertyTable & add( const KeyType & key_r, const std::vector<ValueType> & lst_r )
+  { return lst( key_r, lst_r ); }
+
+  ///////////////////////////////////////////////////////////////////
+  // misc
+  PropertyTable & paint( ansi::Color color_r, bool cond_r = true )
+  {
+    if ( cond_r )
+    {
+      // FIXME re-coloring like this works ony once
+      std::string & lastval( _table.rows().back().columns().back() );
+      lastval = ColorString( lastval, color_r ).str();
+    }
+    return *this;
+  }
+
+public:
+  friend std::ostream & operator << ( std::ostream & str, const PropertyTable & obj )
+  { return str << obj._table; }
+
+private:
+  Table _table;
+};
+
+
+
 // Local Variables:
 // c-basic-offset: 2
 // End:
index 1dc56a3..e4ec8b5 100644 (file)
@@ -58,6 +58,7 @@
 #include "info.h"
 #include "download.h"
 #include "source-download.h"
+#include "configtest.h"
 
 #include "output/OutNormal.h"
 #include "output/OutXML.h"
@@ -70,6 +71,60 @@ parsed_opts copts; // command options
 
 static void rug_list_resolvables(Zypper & zypper);
 
+///////////////////////////////////////////////////////////////////
+namespace {
+  /** Whether user may create \a dir_r or has rw-access to it. */
+  inline bool userMayUseDir( const Pathname & dir_r )
+  {
+    bool mayuse = true;
+    if ( dir_r.empty()  )
+      mayuse = false;
+    else
+    {
+      PathInfo pi( dir_r );
+      if ( pi.isExist() )
+      {
+       if ( ! ( pi.isDir() && pi.userMayRWX() ) )
+         mayuse = false;
+      }
+      else
+       mayuse = userMayUseDir( dir_r.dirname() );
+    }
+    return mayuse;
+  }
+
+  inline std::string legacyCLI( const std::string & old_r, const std::string & new_r, bool global_r = false )
+  {
+    return boost::str( boost::formatNAC( global_r
+                                        ? _("Legacy commandline option %1% detected. Please use global option %2% instead.")
+                                        : _("Legacy commandline option %1% detected. Please use %2% instead.") )
+                    % old_r
+                    % new_r );
+  }
+} //namespace
+///////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////
+namespace env {
+  /** XDG_CACHE_HOME: base directory relative to which user specific non-essential data files should be stored.
+   * http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
+   */
+  inline Pathname XDG_CACHE_HOME()
+  {
+    Pathname ret;
+    const char * envp = getenv( "XDG_CACHE_HOME" );
+    if ( envp && *envp )
+      ret = envp;
+    else
+    {
+      ret = getenv( "HOME" );
+      ret /= ".cache";
+    }
+    return ret;
+  }
+} //namespace env
+///////////////////////////////////////////////////////////////////
+
+
 Zypper::Zypper()
   : _argc(0), _argv(NULL), _out_ptr(NULL),
     _command(ZypperCommand::NONE),
@@ -164,6 +219,7 @@ void print_main_help(Zypper & zypper)
     "\t--quiet, -q\t\tSuppress normal output, print only error\n"
     "\t\t\t\tmessages.\n"
     "\t--verbose, -v\t\tIncrease verbosity.\n"
+    "\t--[no-]color\t\tWhether to use colors in output if tty supports it.\n"
     "\t--no-abbrev, -A\t\tDo not abbreviate text in tables.\n"
     "\t--table-style, -s\tTable style (integer).\n"
     "\t--non-interactive, -n\tDo not ask anything, use default answers\n"
@@ -195,6 +251,7 @@ void print_main_help(Zypper & zypper)
     "\t--no-refresh\t\tDo not refresh the repositories.\n"
     "\t--no-cd\t\t\tIgnore CD/DVD repositories.\n"
     "\t--no-remote\t\tIgnore remote repositories.\n"
+    "\t--releasever\t\tSet the value of $releasever in all .repo files (default: distribution version)\n"
   );
 
   static string help_global_target_options = _("     Target Options:\n"
@@ -364,6 +421,8 @@ int Zypper::defaultLoadSystem( LoadSystemFlags flags_r )
 void Zypper::processGlobalOptions()
 {
   MIL << "START" << endl;
+  static const int indeterminate = -1;
+  int optvalColor = indeterminate;
 
   static struct option global_options[] = {
     {"help",                       no_argument,       0, 'h'},
@@ -371,11 +430,12 @@ void Zypper::processGlobalOptions()
     {"quiet",                      no_argument,       0, 'q'},
     {"version",                    no_argument,       0, 'V'},
     {"promptids",                  no_argument,       0,  0 },
+    {"color",                     no_argument, &optvalColor, 1},
+    {"no-color",                  no_argument, &optvalColor, 0},
     // rug compatibility alias for -vv
     {"debug",                      no_argument,       0,  0 },
     // rug compatibility alias for the default output level => ignored
     {"normal-output",              no_argument,       0,  0 },
-    // not implemented currently => ignored
     {"terse",                      no_argument,       0, 't'},
     {"no-abbrev",                  no_argument,       0, 'A'},
     {"table-style",                required_argument, 0, 's'},
@@ -400,6 +460,7 @@ void Zypper::processGlobalOptions()
     {"no-refresh",                 no_argument,       0,  0 },
     {"no-cd",                      no_argument,       0,  0 },
     {"no-remote",                  no_argument,       0,  0 },
+    {"releasever",                 required_argument, 0,  0 },
     {"xmlout",                     no_argument,       0, 'x'},
     {"config",                     required_argument, 0, 'c'},
     {"userdata",                   required_argument, 0,  0 },
@@ -455,8 +516,20 @@ void Zypper::processGlobalOptions()
   if (gopts.count("debug"))
     verbosity = Out::DEBUG;
 
-  // create output object
+  if (gopts.count("terse"))
+  {
+    _gopts.machine_readable = true;
+    _gopts.no_abbrev = true;
+    _gopts.terse = true;
+    if ( optvalColor == indeterminate )
+      optvalColor = false;
+  }
+
+  // adjust --[no-]color from CLI
+  if ( optvalColor != indeterminate )
+    _config.do_colors = optvalColor;
 
+  // create output object
   //// --xml-out
   if (gopts.count("xmlout"))
   {
@@ -489,15 +562,21 @@ void Zypper::processGlobalOptions()
           str::form(_("Use an integer number from %d to %d"), 0, 8));
   }
 
-  if (gopts.count("terse"))
+  // ======== other global options ========
+
+  if ( (it = gopts.find( "releasever" )) != gopts.end() )
   {
-    _gopts.machine_readable = true;
-    _gopts.no_abbrev = true;
-    _gopts.terse = true;
-    //out().error("--terse is not implemented, does nothing");
+    ::setenv( "ZYPP_REPO_RELEASEVER", it->second.front().c_str(), 1 );
+  }
+  {
+    const char * env = ::getenv( "ZYPP_REPO_RELEASEVER" );
+    if ( env && *env )
+    {
+      out().warning( str::Str() << _("Enforced setting") << ": $releasever=" << env );
+      WAR << "Enforced setting: $releasever=" << env << endl;
+    }
   }
 
-  // ======== other global options ========
 
   if ( (it = gopts.find( "userdata" )) != gopts.end() )
   {
@@ -1082,8 +1161,7 @@ void Zypper::processCommandOptions()
       {"oldpackage",                no_argument,       0,  0 },
       {"replacefiles",              no_argument,       0,  0 },
       {"capability",                no_argument,       0, 'C'},
-      // rug compatibility, we have global --non-interactive
-      {"no-confirm",                no_argument,       0, 'y'},
+      {"no-confirm",                no_argument,       0, 'y'},        // rug legacy: use --non-interactive
       {"auto-agree-with-licenses",  no_argument,       0, 'l'},
       // rug compatibility, we have --auto-agree-with-licenses
       {"agree-to-third-party-licenses",  no_argument,  0,  0 },
@@ -1167,8 +1245,7 @@ void Zypper::processCommandOptions()
       // the default (ignored)
       {"name",       no_argument,       0, 'n'},
       {"capability", no_argument,       0, 'C'},
-      // rug compatibility, we have global --non-interactive
-      {"no-confirm", no_argument,       0, 'y'},
+      {"no-confirm", no_argument,       0, 'y'},       // rug legacy: use --non-interactive
       {"debug-solver", no_argument,     0, 0},
       {"no-force-resolution", no_argument, 0, 'R'},
       {"force-resolution", no_argument, 0,  0 },
@@ -1238,8 +1315,7 @@ void Zypper::processCommandOptions()
   case ZypperCommand::VERIFY_e:
   {
     static struct option verify_options[] = {
-      // rug compatibility option, we have global --non-interactive
-      {"no-confirm", no_argument, 0, 'y'},
+      {"no-confirm", no_argument, 0, 'y'},     // rug legacy: use --non-interactive
       {"dry-run", no_argument, 0, 'D'},
       // rug uses -N shorthand
       {"dry-run", no_argument, 0, 'N'},
@@ -1457,6 +1533,7 @@ void Zypper::processCommandOptions()
   case ZypperCommand::REFRESH_SERVICES_e:
   {
     static struct option options[] = {
+      {"force",                        no_argument,    0, 'f'},
       {"help",                 no_argument,    0, 'h'},
       {"with-repos",           no_argument,    0, 'r'},
       {"restore-status",       no_argument,    0, 'R'},
@@ -1469,6 +1546,7 @@ void Zypper::processCommandOptions()
       "Refresh defined repository index services.\n"
       "\n"
       "  Command options:\n"
+      "-f, --force           Force a complete refresh.\n"
       "-r, --with-repos      Refresh also the service repositories.\n"
       "-R, --restore-status  Also restore service repositories enabled/disabled state.\n"
     );
@@ -1767,9 +1845,7 @@ void Zypper::processCommandOptions()
       // rug compatibility option, we have --repo
       {"catalog",                   required_argument, 0, 'c'},
       {"type",                      required_argument, 0, 't'},
-      // rug compatibility option, we have global --non-interactive
-      // note: rug used this uption only to auto-answer the 'continue with install?' prompt.
-      {"no-confirm",                no_argument,       0, 'y'},
+      {"no-confirm",                no_argument,       0, 'y'},        // rug legacy: use --non-interactive
       {"skip-interactive",          no_argument,       0,  0 },
       {"with-interactive",          no_argument,       0,  0 },
       {"auto-agree-with-licenses",  no_argument,       0, 'l'},
@@ -2014,7 +2090,7 @@ void Zypper::processCommandOptions()
       {"type",    required_argument, 0, 't'},
       {"sort-by-name", no_argument, 0, 0},
       // rug compatibility option, we have --sort-by-repo
-      {"sort-by-catalog", no_argument, 0, 0},
+      {"sort-by-catalog", no_argument, 0, 0},          // TRANSLATED into sort-by-repo
       {"sort-by-repo", no_argument, 0, 0},
       // rug compatibility option, we have --repo
       {"catalog", required_argument, 0, 'c'},
@@ -2120,7 +2196,7 @@ void Zypper::processCommandOptions()
       {"unneeded",             no_argument,            0,  0 },
       {"sort-by-name",         no_argument,            0, 'N'},
       {"sort-by-repo",         no_argument,            0, 'R'},
-      {"sort-by-catalog",      no_argument,            0,  0 },
+      {"sort-by-catalog",      no_argument,            0,  0 },        // TRANSLATED into sort-by-repo
       {"help",                 no_argument,            0, 'h'},
       {0, 0, 0, 0}
     };
@@ -2553,8 +2629,9 @@ void Zypper::processCommandOptions()
       "\n"
       "Download rpms specified on the commandline to a local directory.\n"
       "Per default packages are downloaded to the libzypp package cache\n"
-      "(/var/cache/zypp/packages), but this can be changed by using the\n"
-      "global --pkg-cache-dir option.\n"
+      "(/var/cache/zypp/packages; for non-root users $XDG_CACHE_HOME/zypp/packages),\n"
+      "but this can be changed by using the global --pkg-cache-dir option.\n"
+      "\n"
       "In XML output a <download-result> node is written for each\n"
       "package zypper tried to downlad. Upon success the local path is\n"
       "is found in 'download-result/localpath@path'.\n"
@@ -2710,7 +2787,7 @@ void Zypper::processCommandOptions()
       {"search-descriptions", no_argument, 0, 'd'},
       {"case-sensitive", no_argument, 0, 'C'},
       {"sort-by-name", no_argument, 0, 0},
-      {"sort-by-catalog", no_argument, 0, 0},
+      {"sort-by-catalog", no_argument, 0, 0},  // TRANSLATED into sort-by-repo
       {"help", no_argument, 0, 'h'},
       {0, 0, 0, 0}
     };
@@ -2740,6 +2817,17 @@ void Zypper::processCommandOptions()
     break;
   }
 
+  case ZypperCommand::CONFIGTEST_e:
+  {
+    static struct option options[] = {
+      {"help", no_argument,     0, 'h' },
+      {0, 0, 0, 0}
+    };
+    specific_options = options;
+    _command_help = "This command is for debuging purposes only.";
+    break;
+  }
+
   default:
   {
     if (runningHelp())
@@ -2756,14 +2844,37 @@ void Zypper::processCommandOptions()
     return;
 
   // parse command options
-  ::copts = _copts = parse_options (argc(), argv(), specific_options);
-  if (copts.count("_unknown") || copts.count("_missing_arg"))
+  _copts = parse_options (argc(), argv(), specific_options);
+  if (_copts.count("_unknown") || _copts.count("_missing_arg"))
   {
     setExitCode(ZYPPER_EXIT_ERR_SYNTAX);
     ERR << "Unknown option or missing argument, returning." << endl;
     return;
   }
 
+  // RUG TRANSLATE sort-by-catalog into sort-by-repo
+  if ( _copts.count("sort-by-catalog") )
+  {
+    out().warning( legacyCLI( "--sort-by-catalog", "--sort-by-repo" ) );
+    if ( ! _copts.count("sort-by-repo") )
+      _copts["sort-by-repo"].push_back("");
+    _copts.erase("sort-by-catalog");
+  }
+
+  // RUG TRANSLATE no-confirm into non-interactive mode
+  if ( _copts.count("no-confirm") )
+  {
+    out().warning( legacyCLI( "-y/--no-confirm", "-n/--non-interactive", true/*global option*/ ) );
+    if ( ! _gopts.non_interactive )
+    {
+      out().info(_("Entering non-interactive mode."), Out::HIGH);
+      MIL << "Entering non-interactive mode" << endl;
+     _gopts.non_interactive = true;
+    }
+  }
+
+
+  ::copts = _copts;
   MIL << "Done parsing options." << endl;
 
   // treat --help command option like global --help option from now on
@@ -2909,7 +3020,8 @@ void Zypper::doCommand()
     if (runningHelp()) { out().info(_command_help, Out::QUIET); return; }
 
     initRepoManager();
-
+    if ( copts.count( "with-repos" ) )
+      checkIfToRefreshPluginServices(*this);
     list_services(*this);
 
     break;
@@ -3039,8 +3151,6 @@ void Zypper::doCommand()
       catch (const repo::RepoUnknownTypeException & e) {}
     }
 
-    warn_if_zmd();
-
     if (isservice)
       add_service_by_url(*this, url, _arguments[1], type, enabled);
     else
@@ -3133,12 +3243,8 @@ void Zypper::doCommand()
     if (runningHelp()) { out().info(_command_help, Out::QUIET); return; }
 
     initRepoManager();
-
-    //! \todo this conflicts with other 'lr' aliases
-    //if (_gopts.is_rug_compatible)
-    //  rug_list_resolvables(*this);
-    //else
-      list_repos(*this);
+    checkIfToRefreshPluginServices(*this);
+    list_repos(*this);
 
     break;
   }
@@ -3270,8 +3376,6 @@ void Zypper::doCommand()
         else if (copts.count("no-check"))
           _gopts.rm_options.probe = false;
 
-        warn_if_zmd();
-
         initRepoManager();
 
         // load gpg keys
@@ -3323,8 +3427,6 @@ void Zypper::doCommand()
       return;
     }
 
-    warn_if_zmd ();
-
     initRepoManager();
 
     if (command() == ZypperCommand::REMOVE_REPO)
@@ -3415,7 +3517,6 @@ void Zypper::doCommand()
       return;
     }
 
-    warn_if_zmd ();
     initRepoManager();
     try {
       RepoInfo repo;
@@ -3526,6 +3627,7 @@ void Zypper::doCommand()
         _("The '%s' global option has no effect here.")) % "--no-refresh"));
 
     // by default refresh only repositories
+    initRepoManager();
     if (copts.count("services"))
     {
       if (!_arguments.empty())
@@ -3539,10 +3641,12 @@ void Zypper::doCommand()
       init_target(*this);
       _gopts.rm_options.servicesTargetDistro =
             God->target()->targetDistribution();
-      initRepoManager();
       refresh_services(*this);
     }
-    initRepoManager();
+    else
+    {
+      checkIfToRefreshPluginServices(*this);
+    }
     refresh_repos(*this);
     break;
   }
@@ -3594,11 +3698,6 @@ void Zypper::doCommand()
     }
 
     // rug compatibility code
-    // switch on non-interactive mode if no-confirm specified
-    if (copts.count("no-confirm"))
-      _gopts.non_interactive = true;
-
-    // rug compatibility code
     parsed_opts::const_iterator optit;
     if ((optit = _copts.find("entire-catalog")) != _copts.end())
     {
@@ -3880,11 +3979,6 @@ void Zypper::doCommand()
       return;
     }
 
-    // rug compatibility code
-    // switch on non-interactive mode if no-confirm specified
-    if (copts.count("no-confirm"))
-      _gopts.non_interactive = true;
-
     // parse the download options to check for errors
     get_download_option(*this);
 
@@ -3916,9 +4010,6 @@ void Zypper::doCommand()
   case ZypperCommand::SEARCH_e:
   case ZypperCommand::RUG_PATCH_SEARCH_e:
   {
-    if (command() == ZypperCommand::RUG_PATCH_SEARCH)
-      _gopts.is_rug_compatible = true;
-
     if (runningHelp()) { out().info(_command_help, Out::QUIET); return; }
 
     zypp::PoolQuery query;
@@ -3995,7 +4086,7 @@ void Zypper::doCommand()
       }
     }
 
-    bool details = false;
+    bool details = _copts.count("details") || _copts.count("verbose");
     // add argument strings and attributes to query
     for ( vector<string>::const_iterator it = _arguments.begin();
           it != _arguments.end(); ++it )
@@ -4099,20 +4190,18 @@ void Zypper::doCommand()
         FillPatchesTable callback(t, inst_notinst);
         invokeOnEach(query.poolItemBegin(), query.poolItemEnd(), callback);
       }
-      else if (_gopts.is_rug_compatible || _copts.count("details") || details)
-      {
-        FillSearchTableSolvable callback(t, inst_notinst);
-        invokeOnEach(query.selectableBegin(), query.selectableEnd(), callback);
-      }
-      else if ( _copts.count("verbose") )
+      else if (_gopts.is_rug_compatible || details)
       {
         FillSearchTableSolvable callback(t, inst_notinst);
-        // Option 'verbose' shows where (e.g. in 'requires', 'name') the search has matched.
-        // Info is available from PoolQuery::const_iterator.
-        for_( it, query.begin(), query.end() )
-        {
-          callback( it );
-        }
+       if ( _copts.count("verbose") )
+       {
+         // Option 'verbose' shows where (e.g. in 'requires', 'name') the search has matched.
+         // Info is available from PoolQuery::const_iterator.
+         for_( it, query.begin(), query.end() )
+           callback( it );
+       }
+       else
+         invokeOnEach(query.selectableBegin(), query.selectableEnd(), callback);
       }
       else
       {
@@ -4131,21 +4220,21 @@ void Zypper::doCommand()
 
         if (command() == ZypperCommand::RUG_PATCH_SEARCH)
         {
-          if (copts.count("sort-by-catalog") || copts.count("sort-by-repo"))
+          if (copts.count("sort-by-repo"))
             t.sort(1);
           else
             t.sort(3); // sort by name
         }
         else if (_gopts.is_rug_compatible)
         {
-          if (copts.count("sort-by-catalog") || copts.count("sort-by-repo"))
+          if (copts.count("sort-by-repo"))
             t.sort(1);
           else
             t.sort(3); // sort by name
         }
         else if (_copts.count("details"))
         {
-          if (copts.count("sort-by-catalog") || copts.count("sort-by-repo"))
+          if (copts.count("sort-by-repo"))
             t.sort(5);
           else
             t.sort(1); // sort by name
@@ -4403,11 +4492,6 @@ void Zypper::doCommand()
       return;
     }
 
-    // rug compatibility code
-    // switch on non-interactive mode if no-confirm specified
-    if (copts.count("no-confirm"))
-      _gopts.non_interactive = true;
-
     bool skip_interactive = false;
     if (copts.count("skip-interactive"))
     {
@@ -4980,6 +5064,27 @@ void Zypper::doCommand()
       return;
     }
 
+    // Check for a usable pkg-cache-dir
+    if ( geteuid() != 0 )
+    {
+      bool mayuse = userMayUseDir( _gopts.rm_options.repoPackagesCachePath );
+      if ( ! mayuse && /* is the default path: */
+          _gopts.rm_options.repoPackagesCachePath == RepoManagerOptions( _gopts.root_dir ).repoPackagesCachePath )
+      {
+       _gopts.rm_options.repoPackagesCachePath = env::XDG_CACHE_HOME() / "zypp/packages";
+       mayuse = userMayUseDir( _gopts.rm_options.repoPackagesCachePath );
+      }
+
+      if ( ! mayuse )
+      {
+       out().error( boost::format(_("Insufficient privileges to use download directory '%s'.") )
+                    % _gopts.rm_options.repoPackagesCachePath );
+       setExitCode( ZYPPER_EXIT_ERR_PRIVILEGES );
+       return;
+      }
+    }
+
+    // go
     init_target( *this );
     initRepoManager();
     init_repos( *this );
@@ -5087,6 +5192,13 @@ void Zypper::doCommand()
     break;
   }
 
+  // Configtest debug command
+  case ZypperCommand::CONFIGTEST_e:
+  {
+    configtest( *this );
+    break;
+  }
+
   default:
     // if the program reaches this line, something went wrong
     setExitCode(ZYPPER_EXIT_ERR_BUG);
@@ -5111,6 +5223,8 @@ void Zypper::cleanup()
       remove_repo(*this, *it);
       break;
     }
+
+  _rm.reset(); // release any pending appdata trigger now.
 }
 
 void rug_list_resolvables(Zypper & zypper)
index 17f0ddd..d03a8bd 100644 (file)
@@ -67,7 +67,7 @@ namespace zypp
        if ( keyData_r.expired() )
        {
          Zypper::instance()->out().warning( boost::format(_("The gpg key signing file '%1%' has expired.")) % file_r );
-         dumpKeyInfo( colNote(), keyData_r, context );
+         dumpKeyInfo( (std::ostream&)ColorStream(std::cout,ColorContext::MSG_WARNING), keyData_r, context );
        }
        else if ( keyData_r.daysToLive() < 15 )
        {
@@ -324,22 +324,54 @@ namespace zypp
 
       virtual bool askUserToAcceptWrongDigest( const Pathname &file, const std::string &requested, const std::string &found )
       {
-        if (_gopts.no_gpg_checks)
-        {
-          WAR << boost::format(
-              "Ignoring failed digest verification for %s (expected %s, found %s).")
-              % file % requested % found << std::endl;
-          Zypper::instance()->out().warning(boost::str(boost::format(
-              _("Ignoring failed digest verification for %s (expected %s, found %s)."))
-              % file % requested % found),
-              Out::QUIET);
-          return true;
-        }
-
-       std::string question = boost::str(boost::format(
-           _("Digest verification failed for %s. Expected %s, found %s."))
-           % file.basename() % requested % found) + " " + _("Continue?");
-        return read_bool_answer(PROMPT_GPG_WRONG_DIGEST_ACCEPT, question, false);
+       Zypper & zypper = *Zypper::instance();
+       std::string unblock( found.substr( 0, 4 ) );
+
+       zypper.out().gap();
+       // translators: !!! BOOST STYLE PLACEHOLDERS ( %N% - reorder and multiple occurance is OK )
+       // translators: %1%      - a file name
+       // translators: %2%      - full path name
+       // translators: %3%, %4% - checksum strings (>60 chars), please keep them alligned
+       zypper.out().warning( boost::formatNAC(_(
+               "Digest verification failed for file '%1%'\n"
+               "[%2%]\n"
+               "\n"
+               "  expected %3%\n"
+               "  but got  %4%\n" ) )
+               % file.basename()
+               % file
+               % requested
+               % found
+       );
+
+       zypper.out().info( ColorString( ColorContext::MSG_WARNING, _(
+               "Accepting packages with wrong checksums can lead to a corrupted system "
+               "and in extreme cases even to a system compromise." ) ).str()
+       );
+       zypper.out().gap();
+
+       // translators: !!! BOOST STYLE PLACEHOLDERS ( %N% - reorder and multiple occurance is OK )
+       // translators: %1%      - abbreviated checksum (4 chars)
+       zypper.out().info( boost::formatNAC(_(
+               "However if you made certain that the file with checksum '%1%..' is secure, correct\n"
+               "and should be used within this operation, enter the first 4 characters of the checksum\n"
+               "to unblock using this file on your own risk. Empty input will discard the file.\n" ) )
+               % unblock
+       );
+
+       // translators: A prompt option
+       PromptOptions popts( unblock+"/"+_("discard"), 1 );
+       // translators: A prompt option help text
+       popts.setOptionHelp( 0, _("Unblock using this file on your own risk.") );
+       // translators: A prompt option help text
+       popts.setOptionHelp( 1, _("Discard the file.") );
+       popts.setShownCount( 1 );
+       if ( !zypper.globalOpts().non_interactive )
+         clear_keyboard_buffer();
+       // translators: A prompt text
+       zypper.out().prompt( PROMPT_GPG_WRONG_DIGEST_ACCEPT, _("Unblock or discard?"), popts );
+       int reply = get_prompt_reply( zypper, PROMPT_GPG_WRONG_DIGEST_ACCEPT, popts );
+       return( reply == 0 );
       }
 
     private:
@@ -387,7 +419,7 @@ class DigestCallbacks {
 };
 
 
-#endif // ZMD_BACKEND_KEYRINGCALLBACKS_H
+#endif // ZMART_KEYRINGCALLBACKS_H
 // Local Variables:
 // c-basic-offset: 2
 // End:
index 6e4e115..6d2ccec 100644 (file)
@@ -36,8 +36,11 @@ namespace ZmartRecipients
       bool counter_overrun(const zypp::Url & u){
         if (u==url)
         {
-          if (++counter==REPEAT_LIMIT)
+          if (++counter>=REPEAT_LIMIT)
+         {
+           counter = 0;        // reset!: next request might use the same URL again.
             return true;
+         }
         }
         else
         {
index 7cd249e..b4cf7fa 100644 (file)
@@ -51,14 +51,8 @@ struct DownloadResolvableReportReceiver : public zypp::callback::ReceiveReport<z
     Zypper::instance()->out().info(s.str());
   }
 
-  virtual bool progressDeltaDownload( int value )
-  {
-    // seems this is never called, the progress is reported by the media backend anyway
-    INT << "not impelmented" << std::endl;
-    // TranslatorExplanation This text is a progress display label e.g. "Retrieving delta [42%]"
-    //display_step( "apply-delta", ~("Retrieving delta") /*+ _delta.asString()*/, value );
-    return true;
-  }
+  // The progress is reported by the media backend
+  // virtual bool progressDeltaDownload( int value ) { return true; }
 
   virtual void problemDeltaDownload( const std::string & description )
   {
@@ -66,12 +60,7 @@ struct DownloadResolvableReportReceiver : public zypp::callback::ReceiveReport<z
   }
 
   // implementation not needed prehaps - the media backend reports the download progress
-  /*
-  virtual void finishDeltaDownload()
-  {
-    display_done ("download-resolvable", cout_v);
-  }
-  */
+  // virtual void finishDeltaDownload() { display_done ("download-resolvable", cout_v); }
 
   // Apply delta rpm:
   // - local path of downloaded delta
@@ -103,41 +92,6 @@ struct DownloadResolvableReportReceiver : public zypp::callback::ReceiveReport<z
     Zypper::instance()->out().progressEnd("apply-delta", _label_apply_delta);
   }
 
-  // Dowmload patch rpm:
-  // - path below url reported on start()
-  // - expected download size (0 if unknown)
-  // - download is interruptable
-  virtual void startPatchDownload( const zypp::Pathname & filename, const zypp::ByteCount & downloadsize )
-  {
-    _patch = filename.basename();
-    _patch_size = downloadsize;
-    std::ostringstream s;
-    s << _("Retrieving patch rpm") << ": " << _patch << ", " << _patch_size;
-    Zypper::instance()->out().info(s.str());
-  }
-
-  virtual bool progressPatchDownload( int value )
-  {
-    // seems this is never called, the progress is reported by the media backend anyway
-    INT << "not impelmented" << std::endl;
-    // TranslatorExplanation This text is a progress display label e.g. "Applying patch rpm [42%]"
-    //display_step( "apply-delta", _("Applying patch rpm") /* + _patch.asString() */, value );
-    return true;
-  }
-
-  virtual void problemPatchDownload( const std::string & description )
-  {
-    Zypper::instance()->out().error(description);
-  }
-
-  // implementation not needed prehaps - the media backend reports the download progress
-  /*
-  virtual void finishPatchDownload()
-  {
-    display_done ("apply-delta", cout_v);
-  }
-  */
-
   void fillsRhs( TermLine & outstr_r, Zypper & zypper_r, zypp::Package::constPtr pkg_r )
   {
     outstr_r.rhs << " (" << ++zypper_r.runtimeData().commit_pkg_current
@@ -185,15 +139,8 @@ struct DownloadResolvableReportReceiver : public zypp::callback::ReceiveReport<z
     zypper.runtimeData().action_rpm_download = true;
   }
 
-  // return false if the download should be aborted right now
-  virtual bool progress(int value, zypp::Resolvable::constPtr /*resolvable_ptr*/)
-  {
-    // seems this is never called, the progress is reported by the media backend anyway
-    // INT << "not impelmented" << std::endl;
-    // TranslatorExplanation This text is a progress display label e.g. "Retrieving [42%]"
-//    display_step( "download-resolvable", ~("Retrieving") /* + resolvable_ptr->name() */, value );
-    return true;
-  }
+  // The progress is reported by the media backend
+  // virtual bool progress(int value, zypp::Resolvable::constPtr /*resolvable_ptr*/) { return true; }
 
   virtual Action problem( zypp::Resolvable::constPtr resolvable_ptr, Error /*error*/, const std::string & description )
   {
index dd7ca46..1f89a62 100644 (file)
@@ -457,7 +457,7 @@ class RpmCallbacks {
     }
 };
 
-#endif // ZMD_BACKEND_RPMCALLBACKS_H
+#endif // ZMART_RPM_CALLBACKS_H
 // Local Variables:
 // mode: c++
 // c-basic-offset: 2
diff --git a/src/configtest.cc b/src/configtest.cc
new file mode 100644 (file)
index 0000000..658bfcb
--- /dev/null
@@ -0,0 +1,142 @@
+/*---------------------------------------------------------------------------*\
+                          ____  _ _ __ _ __  ___ _ _
+                         |_ / || | '_ \ '_ \/ -_) '_|
+                         /__|\_, | .__/ .__/\___|_|
+                             |__/|_|  |_|
+\*---------------------------------------------------------------------------*/
+
+#include <iostream>
+
+#include <zypp/base/LogTools.h>
+
+#include "Zypper.h"
+#include "configtest.h"
+
+#include "Table.h"
+
+using std::cout;
+using std::endl;
+
+///////////////////////////////////////////////////////////////////
+/// ConfigtestOptions
+///////////////////////////////////////////////////////////////////
+
+inline std::ostream & operator<<( std::ostream & str, const ConfigtestOptions & obj )
+{ return str << "ConfigtestOptions"; }
+
+///////////////////////////////////////////////////////////////////
+namespace
+{
+  ///////////////////////////////////////////////////////////////////
+  /// \class Configtest
+  /// \brief Implementation of configtest commands.
+  ///////////////////////////////////////////////////////////////////
+  class Configtest
+  {
+    typedef ConfigtestOptions Options;
+  public:
+    Configtest( Zypper & zypper_r )
+    : _zypper( zypper_r )
+     , _options( _zypper.commandOptionsAs<ConfigtestOptions>() )
+    { MIL << "Configtest " << _options << endl; }
+
+  public:
+    void run();
+
+  private:
+    std::string exampleLine( ansi::Color color_r ) const
+    {
+      std::string sample( " Some example text. " );
+      bool isDefault = ( color_r == ansi::Color::Default );
+      if ( isDefault )
+       *sample.begin() = *sample.rbegin() = '*';
+
+      ColorStream str( color_r );
+      str << sample
+         << ( ( isDefault ? ansi::Color(ansi::Color::White,ansi::Color::Bg::Black) : ansi::Color::Bg::Black ) << sample )
+         << ( ( isDefault ? ansi::Color(ansi::Color::Black,ansi::Color::Bg::White) : ansi::Color::Bg::White ) << sample );
+      return str.str();
+    }
+
+  private:
+    Zypper & _zypper;                          //< my Zypper
+    shared_ptr<ConfigtestOptions> _options;    //< my Options
+  };
+  ///////////////////////////////////////////////////////////////////
+
+  void Configtest::run()
+  {
+    {
+      PropertyTable p;
+      for ( const auto & el : std::initializer_list<std::pair<const char *, ansi::Color>> {
+       { "black",              ansi::Color::Black              },
+       { "darkgrey",           ansi::Color::BrightBlack        },
+
+       { "red",                ansi::Color::Red                },
+       { "lightred",           ansi::Color::BrightRed          },
+
+       { "green",              ansi::Color::Green              },
+       { "lightgreen",         ansi::Color::BrightGreen        },
+
+       { "brown",              ansi::Color::Yellow             },
+       { "yellow",             ansi::Color::BrightYellow       },
+
+       { "blue",               ansi::Color::Blue               },
+       { "lightblue",          ansi::Color::BrightBlue         },
+
+       { "purple",             ansi::Color::Magenta            },
+       { "lightpurple",        ansi::Color::BrightMagenta      },
+
+       { "cyan",               ansi::Color::Cyan               },
+       { "lightcyan",          ansi::Color::BrightCyan         },
+
+       { "grey",               ansi::Color::White              },
+       { "white",              ansi::Color::BrightWhite        },
+
+       { "default",            ansi::Color::Default            },
+       { "lightdefault",       ansi::Color::BrightDefault      },
+      } )
+      {
+       p.add( el.first, exampleLine(el.second) );
+      }
+      cout << "Known Colors:" << endl << p << endl;
+    }
+    {
+      PropertyTable p;
+      for ( const auto & el : std::initializer_list<std::pair<const char *, ansi::Color>> {
+       { "RESULT",             ColorContext::RESULT            },
+       { "MSG_STATUS",         ColorContext::MSG_STATUS        },
+       { "MSG_ERROR",          ColorContext::MSG_ERROR         },
+       { "MSG_WARNING",        ColorContext::MSG_WARNING       },
+       { "PROMPT",             ColorContext::PROMPT            },
+       { "PROMPT_OPTION",      ColorContext::PROMPT_OPTION     },
+       { "POSITIVE",           ColorContext::POSITIVE          },
+       { "CHANGE",             ColorContext::CHANGE            },
+       { "NEGATIVE",           ColorContext::NEGATIVE          },
+       { "HIGHLIGHT",          ColorContext::HIGHLIGHT         },
+       { "LOWLIGHT",           ColorContext::LOWLIGHT          },
+       { "OSDEBUG",            ColorContext::OSDEBUG           },
+       { "DEFAULT",            ColorContext::DEFAULT           },
+      } )
+      {
+       p.add( el.first, exampleLine(el.second) );
+      }
+      cout << "Color Contexts:" << endl << p << endl;
+    }
+  }
+
+} // namespace
+///////////////////////////////////////////////////////////////////
+
+int configtest( Zypper & zypper_r )
+{
+  try
+  {
+    Configtest( zypper_r ).run();
+  }
+  catch ( const Out::Error & error_r )
+  {
+    return error_r.report( zypper_r );
+  }
+  return zypper_r.exitCode();
+}
diff --git a/src/configtest.h b/src/configtest.h
new file mode 100644 (file)
index 0000000..958579e
--- /dev/null
@@ -0,0 +1,25 @@
+/*---------------------------------------------------------------------------*\
+                          ____  _ _ __ _ __  ___ _ _
+                         |_ / || | '_ \ '_ \/ -_) '_|
+                         /__|\_, | .__/ .__/\___|_|
+                             |__/|_|  |_|
+\*---------------------------------------------------------------------------*/
+#ifndef ZYPPER_CONFIGTEST_H
+#define ZYPPER_CONFIGTEST_H
+
+class Zypper;
+
+///////////////////////////////////////////////////////////////////
+/// \class ConfigtestOptions
+/// \brief \ref Configtest specific options
+///////////////////////////////////////////////////////////////////
+struct ConfigtestOptions : public Options
+{};
+///////////////////////////////////////////////////////////////////
+
+/** Configtest debug command
+ * \returns zypper.exitCode
+ */
+int configtest( Zypper & zypper_r );
+
+#endif // ZYPPER_CONFIGTEST_H
index 22f669a..f247cd2 100644 (file)
@@ -197,6 +197,12 @@ namespace
            if ( _zypper.exitRequested() )
              throw( Out::Error( ZYPPER_EXIT_ON_SIGNAL ) );
          }
+         else
+         {
+           _zypper.out().info( str::Str()
+                               << boost::str( boost::format(_("Not downloading package '%s'.") ) % pi.satSolvable().asUserString() )
+                               << " (--dry-run)" );
+         }
        }
        else
        {
index 62153ea..03b9159 100644 (file)
@@ -68,6 +68,14 @@ namespace
     for ( auto && cap : pi_r->dep( dep_r ) )
     { cout << "  " << cap << endl; }
   }
+
+  inline std::ostream & appendWord( std::ostream & str, const std::string & word_r )
+  {
+    if ( word_r.empty() )
+      return str;
+    return str << " " << word_r;
+  }
+
 } // namespace out
 ///////////////////////////////////////////////////////////////////
 
@@ -161,7 +169,7 @@ void printInfo(Zypper & zypper, const ResKind & kind)
  * <p>
  * Generates output like this:
 <pre>
-Catalog: system
+Repository: system
 Name: gvim
 Version: 6.4.6-19
 Arch: x86_64
@@ -190,7 +198,7 @@ void printPkgInfo(Zypper & zypper, const ui::Selectable & s)
       theone = installed;
   }
 
-  cout << (zypper.globalOpts().is_rug_compatible ? _("Catalog: ") : _("Repository: "))
+  cout << _("Repository: ")
        << theone.resolvable()->repository().asUserString() << endl;
 
   printNVA(theone.resolvable());
@@ -316,7 +324,7 @@ static string string_weak_status(const ResStatus & rs)
 <pre>
 Information for pattern sw_management:
 
-Catalog: factory
+Repository: factory
 Name: sw_management
 Version: 11.0-2
 Arch: x86_64
@@ -334,7 +342,7 @@ void printPatternInfo(Zypper & zypper, const ui::Selectable & s)
   if ( !pool_item.resolvable()->isKind<Pattern>() )
     return;
 
-  cout << (zypper.globalOpts().is_rug_compatible ? _("Catalog: ") : _("Repository: "))
+  cout << _("Repository: ")
        << pool_item.resolvable()->repository().asUserString() << endl;
 
   printNVA(pool_item.resolvable());
@@ -413,7 +421,7 @@ void printProductInfo(Zypper & zypper, const ui::Selectable & s)
   }
   else
   {
-    cout << (zypper.globalOpts().is_rug_compatible ? _("Catalog: ") : _("Repository: "))
+    cout << _("Repository: ")
          << pool_item.resolvable()->repository().asUserString() << endl;
 
     printNVA(pool_item.resolvable());
@@ -428,7 +436,10 @@ void printProductInfo(Zypper & zypper, const ui::Selectable & s)
     else
       product = asKind<Product>(pool_item.resolvable());
 
-    cout << _("Flavor") << ": "  << product->flavor() << endl;
+    cout << _("Flavor") << ":";
+    appendWord( cout, product->flavor() );
+    appendWord( cout, product->registerFlavor() );
+    cout << endl;
 
     cout << _("Short Name") << ": " << product->shortName() << endl;
 
@@ -448,15 +459,14 @@ void printProductInfo(Zypper & zypper, const ui::Selectable & s)
       else if ( CpeId::NoThrowType::lastMalformed.empty() )
        cout <<  _("undefined") << endl;
       else
-       colBad() <<  _("invalid CPE Name") << ": " << CpeId::NoThrowType::lastMalformed << endl;
+       cout << ( ColorContext::MSG_ERROR <<  _("invalid CPE Name") << ": " << CpeId::NoThrowType::lastMalformed ) << endl;
     }
     {
       cout << _("Update Repositories");
-      std::list<Repository::ContentIdentifier> l;
-      unsigned cl = product->updateContentIdentifierSize( l );
-      if ( cl )
+      const std::vector<Repository::ContentIdentifier> & l( product->updateContentIdentifier() );
+      if ( ! l.empty() )
       {
-       cout << ": " << cl << endl;
+       cout << ": " << l.size() << endl;
        unsigned n = 0;
        for ( const auto & el : l )
        {
@@ -473,7 +483,7 @@ void printProductInfo(Zypper & zypper, const ui::Selectable & s)
          }
          if ( ! found )
          {
-           colNote() << "    " << _("Not provided by any enabled repository")   << endl;
+           cout << ( ColorContext::MSG_WARNING << "    " << _("Not provided by any enabled repository") ) << endl;
          }
        }
       }
index 6717a3a..1b49761 100644 (file)
@@ -39,7 +39,7 @@ void list_locks(Zypper & zypper)
     TableHeader th;
     th << "#" << _("Name");
     if (zypper.globalOpts().is_rug_compatible)
-      th << _("Catalog") << _("Importance");
+      th << _("Repository") << _("Importance");
     else
       th << _("Type") << _("Repository");
 
@@ -70,7 +70,7 @@ void list_locks(Zypper & zypper)
       set<string> strings;
       if (zypper.globalOpts().is_rug_compatible)
       {
-        // catalog
+        // repository
         copy(it->repos().begin(), it->repos().end(), inserter(strings, strings.end()));
         tr << get_string_for_table(strings);
         // importance
index 5443e1a..86691f9 100644 (file)
 #define ZYPPER_EXIT_INF_CAP_NOT_FOUND      104 // given capability not found (for install/remove)
 #define ZYPPER_EXIT_ON_SIGNAL              105 // SIGINT or SIGTERM received
 
-// undefine _ and _PL macros from libzypp
+// undefine _, N_ and _PL macros from libzypp
 #ifdef _
 #undef _
 #endif
+#define _(MSG) ::gettext(MSG)
+
+#ifdef N_
+#undef N_
+#endif
+#define N_(MSG) MSG
+
 #ifdef _PL
 #undef _PL
 #endif
-
-// define new macros
-#define _(MSG) ::gettext(MSG)
 #define _PL(MSG1,MSG2,N) ::ngettext(MSG1,MSG2,N)
 
 // libzypp logger settings
index e69337b..7f15293 100644 (file)
@@ -51,7 +51,7 @@ bool OutNormal::infoWarningFilter(Verbosity verbosity_r, Type mask)
   return false;
 }
 
-void OutNormal::info(const std::string & msg, Verbosity verbosity_r, Type mask)
+void OutNormal::info(const std::string & msg_r, Verbosity verbosity_r, Type mask)
 {
   if (infoWarningFilter(verbosity_r, mask))
     return;
@@ -59,16 +59,13 @@ void OutNormal::info(const std::string & msg, Verbosity verbosity_r, Type mask)
   if (!_newline)
     cout << endl;
 
-  if (verbosity_r == Out::QUIET)
-    print_color(msg, COLOR_CONTEXT_RESULT);
-  else if (verbosity_r == Out::DEBUG)
-  {
-    print_color(msg, COLOR_CONTEXT_OSDEBUG);
-  }
-  else
-    print_color(msg, COLOR_CONTEXT_MSG_STATUS);
+  ColorString msg( msg_r, ColorContext::MSG_STATUS );
+  if ( verbosity_r == Out::QUIET )
+    msg = ColorContext::RESULT;
+  else if ( verbosity_r == Out::DEBUG )
+    msg = ColorContext::OSDEBUG;
 
-  cout << endl;
+  cout << msg << endl;
   _newline = true;
 }
 
@@ -83,8 +80,7 @@ void OutNormal::warning(const std::string & msg, Verbosity verbosity_r, Type mas
   if (!_newline)
     cout << endl;
 
-  print_color(_("Warning: "), COLOR_CONTEXT_MSG_WARNING);
-  cout << msg << endl;
+  cout << ( ColorContext::MSG_WARNING << _("Warning: ") ) << msg << endl;
   _newline = true;
 }
 
@@ -93,7 +89,7 @@ void OutNormal::error(const std::string & problem_desc, const std::string & hint
   if (!_newline)
     cout << endl;
 
-  fprint_color(cerr, problem_desc, COLOR_CONTEXT_MSG_ERROR);
+  cerr << ( ColorContext::MSG_ERROR << problem_desc );
   if (!hint.empty() && verbosity() > Out::QUIET)
     cerr << endl << hint;
   cerr << endl;
@@ -109,12 +105,8 @@ void OutNormal::error(const zypp::Exception & e,
   if (!_newline)
     cout << endl;
 
-  // problem
-  fprint_color(cerr, problem_desc, COLOR_CONTEXT_MSG_ERROR);
-  cerr << endl;
-  // cause
-  fprint_color(cerr, zyppExceptionReport(e), COLOR_CONTEXT_MSG_ERROR);
-  cerr << endl;
+  // problem and cause
+  cerr << ( ColorContext::MSG_ERROR << problem_desc << endl << zyppExceptionReport(e) ) << endl;
 
   // hint
   if (!hint.empty() && verbosity() > Out::QUIET)
@@ -218,7 +210,7 @@ void OutNormal::progressEnd(const std::string & id, const string & label, bool e
     return;
 
   if (!error && _use_colors)
-    cout << get_color(COLOR_CONTEXT_MSG_STATUS);
+    cout << ColorContext::MSG_STATUS;
 
   TermLine outstr( TermLine::SF_CRUSH | TermLine::SF_EXPAND, '.' );
   if (_isatty)
@@ -236,8 +228,8 @@ void OutNormal::progressEnd(const std::string & id, const string & label, bool e
     {
       // a bit clmupsy and not perfect: hidden char counting
       unsigned tag( std::string(outstr.rhs).size() );
-      std::string errstr( _("error") );
-      fprint_color(outstr.rhs._str, errstr, COLOR_CONTEXT_NEGATIVE);
+      ColorString errstr( _("error"), ColorContext::NEGATIVE );
+      outstr.rhs << errstr;
       outstr.rhidden += unsigned(std::string(outstr.rhs).size() - errstr.size()) - tag ;
     }
     else
@@ -253,7 +245,7 @@ void OutNormal::progressEnd(const std::string & id, const string & label, bool e
   _newline = true;
 
   if (!error && _use_colors)
-    cout << COLOR_RESET;
+    cout << ColorContext::DEFAULT;
 }
 
 // progress with download rate
@@ -332,7 +324,7 @@ void OutNormal::dwnldProgressEnd(const zypp::Url & uri, long rate, bool error)
     return;
 
   if (!error && _use_colors)
-    cout << get_color(COLOR_CONTEXT_MSG_STATUS);
+    cout << ColorContext::MSG_STATUS;
 
   TermLine outstr( TermLine::SF_CRUSH | TermLine::SF_EXPAND, '.' );
   if (_isatty)
@@ -351,8 +343,8 @@ void OutNormal::dwnldProgressEnd(const zypp::Url & uri, long rate, bool error)
     {
       // a bit clmupsy and not perfect: hidden char counting
       unsigned tag( std::string(outstr.rhs).size() );
-      std::string errstr( _("error") );
-      fprint_color(outstr.rhs._str, errstr, COLOR_CONTEXT_NEGATIVE);
+      ColorString errstr( _("error"), ColorContext::NEGATIVE );
+      outstr.rhs << errstr;
       outstr.rhidden += unsigned(std::string(outstr.rhs).size() - errstr.size()) - tag ;
     }
     else
@@ -370,7 +362,7 @@ void OutNormal::dwnldProgressEnd(const zypp::Url & uri, long rate, bool error)
   _newline = true;
 
   if (!error && _use_colors)
-    cout << COLOR_RESET;
+    cout << ColorContext::DEFAULT;
 }
 
 void OutNormal::prompt(PromptId id,
@@ -388,9 +380,11 @@ void OutNormal::prompt(PromptId id,
   }
   else
     cout << startdesc << endl;
+
+  ColorStream cout( std::cout, ColorContext::PROMPT ); // scoped color on std::cout
   cout << prompt;
-  if (!poptions.empty())
-    cout << " " << poptions.optionString();
+  if ( ! poptions.empty() )
+    cout << " " << ColorString(poptions.optionString()); 
   cout << ": " << std::flush;
   // prompt ends with newline (user hits <enter>) unless exited abnormaly
   _newline = true;
@@ -419,7 +413,8 @@ void OutNormal::promptHelp(const PromptOptions & poptions)
     }
   }
 
-  cout << endl << poptions.optionString() << ": " << std::flush;
+  ColorStream cout( std::cout, ColorContext::PROMPT ); // scoped color on std::cout
+  cout << endl << ColorString(poptions.optionString()) << ": " << std::flush;
   // prompt ends with newline (user hits <enter>) unless exited abnormaly
   _newline = true;
 }
index db59ce1..78ddb5b 100644 (file)
@@ -695,9 +695,9 @@ void do_init_repos(Zypper & zypper, const Container & container)
             || build_cache(zypper, repo, false))
         {
           zypper.out().info(boost::str(format(
-              _("Disabling repository '%s' because of the above error."))
+              _("Skipping repository '%s' because of the above error."))
               % repo.asUserString()), Out::QUIET);
-          WAR << format("Disabling repository '%s' because of the above error.")
+          WAR << format("Skipping repository '%s' because of the above error.")
               % repo.alias() << endl;
 
           it->setEnabled(false);
@@ -733,9 +733,9 @@ void do_init_repos(Zypper & zypper, const Container & container)
         if (build_cache(zypper, repo, false))
         {
           zypper.out().warning(boost::str(format(
-              _("Disabling repository '%s' because of the above error."))
+              _("Skipping repository '%s' because of the above error."))
               % repo.asUserString()), Out::QUIET);
-          WAR << format("Disabling repository '%s' because of the above error.")
+          WAR << format("Skipping repository '%s' because of the above error.")
               % repo.alias() << endl;
 
           it->setEnabled(false);
@@ -1043,7 +1043,6 @@ static void print_repo_list(Zypper & zypper,
   if (tbl.empty()) {
     zypper.out().warning(_("No repositories defined."));
     zypper.out().info(_("Use the 'zypper addrepo' command to add one or more repositories."));
-    zypper.setExitCode(ZYPPER_EXIT_NO_REPOS);
   }
   else
   {
@@ -1194,6 +1193,9 @@ void list_repos(Zypper & zypper)
   // print repo list as table
   else
     print_repo_list(zypper, repos);
+
+  if ( repos.empty() )
+    zypper.setExitCode(ZYPPER_EXIT_NO_REPOS);
 }
 
 // ----------------------------------------------------------------------------
@@ -1671,6 +1673,17 @@ void add_repo(Zypper & zypper, RepoInfo & repo)
     return;
   }
 
+
+  if ( !repo.gpgCheck() )
+  {
+    zypper.out().warning( boost::formatNAC(
+      // translators: BOOST STYLE POSITIONAL DIRECTIVES ( %N% )
+      // translators: %1% - a repository name
+      _("GPG checking is disabled in configuration of repository '%1%'. Integrity and origin of packages cannot be verified."))
+      % repo.asUserString()
+    );
+  }
+
   ostringstream s;
   s << format(_("Repository '%s' successfully added")) % repo.asUserString();
   s << endl;
@@ -1684,24 +1697,21 @@ void add_repo(Zypper & zypper, RepoInfo & repo)
   }
   else
   {
-    // TranslatorExplanation used as e.g. "Enabled: Yes"
-    s << _("Enabled") << ": " << (repo.enabled() ? _("Yes") : _("No")) << endl;
-    // TranslatorExplanation used as e.g. "Autorefresh: Yes"
-    s << _("Autorefresh") << ": " << (repo.autorefresh() ? _("Yes") : _("No")) << endl;
-    // TranslatorExplanation used as e.g. "GPG check: Yes"
-    s << _("GPG check") << ": " << (repo.gpgCheck() ? _("Yes") : _("No")) << endl;
-
-    if (!repo.baseUrlsEmpty())
-    {
-      s << "URI:";
-      for (RepoInfo::urls_const_iterator uit = repo.baseUrlsBegin();
-          uit != repo.baseUrlsEnd(); uit++)
-        s << " " << *uit;
-      s << endl;
-    }
+    PropertyTable p;
+    // translators: property name; short; used like "Name: value"
+    p.add( _("Enabled"),       repo.enabled() );
+    // translators: property name; short; used like "Name: value"
+    p.add( _("Autorefresh"),   repo.autorefresh() );
+    // 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( _("URI"),           repo.baseUrlsBegin(), repo.baseUrlsEnd() );
+    s << p;
   }
   zypper.out().info(s.str());
 
+
+
   MIL << "Repository successfully added: " << repo << endl;
 
   if ( is_cd )
@@ -2095,10 +2105,19 @@ void modify_repo(Zypper & zypper, const string & alias)
     if (chnaged_enabled || changed_autoref || changed_prio
         || changed_keeppackages || changed_gpgcheck || !name.empty())
     {
+      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() + "]" );
+      }
+      bool didVolatileChanges = false;
+
       manager.modifyRepository(alias, repo);
 
       if (chnaged_enabled)
       {
+       // the by now only persistent change for service repos.
         if (repo.enabled())
           zypper.out().info(boost::str(format(
             _("Repository '%s' has been successfully enabled.")) % alias));
@@ -2109,44 +2128,57 @@ void modify_repo(Zypper & zypper, const string & alias)
 
       if (changed_autoref)
       {
+       if ( !volatileNote.empty() ) didVolatileChanges = true;
         if (repo.autorefresh())
           zypper.out().info(boost::str(format(
-            _("Autorefresh has been enabled for repository '%s'.")) % alias));
+            _("Autorefresh has been enabled for repository '%s'.")) % alias)+volatileNote);
         else
           zypper.out().info(boost::str(format(
-            _("Autorefresh has been disabled for repository '%s'.")) % alias));
+            _("Autorefresh has been disabled for repository '%s'.")) % alias)+volatileNote);
       }
 
       if (changed_keeppackages)
       {
+       if ( !volatileNote.empty() ) didVolatileChanges = true;
         if (repo.keepPackages())
           zypper.out().info(boost::str(format(
-            _("RPM files caching has been enabled for repository '%s'.")) % alias));
+            _("RPM files caching has been enabled for repository '%s'.")) % alias)+volatileNote);
         else
           zypper.out().info(boost::str(format(
-            _("RPM files caching has been disabled for repository '%s'.")) % alias));
+            _("RPM files caching has been disabled for repository '%s'.")) % alias)+volatileNote);
       }
 
       if (changed_gpgcheck)
       {
+       if ( !volatileNote.empty() ) didVolatileChanges = true;
         if (repo.gpgCheck())
           zypper.out().info(boost::str(format(
-            _("GPG check has been enabled for repository '%s'.")) % alias));
+            _("GPG check has been enabled for repository '%s'.")) % alias)+volatileNote);
         else
           zypper.out().info(boost::str(format(
-            _("GPG check has been disabled for repository '%s'.")) % alias));
+            _("GPG check has been disabled for repository '%s'.")) % alias)+volatileNote);
       }
 
       if (changed_prio)
       {
+       if ( !volatileNote.empty() ) didVolatileChanges = true;
         zypper.out().info(boost::str(format(
-          _("Repository '%s' priority has been set to %d.")) % alias % prio));
+          _("Repository '%s' priority has been set to %d.")) % alias % prio)+volatileNote);
       }
 
       if (!name.empty())
       {
+       if ( !volatileNote.empty() ) didVolatileChanges = true;
         zypper.out().info(boost::str(format(
-          _("Name of repository '%s' has been set to '%s'.")) % alias % name));
+          _("Name of repository '%s' has been set to '%s'.")) % alias % name)+volatileNote);
+      }
+
+      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() ));
       }
     }
     else
@@ -2644,10 +2676,6 @@ void list_services(Zypper & zypper)
   // print repo list as xml
   else if (zypper.out().type() == Out::TYPE_XML)
     print_xml_service_list(zypper, services);
-  // print repo list the rug's way
-  //else if (zypper.globalOpts().is_rug_compatible)
-    //print_rug_service_list(repos);
-  // print repo list as table
   else
     print_service_list(zypper, services);
 }
@@ -2733,7 +2761,7 @@ void remove_service(Zypper & zypper, const ServiceInfo & service)
 static bool refresh_service(Zypper & zypper, const ServiceInfo & service)
 {
   MIL << "going to refresh service '" << service.alias() << "'" << endl;
-
+  init_target(zypper); // need targetDistribution for service refresh
   RepoManager & manager = zypper.repoManager();
 
   bool error = true;
@@ -2745,7 +2773,7 @@ static bool refresh_service(Zypper & zypper, const ServiceInfo & service)
     RepoManager::RefreshServiceOptions opts;
     if ( zypper.cOpts().count("restore-status") )
       opts |= RepoManager::RefreshService_restoreStatus;
-    
+
     manager.refreshService( service, opts );
     error = false;
   }
@@ -2909,6 +2937,33 @@ void refresh_services(Zypper & zypper)
   MIL << "DONE";
 }
 
+void checkIfToRefreshPluginServices( Zypper & zypper )
+{
+  // check root user
+  if ( geteuid() != 0 )
+    return;
+
+  RepoManager & repoManager = zypper.repoManager();
+  for ( const auto & service : repoManager.knownServices() )
+  {
+    if ( service.type() != ServiceType::PLUGIN )
+      continue;
+    if ( ! service.enabled() )
+      continue;
+    if ( ! service.autorefresh() )
+      continue;
+
+    bool error = refresh_service( zypper, service );
+    if (error)
+    {
+      static const char * msg = N_("Skipping service '%s' because of the above error.");
+      zypper.out().error(boost::str(format(_(msg)) % service.asUserString().c_str()));
+      ERR << format(msg) % service.alias() << endl;
+    }
+  }
+}
+
+
 // ---------------------------------------------------------------------------
 
 void modify_service(Zypper & zypper, const string & alias)
@@ -3306,22 +3361,6 @@ void load_target_resolvables(Zypper & zypper)
 }
 
 // ---------------------------------------------------------------------------
-
-// ----------------------------------------------------------------------------
-
-// #217028
-void warn_if_zmd()
-{
-  if (system ("pgrep -lx zmd") == 0)
-  { // list name, exact match
-    Zypper::instance()->out().info(_("ZENworks Management Daemon is running.\n"
-              "WARNING: this command will not synchronize changes.\n"
-              "Use rug or yast2 for that."));
-    USR << ("ZMD is running. Tell the user this will get"
-        " ZMD and libzypp out of sync.") << endl;
-  }
-}
-
 // Local Variables:
 // c-basic-offset: 2
 // End:
index 5b5943a..96efef5 100644 (file)
@@ -184,6 +184,9 @@ void modify_service(Zypper & zypper, const std::string & alias);
 
 void refresh_services(Zypper & zypper);
 
+/** If root, refresh any plugin services before lr/ls/ref (bnc#893294) */
+void checkIfToRefreshPluginServices( Zypper & zypper );
+
 bool match_service(Zypper & zypper,
                    std::string str,
                    zypp::repo::RepoInfoBase_Ptr & service_ptr);
@@ -214,14 +217,6 @@ void load_target_resolvables(Zypper & zypper);
  */
 void load_repo_resolvables(Zypper & zypper);
 
-
-/**
- * If ZMD process found, notify user that ZMD is running and that changes
- * to repositories will not be synchronized with it. To be used with commands
- * manipulating repositories like <tt>addrepo</tt> or <tt>rmrepo</tt>.
- */
-void warn_if_zmd();
-
 #endif
 // Local Variables:
 // mode: c++
index 6c3a846..c5117fc 100644 (file)
@@ -49,8 +49,8 @@ FillSearchTableSolvable::FillSearchTableSolvable(
     header
       // translators: S for 'installed Status'
       << _("S")
-      // translators: catalog (rug's word for repository) (header)
-      << _("Catalog")
+      // translators:  package's repository (header)
+      << _("Repository")
       // translators: Bundle is a term used in rug. See rug for how to translate it.
       << _("Bundle")
       // translators: name (general header)
@@ -341,7 +341,7 @@ FillPatchesTable::FillPatchesTable( Table & table, zypp::TriBool inst_notinst )
   TableHeader header;
 
   header
-    << (_gopts.is_rug_compatible ? _("Catalog") : _("Repository"))
+    << _("Repository")
     << _("Name")
     << _("Category")
     << _("Severity")
@@ -606,7 +606,7 @@ void list_packages(Zypper & zypper)
     th << _("Name") << table::EditionStyleSetter( tbl, _("Version") ) << _("Arch");
     tbl << th;
 
-    if (zypper.cOpts().count("sort-by-repo") || zypper.cOpts().count("sort-by-catalog"))
+    if (zypper.cOpts().count("sort-by-repo"))
       tbl.sort(1); // Repo
     else
       tbl.sort(2); // Name
index f89ec3f..8fc5f2c 100755 (executable)
@@ -258,7 +258,7 @@ static bool list_patch_updates(Zypper & zypper)
   TableHeader th;
   unsigned cols;
 
-  th << (zypper.globalOpts().is_rug_compatible ? _("Catalog") : _("Repository"))
+  th << _("Repository")
      << _("Name") << _("Category") << _("Severity") << _("Status") << _("Summary");
   cols = 6;
   tbl << th;
@@ -493,7 +493,7 @@ void list_updates(Zypper & zypper, const ResKindSet & kinds, bool best_effort)
     // TranslatorExplanation S stands for Status
     th << _("S");
     if (!hide_repo)
-      th << (zypper.globalOpts().is_rug_compatible ? _("Catalog") : _("Repository"));
+      th << _("Repository");
 
     if (zypper.globalOpts().is_rug_compatible)
       th << _("Bundle");
diff --git a/src/utils/ansi.h b/src/utils/ansi.h
new file mode 100644 (file)
index 0000000..4bec70f
--- /dev/null
@@ -0,0 +1,775 @@
+/*-----------------------------------------------------------*- c++ -*-\
+|                          ____ _   __ __ ___                          |
+|                         |__  / \ / / . \ . \                         |
+|                           / / \ V /|  _/  _/                         |
+|                          / /__ | | | | | |                           |
+|                         /_____||_| |_| |_|                           |
+|                                                                      |
+\---------------------------------------------------------------------*/
+
+#ifndef ZYPPER_UTILS_ANSI_H
+#define ZYPPER_UTILS_ANSI_H
+
+#include <iostream>
+#include <sstream>
+#include <type_traits>
+#include <memory>
+#include <map>
+#include <string>
+
+#include <zypp/base/String.h>
+
+/** If output is done in colors (depends on config) */
+bool do_colors();
+
+///////////////////////////////////////////////////////////////////
+namespace ansi
+{
+#define ZYPPER_TRACE_SGR 0
+  ///////////////////////////////////////////////////////////////////
+  /// \class ColorTraits<_Tp>
+  /// \brief Traits class to enable custom \ref Color construction
+  ///
+  /// This enables using user types (usaually enums) to be used as \ref Color
+  /// with \ref ColorString or \ref ColorStream classes:
+  /// \code
+  ///   enum ColorContext { Red, Green, Blue };
+  ///
+  ///   cout << "default"
+  ///        << ( ColorContext::Green << "green"
+  ///                                 << ColorContext::Red << "switch to red"
+  ///                                 << ( ColorContext::Blue << "blue" )
+  ///                                 << "still red" )
+  ///        << "default" << endl;
+  /// \endcode
+  ///
+  /// You need to define a function <tt>ansi::Color customColorCtor( EnumType enum_r )</tt>
+  /// which associates enum value and \ref Color:
+  /// \code
+  ///  ansi::Color customColorCtor( ColorContext ctxt_r )
+  ///  { return Color associated with each enum value }
+  /// \endcode
+  ///
+  /// Then specailize \ref ColorTraits for your enum to enable using it as \ref ColorStream
+  /// \code
+  ///  namespace ansi
+  ///  {
+  ///    template<>
+  ///    struct ColorTraits<ColorContext>
+  ///    { enum { customColorCtor = true }; };
+  ///  }
+  /// \endcode
+  ///
+  /// This will enable your enum being impicitly converted into ansi::Color, especially
+  /// when used together with \ref ColorString and \ref ColorStream. Printing your enum
+  /// on a stream, will also print the associated colors SGR sequence:
+  /// \code
+  ///  // provided via ColorTraits:
+  ///  std::ostream & operator<<( std::ostream & str, ColorContext obj )
+  ///  { return str << ansi::Color( obj ); }
+  /// \endcode
+  ///////////////////////////////////////////////////////////////////
+  template<class _Tp>
+  struct ColorTraits
+  { enum { customColorCtor = false }; };
+
+  // enabled via ctor Color::Constant -> Color
+  /** \relates ColorTraits<_Tp> SFINAE: hide template signatures unless enum is enabled in \ref ColorTraits */
+  template <typename _CCC>
+  using EnableIfCustomColorCtor = typename std::enable_if< ansi::ColorTraits<typename std::decay<_CCC>::type>::customColorCtor >::type;
+
+  /** \relates ColorTraits<_Tp> SFINAE: hide template signatures unless enum is enabled in \ref ColorTraits */
+  template <typename _CCC>
+  using DisableIfCustomColorCtor = typename std::enable_if< !ansi::ColorTraits<typename std::decay<_CCC>::type>::customColorCtor >::type;
+
+  ///////////////////////////////////////////////////////////////////
+  /// \class Color
+  /// \brief Various ways to define ansi SGR sequences.
+  ///
+  /// Any color component (\ref Attr, \ref Fg, \ref Bg) may have the
+  /// value \c Uchanged, indicating that this component should remain
+  /// unchanged when the terminal color is set. To mimic this use
+  /// \ref operator<<= which updates a color by omitting \c Unchanged
+  /// components.
+  ///nocolor
+  /// \note The function \ref do_colors determines if ansi SGR sequences
+  /// are generated for colors at all.
+  ///
+  ///////////////////////////////////////////////////////////////////
+  class Color
+  {
+  public:
+    /** Color attributes */
+    enum class Attr : std::uint8_t
+    { Unchanged, Normal, Bright, Reverse };
+
+    /** Foreground colors */
+    enum class Fg : std::uint8_t
+    { Unchanged, Default, Black, Red, Green, Yellow, Blue, Magenta, Cyan, White };
+
+    /** Backgroud colors */
+    enum class Bg : std::uint8_t
+    { Unchanged, Default, Black, Red, Green, Yellow, Blue, Magenta, Cyan, White };
+
+    /** Color unique id type */
+    typedef std::uint32_t UidType;
+
+    /** Predefined (foregreound) color contants
+     * Intentionally not an <tt>enum class</tt>, so it can be used as
+     * \c Color::Red, \c Color::Default, etc.
+     */
+    enum Constant : std::uint8_t
+    {
+      Black,   BrightBlack,    // BrightBlack = Darkgray
+      Red,     BrightRed,
+      Green,   BrightGreen,
+      Yellow,  BrightYellow,   // Yellow = Brown on Standard VGA
+      Blue,    BrightBlue,
+      Magenta, BrightMagenta,
+      Cyan,    BrightCyan,
+      White,   BrightWhite,    // White = Gray
+      Default, BrightDefault
+    };
+
+  public:
+    /** Default ctor: terminal default color */
+    Color()
+    : _comp( Attr::Normal, Fg::Default, Bg::Default )
+    {}
+
+    Color( Attr attr_r, Fg fg_r = Fg::Unchanged, Bg bg_r = Bg::Unchanged )
+    : _comp( attr_r, fg_r, bg_r )
+    {}
+
+    Color( Attr attr_r, Bg bg_r )
+    : _comp( attr_r, Fg::Unchanged, bg_r )
+    {}
+
+    Color( Fg fg_r, Bg bg_r = Bg::Unchanged  )
+    : _comp( Attr::Unchanged, fg_r, bg_r )
+    {}
+
+    Color( Bg bg_r )
+    : _comp( Attr::Unchanged, Fg::Unchanged, bg_r )
+    {}
+
+    /** Color constant combined with background (\ref Bg::Default) */
+    Color( Constant color_r, Bg bg_r = Bg::Default )
+    : _comp( ( color_r % 2 ? Attr::Bright : Attr::Normal ), Fg::Default, bg_r )
+    {
+      switch ( color_r )
+      {
+       case Black:
+       case BrightBlack:       _comp.fg = Fg::Black;   break;
+       case Red:
+       case BrightRed:         _comp.fg = Fg::Red;     break;
+       case Green:
+       case BrightGreen:       _comp.fg = Fg::Green;   break;
+       case Yellow:
+       case BrightYellow:      _comp.fg = Fg::Yellow;  break;
+       case Blue:
+       case BrightBlue:        _comp.fg = Fg::Blue;    break;
+       case Magenta:
+       case BrightMagenta:     _comp.fg = Fg::Magenta; break;
+       case Cyan:
+       case BrightCyan:        _comp.fg = Fg::Cyan;    break;
+       case White:
+       case BrightWhite:       _comp.fg = Fg::White;   break;
+       default:
+       case Default:
+       case BrightDefault:     break;
+      }
+    }
+
+    /** Custom ctor from ColorTraits enabled type */
+    template<class _CCC, typename = EnableIfCustomColorCtor<_CCC>>
+    Color( _CCC && color_r )
+    : Color( customColorCtor( std::forward<_CCC>(color_r) ) )
+    {}
+
+  public:
+    /** Leave everything unchanged */
+    static Color nocolor()
+    { return Color( UidType(0) ); }
+
+    /** Evaluate in boolean context (not \ref nocolor) */
+    explicit operator bool() const
+    { return uid(); }
+
+    /** ANSI SGR sesquence to reset all attributes
+     * \note Printing this SGR sequence has the same visible effect as setting
+     * \ref Color::Default. Classes supporting re-coloring, like \ref ColorString,
+     * however differ between both. While Color::Default is a color to use,
+     * thus to keep when re-coloring, \ref SGRReset is used as placeholder for
+     * later coloring.
+     */
+    static const std::string & SGRReset()
+    {
+#if ( ZYPPER_TRACE_SGR )
+      static const std::string _reset( "\033[0m[!]" );
+#else
+      static const std::string _reset( "\033[0m" );
+#endif
+      return _reset;
+    }
+
+  public:
+    /** Update Color (assign components which are not \c Unchanged in rhs ) */
+    Color & operator<=( Color rhs )
+    {
+      if ( rhs._comp.attr != Attr::Unchanged ) _comp.attr = rhs._comp.attr;
+      if ( rhs._comp.fg != Fg::Unchanged ) _comp.fg = rhs._comp.fg;
+      if ( rhs._comp.bg != Bg::Unchanged ) _comp.bg = rhs._comp.bg;
+      return *this;
+    }
+    /** \overload */
+    Color & operator<=( Color::Attr rhs )
+    { if ( rhs != Attr::Unchanged ) _comp.attr = rhs; return *this; }
+    /** \overload */
+    Color & operator<=( Color::Fg rhs )
+    { if ( rhs != Fg::Unchanged ) _comp.fg = rhs; return *this; }
+    /** \overload */
+    Color & operator<=( Color::Bg rhs )
+    { if ( rhs != Bg::Unchanged ) _comp.bg = rhs; return *this; }
+    /** \overload */
+    inline Color & operator<=( Color::Constant rhs );
+
+    /** Return updated color */
+    Color operator<( Color rhs ) const
+    { return Color(*this) <= rhs; }
+    /** \overload */
+    Color operator<( Color::Attr rhs ) const
+    { return Color(*this) <= rhs; }
+    /** \overload */
+    Color operator<( Color::Fg rhs ) const
+    { return Color(*this) <= rhs; }
+    /** \overload */
+    Color operator<( Color::Bg rhs ) const
+    { return Color(*this) <= rhs; }
+    /** \overload */
+    inline Color operator<( Color::Constant rhs ) const;
+
+  public:
+    Attr attr() const
+    { return _comp.attr; }
+
+    Color & attr( Attr attr_r )
+    { _comp.attr = attr_r; return *this; }
+
+    Fg fg() const
+    { return _comp.fg; }
+
+    Color & fg( Fg fg_r )
+    { _comp.fg = fg_r; return *this; }
+
+    Bg bg() const
+    { return _comp.bg; }
+
+    Color & bg( Bg bg_r )
+    { _comp.bg = bg_r; return *this; }
+
+    /** Each color has a unique numeric id  */
+    UidType uid() const
+    { return _comp.uid; }
+
+    /** The colors SGRsequence if \ref do_colors is \c true */
+    const std::string & str() const
+    { return genSGR( *this ); }
+
+    /** The colors SGRsequence human readable */
+    std::string debugstr() const
+    { return genSGR( *this ).c_str()+1; }
+
+  public:
+  /** \relates Color */
+  friend inline bool operator==( Color lhs, Color rhs )
+  { return( lhs.uid() == rhs.uid() ); }
+
+  /** \relates Color */
+  friend inline bool operator!=( Color lhs, Color rhs )
+  { return ! ( lhs == rhs ); }
+
+  private:
+    /** Return a colors SGRsequence if \ref do_colors retruns \c true */
+    static std::string & genSGR( Color color_r )
+    {
+      static std::map<UidType,std::string> _def;
+
+      if ( ! ( color_r && do_colors() ) )      // nocolor, all ::Unchanged, uid 0: return empty string
+      {
+#if ( ZYPPER_TRACE_SGR )
+       std::string & ret( _def[0] );
+       if ( ret.empty() )
+         ret =  "[]";
+       return ret;
+#else
+       return _def[0];
+#endif
+      }
+
+      std::string & ret( _def[color_r._comp.uid] );
+      if ( ret.empty() )
+      {
+       ret += "\033[";
+       switch ( color_r._comp.attr )
+       {
+         case Attr::Normal:    ret += "22;27;";        break;
+         case Attr::Bright:    ret += "1;";            break;
+         case Attr::Reverse:   ret += "7;";            break;
+         default:
+         case Attr::Unchanged: break;
+       }
+       switch ( color_r._comp.fg )
+       {
+         case Fg::Black:       ret += "30;";           break;
+         case Fg::Red:         ret += "31;";           break;
+         case Fg::Green:       ret += "32;";           break;
+         case Fg::Yellow:      ret += "33;";           break;
+         case Fg::Blue:        ret += "34;";           break;
+         case Fg::Magenta:     ret += "35;";           break;
+         case Fg::Cyan:        ret += "36;";           break;
+         case Fg::White:       ret += "37;";           break;
+         case Fg::Default:     ret += "39;";           break;
+         default:
+         case Fg::Unchanged:   break;
+       }
+       switch ( color_r._comp.bg )
+       {
+         case Bg::Black:       ret += "40;";           break;
+         case Bg::Red:         ret += "41;";           break;
+         case Bg::Green:       ret += "42;";           break;
+         case Bg::Yellow:      ret += "43;";           break;
+         case Bg::Blue:        ret += "44;";           break;
+         case Bg::Magenta:     ret += "45;";           break;
+         case Bg::Cyan:        ret += "46;";           break;
+         case Bg::White:       ret += "47;";           break;
+         case Bg::Default:     ret += "49;";           break;
+         default:
+         case Bg::Unchanged:   break;
+       }
+       *ret.rbegin() = 'm';    // turn trailing ';' into 'm'
+#if ( ZYPPER_TRACE_SGR )
+       ret += ( color_r == Color() ? "[*]" : "[@]" );
+#endif
+      }
+      return ret;
+    }
+
+  private:
+    /** ctor nocolor, all ::Unchange( lhs.uid() == rhs.uid() )d, uid 0 */
+    Color ( UidType ) {}
+
+    union Comp {
+      Comp()   // nocolor, all ::Unchanged, uid 0
+      : uid( 0 )
+      {}
+
+      Comp( Attr attr_r, Fg fg_r, Bg bg_r )
+      : attr( attr_r ), fg( fg_r ), bg( bg_r ), _f( 0 )
+      {}
+
+      struct {
+       Color::Attr     attr;   // std::uint8_t
+       Color::Fg       fg;     // std::uint8_t
+       Color::Bg       bg;     // std::uint8_t
+       std::uint8_t    _f;     // std::uint8_t
+      };
+      UidType          uid;    // std::uint32_t
+    } _comp;
+  };
+
+  template<>
+  struct ColorTraits<Color::Constant>
+  { enum { customColorCtor = true }; };        // enabled via ctor Color::Constant -> Color
+
+  // Implememtation after ColorTraits<Color::Constant> instantiation !
+  Color & Color::operator<=( Color::Constant rhs )     { return *this <= Color( rhs, Bg::Unchanged ); }
+  Color Color::operator<( Color::Constant rhs ) const  { return Color(*this) <= rhs; }
+
+  /** \relates Color Print the colors SGRsequence if \ref do_colors is \c true */
+  inline std::ostream & operator<<( std::ostream & str, Color obj )
+  { return str << obj.str(); }
+
+  ///////////////////////////////////////////////////////////////////
+  /// \class ColorString
+  /// \brief Colored string if \ref do_colors
+  ///
+  /// Stores a plain std::string (which may have color codes embedded)
+  /// along with a \ref Color. Retrieving the string will render
+  /// all uncolored (\ref Color::nololor) parts of the string in the
+  /// \ref Color.
+  ///
+  /// In contrary to a \ref ColorStream you can change the basic color
+  /// of the string without losing embedded highlights.
+  ///
+  /// \note Printing a \ref ColorString renderd in \ref Color::noclolor
+  /// on a \ref ColorStream will render the string in the ColorStreams
+  /// color.
+  ///////////////////////////////////////////////////////////////////
+  class ColorString
+  {
+  public:
+    ColorString()
+    : _color( Color::nocolor() )
+    {}
+
+    /** Ctor from color */
+    explicit ColorString( Color color_r )
+    : _color( color_r )
+    {}
+
+    /** Ctor from string */
+    explicit ColorString( const std::string & str_r )
+    : _str( str_r )
+    , _color( Color::nocolor() )
+    {}
+    /** \overload moving */
+    explicit ColorString( std::string && str_r )
+    : _str( std::move(str_r) )
+    , _color( Color::nocolor() )
+    {}
+
+    /** Ctor from string and color */
+    ColorString( const std::string & str_r, Color color_r )
+    : _str( str_r )
+    , _color( color_r )
+    {}
+    /** \overload moving */
+    ColorString( std::string && str_r, Color color_r )
+    : _str( std::move(str_r) )
+    , _color( color_r )
+    {}
+
+    /** Ctor from color and string */
+    ColorString( Color color_r, const std::string & str_r )
+    : _str( str_r )
+    , _color( color_r )
+    {}
+    /** \overload moving */
+    ColorString( Color color_r, std::string && str_r )
+    : _str( std::move(str_r) )
+    , _color( color_r )
+    {}
+
+  public:
+    /** Assign new string */
+    ColorString & operator=( const std::string & str_r )
+    { _str = str_r; return *this; }
+    /** \overload moving */
+    ColorString & operator=( std::string && str_r )
+    { _str = std::move(str_r); return *this; }
+
+    ///////////////////////////////////////////////////////////////////
+    // Append via '<<' (not '+=' '+') because it's
+    // strictly evaluated left-to-right:
+    //
+    //   ColorString sep( "-", Color::Cyan );
+    //   ColorString ver( "version" );
+    //
+    //   ver << sep << "release";    // + prints "-" in cyan :)
+    //
+    //   ver += sep + "release";     // - prints "-release" in cyan :(
+    //   ver += sep += "release";    // - prints "-release" in cyan :(
+    //   (ver += sep) += "release";  // + but ugly syntax
+    //
+    /** Append a \Ref ColorString */
+    ColorString & operator<<( const ColorString & rhs )
+    { _str += rhs.str(); return *this; }
+
+    /** Append a string */
+    ColorString & operator<<( const std::string & str_r )
+    { _str += str_r; return *this; }
+    /** \overload moving */
+    ColorString & operator<<( std::string && str_r )
+    { _str += std::move(str_r); return *this; }
+
+  public:
+    /** Assign \ref Color */
+    ColorString & operator=( Color color_r )
+    { _color = color_r; return *this; }
+
+    /** Update \ref Color */
+    ColorString & operator<=( Color color_r )
+    { _color <= color_r; return *this; }
+
+    /** Return a copy with different color. */
+    ColorString operator()( Color color_r ) const
+    { return ColorString( _str, color_r ); }
+
+  public:
+    /** Return strings \ref Color */
+    Color color() const
+    { return _color; }
+
+  public:
+    /** Whether the underlying string is empty */
+    bool empty() const
+    { return plainstr().empty(); }
+
+    /** Size of the underlying string */
+    std::string::size_type size() const
+    { return plainstr().size(); }
+
+    /** Return the colored string if \ref do_colors */
+    std::string str() const
+    { return str( _color ); }
+
+    /** Return the string rendered in a differernt color if \ref do_colors */
+    std::string str( Color color_r ) const
+    {
+      std::string ret( plainstr() );
+      if ( do_colors() && color_r )
+      {
+       using zypp::str::replaceAll;
+       replaceAll( ret, Color::SGRReset(), color_r.str() );
+       ret = color_r.str() + ret + Color::SGRReset();
+      }
+#if ( ZYPPER_TRACE_SGR )
+      return "[\"<]" + ret + "[>\"]";
+#endif
+      return ret;
+    }
+
+  public:
+    /** Return the underlying plain string */
+    const std::string & plainstr() const
+    { return _str; }
+
+    /** Return the underlying plain string */
+    std::string & plainstr()
+    { return _str; }
+
+    /** Access the underlying plain string via \c operator* */
+    const std::string & operator*() const
+    { return plainstr(); }
+
+    /** Access the underlying plain string via \c operator* */
+    std::string & operator*()
+    { return plainstr(); }
+
+  private:
+    std::string _str;
+    Color _color;
+  };
+
+  /** \relates ColorString Print colored on ostream */
+  inline std::ostream & operator<<( std::ostream & str, const ColorString & obj )
+  { return str << obj.str(); }
+
+  ///////////////////////////////////////////////////////////////////
+  /// \class ColorStream
+  /// \brief Colored stream output if \ref do_colors
+  ///
+  /// If an \c ostream& is passed to the constructor, we directly print
+  /// to this steam. Otherwise an ostringstream is used as buffer until
+  /// the buffered \ref ColorStream itself is printed. Printing an unbuffered
+  /// steam prints an empty string.
+  ///
+  /// \note Printing directly to a stream, the color is active throughout the
+  /// ColorStreams lifetime (set in ctor, reset in dtor).
+  ///
+  /// \see \ref ColorTraits<_Tp> for how to enable convenient \class ColorStream
+  /// handling via an enum type.
+  /// \code
+  ///   ColorStream cstr( std::move( ColorContext::Red << "Error " << 42 ) );
+  ///
+  ///   cout << "default"
+  ///        << ( ColorContext::Green << "prints green"
+  ///                                 << ColorContext::Red << "switch to red"
+  ///                                 << ( ColorContext::Blue << "prints blue" )
+  ///                                 << "still prints red" )
+  ///        << "default" << endl;
+  /// \endcode
+  ///
+  /// \note This class is not copyable but movable.
+  ///////////////////////////////////////////////////////////////////
+  class ColorStream
+  {
+    struct nullDeleter { void operator() (void const *) const {}; };
+
+  public:
+    /** Default Ctor (\ref Color::Default) */
+    ColorStream()
+    {}
+
+    /** Ctor taking a \ref Color */
+    explicit ColorStream( Color color_r )
+    : _color( color_r )
+    {}
+
+    /** Ctor directly printing to a \ref std::ostream (\ref Color::Default) */
+    explicit ColorStream( std::ostream & direct_r  )
+    : ColorStream( direct_r, Color::Default )
+    {}
+
+    /** Ctor directly printing to a \ref std::ostream in \ref Color */
+    ColorStream( std::ostream & direct_r, Color color_r  )
+    : _directP( &direct_r )
+    , _color( color_r )
+    { (*_directP) << _color; }
+
+    /** non copyable */
+    ColorStream( const ColorStream & ) = delete;
+    ColorStream & operator=( const ColorStream & ) = delete;
+
+    /** movable */
+    ColorStream( ColorStream && ) = default;
+    ColorStream & operator=( ColorStream && ) = default;
+
+    ~ColorStream()
+    { if ( _directP ) (*_directP) << Color::SGRReset(); }
+
+    /** Explicit conversion to \ref std::ostream (creates buffer if not direct) */
+    explicit operator std::ostream &()
+    { return stream(); }
+
+  public:
+    /** Change the streams \ref Color */
+    ColorStream & operator=( Color color_r )
+    {
+      _color = color_r;
+      if ( hasStream() )
+       stream() << _color;
+      return *this;
+    }
+
+    /** Update the streams \ref Color */
+    ColorStream & operator<=( Color color_r )
+    {
+      _color <= color_r;
+      if ( hasStream() )
+       stream() << _color;
+      return *this;
+    }
+
+  public:
+    /** Return streams \ref Color */
+    Color color() const
+    { return _color; }
+
+  public:
+    /** Return a buffered streams content as (colored) string */
+    std::string str() const
+    {
+      std::string ret;
+      if ( hasContent() )
+      {
+       ret = _bufferP->str();
+       ret += Color::SGRReset();
+      }
+      return ret;
+    }
+
+  public:
+    /** Printing a \ref Color (also via enum) updates the streams \ref Color */
+    ColorStream & operator<<( Color color_r )
+    { return operator<=( color_r ); }
+
+    /** Printing a \ref ColorString using his \ref Color
+     * \note \ref ColorString in \ref Color::nocolor is renderd in streams color
+     */
+    ColorStream & operator<<( const ColorString & val_r )
+    { stream() << ( val_r.color() ? val_r.str() : val_r.str(_color) ) << _color; return *this; }
+
+    /** Printing another \ref ColorStream using his \ref Color */
+    ColorStream & operator<<( const ColorStream & val_r )
+#if ( ZYPPER_TRACE_SGR )
+    { if ( val_r.hasContent() ) stream() << "[<<]" << val_r.content() << _color << "[>>]"; return *this; }
+#else
+    { if ( val_r.hasContent() ) stream() << val_r.content() << _color; return *this; }
+#endif
+
+    /** All other types are printed via std::ostream */
+    template<class _Tp, typename = DisableIfCustomColorCtor<_Tp>>
+    ColorStream & operator<<( const _Tp & val_r )      // ! Universal reference here would be too greedy
+    { stream() << val_r; return *this; }
+
+    /** \overload for omaip */
+    ColorStream & operator<<( std::ostream & (*omanip)( std:: ostream & ) )
+    { stream() << omanip; return *this; }
+
+  public:
+    /** \relates ColorStream Print colored on ostream */
+    friend inline std::ostream & operator<<( std::ostream & str, const ColorStream & obj )
+#if ( ZYPPER_TRACE_SGR )
+    { if ( obj.hasContent() ) str << "[<<]" << obj.content() << Color::SGRReset() << "[>>]"; return str; }
+#else
+    { if ( obj.hasContent() ) str << obj.content() << Color::SGRReset(); return str; }
+#endif
+
+  private:
+    /** Direct or non-empty buffer */
+    bool hasStream() const
+    { return _directP || _bufferP; }
+
+    /** Reference to the underlying ostream (direct or auto-created buffer) */
+    std::ostream & stream() const
+    {
+      if ( _directP )
+       return *_directP;
+
+      if ( !_bufferP )
+      {
+       _bufferP.reset( new std::ostringstream );
+       *_bufferP << _color;
+      }
+      return *_bufferP;
+    }
+
+    /** Non-empty buffer (implies direct) */
+    bool hasContent() const
+    { return !!_bufferP; }
+
+    /** Content of a non-empty buffered stream or empty */
+    std::string content() const
+    {
+      std::string ret;
+      if ( hasContent() )
+       ret = _bufferP->str();
+      return ret;
+    }
+
+  private:
+    std::unique_ptr<std::ostream,nullDeleter> _directP;
+    mutable std::unique_ptr<std::ostringstream> _bufferP;
+    Color _color;
+  };
+  ///////////////////////////////////////////////////////////////////
+
+#undef ZYPPER_TRACE_SGR
+} // namespace ansi
+///////////////////////////////////////////////////////////////////
+
+// Drag them into this namespace:
+using ansi::ColorString;
+using ansi::ColorStream;
+
+/** \relates ColorStream Create \ref ColorStream via \ref Color */
+template<class _Tp>
+inline ansi::ColorStream operator<<( ansi::Color color_r, _Tp && val_r )
+{ return std::move( ansi::ColorStream( color_r ) << std::forward<_Tp>(val_r) ); }
+/** \overload for omanip */
+inline ansi::ColorStream operator<<( ansi::Color color_r, std::ostream & (*omanip)( std::ostream & ) )
+{ return std::move( ansi::ColorStream( color_r ) << omanip ); }
+
+/** \relates ColorStream Create \ref ColorStream via <tt>enum << expr</tt> */
+template<class _CCC, class _Tp, typename = ansi::EnableIfCustomColorCtor<_CCC> >
+inline ansi::ColorStream operator<<( _CCC && color_r, _Tp && val_r )
+{ return std::move( ansi::ColorStream( std::forward<_CCC>(color_r) ) << std::forward<_Tp>(val_r) ); }
+/** \overload for omanip */
+template<class _CCC, typename = ansi::EnableIfCustomColorCtor<_CCC> >
+inline ansi::ColorStream operator<<( _CCC && color_r, std::ostream & (*omanip)( std:: ostream & ) )
+{ return std::move( ansi::ColorStream( std::forward<_CCC>(color_r) ) << omanip ); }
+
+///////////////////////////////////////////////////////////////////
+namespace std
+{
+  /** \relates ansi::Color Stream oputput for ColorTraits enabled types
+   * Defined in namespace 'std' because namespace of '_CCC' may vary
+   */
+  template<class _CCC, typename = ansi::EnableIfCustomColorCtor<_CCC>>
+  inline ostream & operator<<( ostream & str, _CCC && color_r )
+  { return str << ansi::Color( forward<_CCC>(color_r) ); }
+} // namespace std
+///////////////////////////////////////////////////////////////////
+#endif // ZYPPER_UTILS_ANSI_H
index e4a2438..0b73288 100644 (file)
@@ -6,62 +6,19 @@
 \*---------------------------------------------------------------------------*/
 
 #include <iostream>
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
+#include <map>
 
 #include <zypp/base/Logger.h>
 
 #include "Zypper.h"
-
 #include "colors.h"
 
-using namespace std;
-
-
-Color::Color(const string & color_str)
-  : _value(parse(color_str))
-{}
-
-string Color::parse(const string & value)
-{
-  static map<string, string> str2esc = {
-    { "",              ""                      },      // no color
-    { "green",         COLOR_GREEN             },
-    { "lightgreen",    COLOR_GREEN_LIGHT       },
-    { "red",           COLOR_RED               },
-    { "lightred",      COLOR_RED_LIGHT         },
-    { "grey",          COLOR_WHITE             },
-    { "white",         COLOR_WHITE_LIGHT       },
-    { "brown",         COLOR_YELLOW            },
-    { "yellow",                COLOR_YELLOW_LIGHT      },
-    { "purple",                COLOR_PURPLE            },
-    { "lightpurple",   COLOR_PURPLE_LIGHT      },
-    { "blue",          COLOR_BLUE              },
-    { "lightblue",     COLOR_BLUE_LIGHT        },
-    { "cyan",          COLOR_CYAN              },
-    { "lightcyan",     COLOR_CYAN_LIGHT        },
-    { "black",         COLOR_BLACK             },
-    { "darkgrey",      COLOR_GREY_DARK         },
-
-    { "reset",         COLOR_RESET             }
-  };
-
-  auto it = str2esc.find(value);
-  if (it == str2esc.end())
-  {
-    ERR << "Unknown color '" << value << "'" << endl;
-    return string();
-  }
-  return it->second;
-}
-
 bool has_colors()
 {
   if (::isatty(STDOUT_FILENO))
   {
     char *term = ::getenv("TERM");
-    if (term && ::strcmp(term, "dumb"))
+    if ( term && ::strcmp(term, "dumb") )
       return true;
   }
   return false;
@@ -72,46 +29,28 @@ bool do_colors()
   return Zypper::instance()->config().do_colors;
 }
 
-const string get_color( const ColorContext context )
-{
-  const Config & conf( Zypper::instance()->config() );
-  switch (context)
-  {
-  case COLOR_CONTEXT_RESULT:
-    return conf.color_result.value();
-  case COLOR_CONTEXT_MSG_STATUS:
-    return conf.color_msgStatus.value();
-  case COLOR_CONTEXT_MSG_WARNING:
-    return conf.color_msgWarning.value();
-  case COLOR_CONTEXT_MSG_ERROR:
-    return conf.color_msgError.value();
-  case COLOR_CONTEXT_POSITIVE:
-    return conf.color_positive.value();
-  case COLOR_CONTEXT_NEGATIVE:
-    return conf.color_negative.value();
-  case COLOR_CONTEXT_PROMPT_OPTION:
-    return conf.color_promptOption.value();
-  case COLOR_CONTEXT_HIGHLIGHT:
-    return conf.color_highlight.value();
-  case COLOR_CONTEXT_OSDEBUG:
-    return Color("brown").value();
-  default:
-    return COLOR_RESET;
-  }
-}
+///////////////////////////////////////////////////////////////////
 
-void print_color( ostream & str, const std::string & s, const char * ansi_color_seq, const char * prev_color )
+ansi::Color customColorCtor( ColorContext ctxt_r )
 {
-  if ( do_colors() )
+  const Config & conf( Zypper::instance()->config() );
+  switch ( ctxt_r )
   {
-    if (prev_color)
-      str << COLOR_RESET;
-
-    str << ansi_color_seq << s << COLOR_RESET;
-
-    if (prev_color)
-      str << prev_color;
+    case ColorContext::RESULT:         return conf.color_result;
+    case ColorContext::MSG_STATUS:     return conf.color_msgStatus;
+    case ColorContext::MSG_WARNING:    return conf.color_msgWarning;
+    case ColorContext::MSG_ERROR:      return conf.color_msgError;
+    case ColorContext::PROMPT:         return conf.color_prompt;
+    case ColorContext::PROMPT_OPTION:  return conf.color_promptOption;
+    case ColorContext::POSITIVE:       return conf.color_positive;
+    case ColorContext::CHANGE:         return conf.color_change;
+    case ColorContext::NEGATIVE:       return conf.color_negative;
+    case ColorContext::HIGHLIGHT:      return conf.color_highlight;
+    case ColorContext::LOWLIGHT:       return conf.color_lowlight;
+    case ColorContext::OSDEBUG:                return conf.color_osdebug;
+
+    case ColorContext::DEFAULT:
+      break;                   // use default...
   }
-  else
-    str << s;
+  return ansi::Color::Default; // default
 }
index 7639e70..690275c 100644 (file)
 #ifndef UTILS_COLORS_H_
 #define UTILS_COLORS_H_
 
+#include <iostream>
 #include <string>
-#include <iosfwd>
 
-#define COLOR_BLACK             "\033[30m"
-#define COLOR_GREY_DARK         "\033[1;30m"
-#define COLOR_BLUE              "\033[34m"
-#define COLOR_BLUE_LIGHT        "\033[1;34m"
-#define COLOR_CYAN              "\033[36m"
-#define COLOR_CYAN_LIGHT        "\033[1;36m"
-#define COLOR_GREEN             "\033[32m"
-#define COLOR_GREEN_LIGHT       "\033[1;32m"
-#define COLOR_PURPLE            "\033[35m"
-#define COLOR_PURPLE_LIGHT      "\033[1;35m"
-#define COLOR_RED               "\033[31m"
-#define COLOR_RED_LIGHT         "\033[1;31m"
-#define COLOR_WHITE             "\033[37m"    // grey
-#define COLOR_WHITE_LIGHT       "\033[1;37m"
-#define COLOR_YELLOW            "\033[33m"    // brown
-#define COLOR_YELLOW_LIGHT      "\033[1;33m"
+#include "ansi.h"
 
-#define COLOR_RESET             "\033[m"
-
-
-class Color
-{
-public:
-  explicit Color(const std::string & color_str);
-
-  std::string parse(const std::string & value);
-
-  std::string value() const
-  { return _value; }
-
-private:
-  std::string _value;
-};
-
-
-typedef enum zypper_color_contexts
-{
-  COLOR_CONTEXT_RESULT               = 1,
-  COLOR_CONTEXT_MSG_STATUS           = 2,
-  COLOR_CONTEXT_MSG_ERROR            = 3,
-  COLOR_CONTEXT_MSG_WARNING          = 4,
-  COLOR_CONTEXT_POSITIVE             = 5,
-  COLOR_CONTEXT_NEGATIVE             = 6,
-  COLOR_CONTEXT_PROMPT_OPTION        = 7,
-  COLOR_CONTEXT_PROMPT_SHORTHAND     = 8,
-  COLOR_CONTEXT_HIGHLIGHT            = 9,
-  COLOR_CONTEXT_OSDEBUG              = 10,
-
-  COLOR_CONTEXT_DEFAULT              = -1
-} ColorContext;
-
-/** Simple check whether stdout can handle colors. */
+/** Simple check whether stdout can handle colors */
 bool has_colors();
 
-/** If output is done in colors */
+/** If output is done in colors (depends on config) */
 bool do_colors();
 
-/** Get ISO terminal escape sequence for color in given \a context. */
-const std::string get_color(const ColorContext context);
-
-/**
- * Print string \a s in given color to stdout.
- *
- * \param str              stream top print on
- * \param s                string to print
- * \param color_seq        color to print with (ISO terminal escape sequence)
- * \param prev_color       color to restore after printing. If NULL,
- *                         COLOR_RESET will be used
- */
-void print_color( std::ostream & str, const std::string & s, const char * color_seq, const char * prev_color = NULL );
-inline void print_color( const std::string & s, const char * color_seq, const char * prev_color = NULL )
-{ print_color( std::cout, s, color_seq, prev_color ); }
-/** leagacy (f)print_color */
-inline void fprint_color(std::ostream & str, const std::string & s, const char * ansi_color_seq, const char * prev_color = NULL)
-{ print_color( str, s, ansi_color_seq, prev_color ); }
-
-inline void print_color( std::ostream & str, const std::string & s, const ColorContext cc, const ColorContext prev_color = COLOR_CONTEXT_DEFAULT )
-{ print_color( str, s, get_color(cc).c_str(), get_color(prev_color).c_str() ); }
-inline void print_color( const std::string & s, const ColorContext cc, const ColorContext prev_color = COLOR_CONTEXT_DEFAULT )
-{ print_color( std::cout, s, cc, prev_color ); }
-/** leagacy  (f)print_color */
-inline void fprint_color(std::ostream & str, const std::string & s, const ColorContext cc, const ColorContext prev_color = COLOR_CONTEXT_DEFAULT)
-{ print_color( str, s, cc, prev_color ); }
+///////////////////////////////////////////////////////////////////
 
-
-template<ColorContext CC>
-struct PrintColor
+enum class ColorContext
 {
-  PrintColor( std::ostream & str_r = std::cout )
-  : _str( str_r )
-  { if ( do_colors() ) _str << get_color( CC ); }
-
-  ~PrintColor()
-  { if ( do_colors() ) _str << get_color( COLOR_CONTEXT_DEFAULT ); }
-
-  operator std::ostream &()
-  { return _str; }
-
-  template<class _Tp>
-  std::ostream & operator<<( const _Tp & val )
-  { return _str << val; }
-
-  std::ostream & _str;
+  DEFAULT,
+
+  RESULT,
+  MSG_STATUS,
+  MSG_ERROR,
+  MSG_WARNING,
+  PROMPT,
+  PROMPT_OPTION,
+  POSITIVE,
+  CHANGE,
+  NEGATIVE,
+  HIGHLIGHT,
+  LOWLIGHT,
+
+  OSDEBUG
 };
 
-typedef PrintColor<COLOR_CONTEXT_POSITIVE>     colGood;        ///< good news (green)
-typedef PrintColor<COLOR_CONTEXT_MSG_WARNING>  colNote;        ///< pay attention (magenta)
-typedef PrintColor<COLOR_CONTEXT_MSG_ERROR>    colBad;         ///< bad news (red)
-typedef PrintColor<COLOR_CONTEXT_HIGHLIGHT>    colH;           ///< highlight (cyan)
+/** \relates ColorContext map to \ref ansi::Color */
+ansi::Color customColorCtor( ColorContext ctxt_r );
+
+namespace ansi
+{
+  // Enable using ColorContext as ansi::SGRSequence
+  template<>
+  struct ColorTraits<::ColorContext>
+  { enum { customColorCtor = true }; };
+}
 
 #endif /* UTILS_COLORS_H_ */
index 6b218c2..84801ed 100644 (file)
@@ -359,6 +359,7 @@ string asXML(const Product & p, bool is_installed)
     } );
 
     dumpAsXmlOn( *parent, p.endOfLife(), "endoflife" );
+    dumpAsXmlOn( *parent, p.registerFlavor(), "registerflavor" );
     {
       const std::string & text( p.description() );
       if ( ! text.empty() )
@@ -423,7 +424,7 @@ void list_processes_using_deleted_files(Zypper & zypper)
   // process user ID
   th << _("UID");
   // process login name
-  th << _("Login");
+  th << _("User");
   // process command name
   th << _("Command");
   // "/etc/init.d/ script that might be used to restart the command (guessed)
index 11d2872..984b6c7 100644 (file)
@@ -57,47 +57,36 @@ void PromptOptions::setOptions(const std::string & option_str, unsigned int defa
 
 
 
-const string PromptOptions::optionString() const
+ColorString PromptOptions::optionString() const
 {
-  ostringstream option_str;
-  StrVector::const_iterator it;
-  unsigned int shown_count = _shown_count < 0 ? options().size() : _shown_count;
+  ostringstream str;
 
-  if ((it = options().begin()) != options().end() && shown_count)
+  unsigned shown = 0;
+  unsigned maxidx = _shown_count < 0 ? _options.size()
+                                     : ( (unsigned)_shown_count < _options.size() ? _shown_count : _options.size() );
+  for ( unsigned idx = 0; idx < maxidx; ++idx )
   {
-    option_str << "[";
-    fprint_color(option_str, *it, COLOR_CONTEXT_PROMPT_OPTION);
-    // fprint_color(option_str, *it, COLOR_CONTEXT_PROMPT_SHORTHAND);
-    ++it;
-  }
-  for (unsigned int i = 1; it != options().end() && i < shown_count; ++it, ++i)
-    if (isEnabled(i))
+    if ( isEnabled( idx ) )
     {
-      option_str << "/";
-      fprint_color(option_str, *it, COLOR_CONTEXT_PROMPT_OPTION);
-      //fprint_color(option_str, *it, COLOR_CONTEXT_PROMPT_SHORTHAND);
+      str << ( shown ? "/" : "[" ) << ( ColorContext::PROMPT_OPTION << _options[idx] );
+      ++shown;
     }
+  }
 
-  if (!_opt_help.empty())
+  if ( !_opt_help.empty() )
   {
-    if (shown_count)
-      option_str << "/";
-    fprint_color(option_str, "?", COLOR_CONTEXT_PROMPT_OPTION);
+    if ( shown )
+      str << "/";
     // translators: Press '?' to see all options embedded in this prompt: "Continue? [y/n/? shows all options] (y):"
-    option_str << " " << _("shows all options");
+    str << ( ColorContext::PROMPT_OPTION << "?" ) << " " << _("shows all options");
   }
 
-  if (!_options.empty() && shown_count)
+  if ( shown )
   {
-    option_str << "]";
-
-    // default option
-    option_str << " (";
-    fprint_color(option_str, _options[_default], COLOR_CONTEXT_PROMPT_OPTION);
-    option_str << ")";
+    str << "] (" << ( ColorContext::PROMPT_OPTION << _options[_default] ) << ")";
   }
 
-  return option_str.str();
+  return ColorString( str.str() );
 }
 
 
index 9456ccc..f90f2df 100644 (file)
@@ -13,6 +13,7 @@
 #include "output/prompt.h"
 #include "utils/console.h"
 #include "main.h" // for gettext macros
+#include "ansi.h"
 
 /**
  * Example:
@@ -53,12 +54,12 @@ public:
   const StrVector & options() const { return _options; }
   void setOptions(const std::string & option_str, unsigned int default_opt);
   unsigned int defaultOpt() const { return _default; }
-  const std::string optionString() const;
-  const std::string optionStringColored() const;
+  /** Option string (may have embedded color codes) */
+  ColorString optionString() const;
   bool empty() const { return _options.empty(); }
   bool isYesNoPrompt() const;
 
-  const std::string optionHelp(unsigned int opt) const
+  const std::string optionHelp(unsigned int opt) const
   { static std::string empty; return opt < _opt_help.size() ? _opt_help[opt] : empty; }
   //const std::string getOptionHelp(const std::string & opt_str);
   void setOptionHelp(unsigned int opt, const std::string & help_str);
index ce2e255..237ec0f 100644 (file)
 ##
 ## Boolean values are:
 ##   0 1 yes no on off true false
-## Color values are:
-##   white grey darkgrey black red green blue yellow brown cyan purple
-##   lightred lightgreen lightblue lightcyan lightpurple
+
+## Color values:
+## Color values are case insensitive and may be prefixed with
+## either Bold, Light or Bright to turn on the terminals
+## bold/increased intensity attribute:
+##   Grey Red Green Blue Brown Cyan Purple/Magenta Black
+##   White     (== LightGrey)
+##   Yellow    (== LightBrown)
+##   Default   (== terminals default color)
+##   Bold, Light, Bright (== LightDefault, terminals default bold color)
 
 [main]
 
 ## Whether to use colors
 ##
 ## Valid values: always, never, or autodetect
-## Default value: never
-##
-# useColors = never
-
-## Do you use dark or light terminal background?
-##
-## Valid values: dark light
-## Default value: dark
+## Default value: autodetect
 ##
-# background = dark
+# useColors = autodetect
 
 ## Color for displaying results of operations.
 ## This includes installation summary, tables, and result messages.
 ##
 ## Valid values: color
-## Default value: white
+## Default value: default
 ##
-# result = white
+# result = default
 
 ## Color for displaying status and progress messages.
 ##
 ## Valid values: color
-## Default value: grey
+## Default value: default
 ##
-# msgStatus = grey
+# msgStatus = default
 
 ## Color for displaying error messages.
 ##
 ##
 # msgWarning = purple
 
-## Color for highlighting positive information.
-## For example, 'done' result of progress indicator.
-## (not used yet)
+## Color for highlighting additions or positive actions.
 ##
+## Valid values: color
 ## Default value: green
 ##
 # positive = green
 
-## Color for highlighting negative information.
-## For example, 'error' result of progress indicator.
-## (not used yet)
+## Color for highlighting modifications or changes.
+##
+## Valid values: color
+## Default value: brown
+##
+# change = brown
+
+## Color for highlighting removals or negative information.
 ##
 ## Valid values: color
 ## Default value: red
 ##
 # negative = red
 
-## Color for highlighting information for easier reading.
-## Unlike positive/negative color, this is intended for neutral information,
-## like highlighting table column by which the rows are sorted.
+## Color for highlighting information.
+##
+## Valid values: color
+## Default value: cyan
+##
+# highlight = cyan
+
+## Color for dimming less relevant information.
 ##
 ## Valid values: color
-## Default value: lightcyan
+## Default value: brown
 ##
-# highlight = lightcyan
+# lowlight = brown
 
-## Color for user dialog options.
+## Color for prompts.
+##
+## Valid values: color
+## Default value: bold
+##
+# prompt = bold
+
+## Color for prompt options.
+##
+## Valid values: color
+## Default value: undefined, follows prompt
+##
+# promptOption =
+
+## Do highlighting of package lists for easier reading?
+##
+## Within the packagelists displayed as transactions summary
+## hightlight the first letter of every package name (all),
+## or only of the first package in each letter group (first).
+##
+## Valid values: all/first/no
+## Default value: all
+##
+# pkglistHighlight = all
+
+## Color to use for package list highlighting (see pkglistHighlight)
+##
+## 'default' or 'bold' will use the current lists headline color. Any
+## other value will set a fix color used for all package lists.
 ##
 ## Valid values: color
-## Default value: grey
+## Default value: undefined, follows lists headline
 ##
-# promptOption = grey
+# pkglistHighlightAttribute =
 
 [obs]
 
index 5007a28..791cca0 100644 (file)
@@ -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 >= 14.27.0
+BuildRequires:  libzypp-devel >= 14.37.0
 BuildRequires:  readline-devel >= 5.1
 Requires:       procps
 %if 0%{?suse_version}
@@ -101,10 +101,12 @@ Authors:
 mkdir build
 cd build
 
-# The code base is the same, but SLES11-SP1 (suse_version == 1110)
-# may use it's own set of .po files from po/sle-zypper-po.tar.bz2.
+# Same codebase, but SLES may use it's own translation set.
+#     suse_version
+#      1110            SLES11
+#      1315            SLES12
 unset TRANSLATION_SET
-%if 0%{?suse_version} == 1110
+%if 0%{?suse_version} == 1110 || 0%{?suse_version} == 1315
 if [ -f ../po/sle-zypper-po.tar.bz ]; then
   export TRANSLATION_SET=sle-zypper
 fi
@@ -156,6 +158,7 @@ rm -rf "$RPM_BUILD_ROOT"
 %dir %{_datadir}/zypper/xml
 %{_datadir}/zypper/xml/xmlout.rnc
 %doc %{_mandir}/man8/zypper.8*
+%doc %{_mandir}/man8/zypp-refresh.8*
 %doc %dir %{_datadir}/doc/packages/zypper
 %doc %{_datadir}/doc/packages/zypper/COPYING
 %doc %{_datadir}/doc/packages/zypper/HACKING