From e372fcc6e0419fbbf23df2b9879f34b37d60837d Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sat, 19 Jul 2014 10:39:22 +0200 Subject: [PATCH] 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 --- Manual.md | 3 +++ common/xbps-src/shutils/common.sh | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Manual.md b/Manual.md index 78a6d0a3038..af995e42e9d 100644 --- a/Manual.md +++ b/Manual.md @@ -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 `XBPS_PKG_OPTIONS_`. +> 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 `common/options.description` file. diff --git a/common/xbps-src/shutils/common.sh b/common/xbps-src/shutils/common.sh index 3bc4458fc34..e79ce0930d7 100644 --- a/common/xbps-src/shutils/common.sh +++ b/common/xbps-src/shutils/common.sh @@ -90,14 +90,15 @@ msg_normal_append() { set_build_options() { local f j opt optval _optsset pkgopts - local -A options + local -A options _pkgname if [ -z "$build_options" ]; then return 0 fi 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 pkgopts=${XBPS_PKG_OPTIONS} fi