summaryrefslogtreecommitdiffstats
path: root/config/pkg.sh
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2024-04-17 10:18:31 -0400
committerTavian Barnes <tavianator@tavianator.com>2024-04-17 10:18:31 -0400
commit2838fd4a4e7fa40dd9cd95c81eb852190371ec5a (patch)
tree6cf8af9dd8da5802a76c418bac02087cdd82c24b /config/pkg.sh
parent83bfed52e523ef942da82a083584a4548182aaa4 (diff)
downloadbfs-2838fd4a4e7fa40dd9cd95c81eb852190371ec5a.tar.xz
build: Make the config scripts POSIX-compliant
Diffstat (limited to 'config/pkg.sh')
-rwxr-xr-xconfig/pkg.sh8
1 files changed, 4 insertions, 4 deletions
diff --git a/config/pkg.sh b/config/pkg.sh
index 2ca533e..4ebea64 100755
--- a/config/pkg.sh
+++ b/config/pkg.sh
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/bin/sh
# Copyright © Tavian Barnes <tavianator@tavianator.com>
# SPDX-License-Identifier: 0BSD
@@ -7,10 +7,10 @@
set -eu
-NAME="${1^^}"
-declare -n XUSE="USE_$NAME"
+NAME=$(printf '%s' "$1" | tr 'a-z' 'A-Z')
+eval "XUSE=\"\${USE_$NAME:-}\""
-if [ "${XUSE:-}" ]; then
+if [ "$XUSE" ]; then
USE="$XUSE"
elif config/pkgconf.sh "$1"; then
USE=y