xbps-src: fix pkg options parsing in package names containing dashes.
When using per-pkg options via etc/conf, all dashes should be replaced by underscores, i.e: XBPS_PKG_OPTIONS_xorg_server=opt,~opt2
This commit is contained in:
parent
08328d20f1
commit
e372fcc6e0
|
@ -540,6 +540,9 @@ Permanent global package build options can be set via `XBPS_PKG_OPTIONS` variabl
|
||||||
`etc/conf` configuration file. Per package build options can be set via
|
`etc/conf` configuration file. Per package build options can be set via
|
||||||
`XBPS_PKG_OPTIONS_<pkgname>`.
|
`XBPS_PKG_OPTIONS_<pkgname>`.
|
||||||
|
|
||||||
|
> NOTE: if `pkgname` contains `dashes`, those should be replaced by `underscores`
|
||||||
|
i.e `XBPS_PKG_OPTIONS_xorg_server=opt`.
|
||||||
|
|
||||||
The list of supported package build options and its description is defined in the
|
The list of supported package build options and its description is defined in the
|
||||||
`common/options.description` file.
|
`common/options.description` file.
|
||||||
|
|
||||||
|
|
|
@ -90,14 +90,15 @@ msg_normal_append() {
|
||||||
|
|
||||||
set_build_options() {
|
set_build_options() {
|
||||||
local f j opt optval _optsset pkgopts
|
local f j opt optval _optsset pkgopts
|
||||||
local -A options
|
local -A options _pkgname
|
||||||
|
|
||||||
if [ -z "$build_options" ]; then
|
if [ -z "$build_options" ]; then
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for f in ${build_options}; do
|
for f in ${build_options}; do
|
||||||
eval pkgopts="\$XBPS_PKG_OPTIONS_${pkgname}"
|
_pkgname=${pkgname//\-/\_}
|
||||||
|
eval pkgopts="\$XBPS_PKG_OPTIONS_${_pkgname}"
|
||||||
if [ -z "$pkgopts" -o "$pkgopts" = "" ]; then
|
if [ -z "$pkgopts" -o "$pkgopts" = "" ]; then
|
||||||
pkgopts=${XBPS_PKG_OPTIONS}
|
pkgopts=${XBPS_PKG_OPTIONS}
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue