xbps-src: support "alternatives" from xbps-0.48.

This commit is contained in:
Juan RP 2015-10-30 12:39:59 +01:00
parent 8c4fcac519
commit 3e1154266f
3 changed files with 12 additions and 1 deletions

View File

@ -493,6 +493,10 @@ pkgver the resulting package should revert. This field *must* be defined before
defined in `reverts` must be lesser than the one defined in `version`. defined in `reverts` must be lesser than the one defined in `version`.
example: `reverts="2.0_1 2.0_2"` example: `reverts="2.0_1 2.0_2"`
- `alternatives` A white space separated list of supported alternatives the package provides.
A list is composed of three components separated by a colon: group, symlink and target.
i.e `alternatives="vi:/usr/bin/vi:/usr/bin/nvi ex:/usr/bin/ex:/usr/bin/nvi-ex"`.
<a id="repositories"></a> <a id="repositories"></a>
#### Repositories #### Repositories

View File

@ -2,7 +2,7 @@
# a package template and can also be used in subpkgs. # a package template and can also be used in subpkgs.
## VARIABLES ## VARIABLES
unset -v noarch conf_files mutable_files preserve triggers unset -v noarch conf_files mutable_files preserve triggers alternatives
unset -v depends run_depends replaces provides conflicts tags unset -v depends run_depends replaces provides conflicts tags
# hooks/post-install/03-strip-and-debug-pkgs # hooks/post-install/03-strip-and-debug-pkgs

View File

@ -82,6 +82,12 @@ genpkg() {
_conf_files="${_conf_files} ${f}" _conf_files="${_conf_files} ${f}"
done done
fi fi
if [ -n "$alternatives" ]; then
local _alternatives=
for f in ${alternatives}; do
_alternatives="${_alternatives} ${f}"
done
fi
msg_normal "Creating $binpkg for repository $pkgdir ...\n" msg_normal "Creating $binpkg for repository $pkgdir ...\n"
@ -100,6 +106,7 @@ genpkg() {
${_gitrevs:+--source-revisions "${_gitrevs}"} \ ${_gitrevs:+--source-revisions "${_gitrevs}"} \
${_shprovides:+--shlib-provides "${_shprovides}"} \ ${_shprovides:+--shlib-provides "${_shprovides}"} \
${_shrequires:+--shlib-requires "${_shrequires}"} \ ${_shrequires:+--shlib-requires "${_shrequires}"} \
${_alternatives:+--alternatives "${_alternatives}"} \
${_preserve:+--preserve} \ ${_preserve:+--preserve} \
${_tags:+--tags "${tags}"} \ ${_tags:+--tags "${tags}"} \
--architecture ${arch} \ --architecture ${arch} \