Imported Upstream version 17.0.2
[platform/upstream/libzypp.git] / doc / autoinclude / RepoVariables.doc
1 /**
2
3 \page zypp-repovars Repository Variables
4
5 \author Michael Andres <ma@suse.de>
6
7 \section zypp-repovars-intro Repository Variables
8
9 Within a \c .repo or \c .serivce file, the name and URLs are subject to variable substitution.
10
11 Variables are e.g. usefull for related repositories like packman (<tt>http://ftp.gwdg.de/pub/linux/packman/suse/$releasever</tt>), which shall always fit the installed distribution, even after a distribution upgrade. To help performing a distribution upgrade, the value of \c $releasever can be overwritten in zypper using the \c --releasever global option. This way you can easily switch all repositories using \c $releasever to the new version (provided the server layouts did not change and new repos are already available).
12
13 The variable expander also supports shell like definition of default and alternate values.
14
15 \see \ref zypp::repo::RepoVarExpand Variable expander
16
17
18 \subsection zypp-repoars-builtin Builtin repository variables
19
20 \li \c $arch -
21         The system's CPU architecture.
22
23 \li \c $basearch -
24         The base architecture of the system. For example, iX86 machines have a base architecture of \c i386, while AMD64 and Intel64 have \c x86_64.
25
26 \li \c $releasever -
27         The version of your openSUSE or SUSE Linux. The value is obtained from the <tt>/product/version</tt> XML-node in <tt>/etc/products.d/baseproduct</tt>.
28
29 \li \c $releasever_minor
30 \li \c $releasever_major -
31         \c $releasever_major will be set to the leading portion up to (but not including) the 1st dot; \c $releasever_minor to the trailing portion after the 1st dot. If there's no dot in \c $releasever, \c $releasever_major is the same as \c $releasever and \c $releasever_minor is empty.
32
33
34 \subsection zypp-repoars-userdefined User defined repository variables [requires 'libzypp(repovarexpand) >= 1']
35
36 A custom repository variable is defined by creating a file in \c /etc/zypp/vars.d. The variable name equals the file name. The files first line (up to but not including the newline character) defines the variables value. Valid variable(file) names consist of alphanumeric chars and '_' only.
37
38 Variable substitution within an URIs authority [requires 'libzypp(repovarexpand) >= 1.1'] is limited to \c host and \c port. Bash style definition of default and alternate values is not supported. No variables can be used in an URIs \c scheme, \c user and \c password.
39
40 */