From 047419634ce55aeefa82c4fe0b4b8002519018b4 Mon Sep 17 00:00:00 2001 From: "Steven G. Harms" Date: Wed, 7 Jan 2026 21:40:40 -0500 Subject: [PATCH 01/14] gitignore: ignore vim swap files Add *.sw? pattern to ignore vim swap files (.swp, .swo, etc). --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index db636cbee..acdad780d 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,4 @@ *.dir *~ .build +*.sw? From aff5705a932c53789b5587c0ecd82a442e688974 Mon Sep 17 00:00:00 2001 From: "Steven G. Harms" Date: Wed, 7 Jan 2026 21:34:53 -0500 Subject: [PATCH 02/14] Packaging: add PRIV_CMD privilege escalation detection Introduce PRIV_CMD variable that detects the appropriate privilege escalation command based on the environment: - Running as root: no escalation needed (empty string) - FreeBSD: prefer doas (if configured), fall back to sudo - Linux: use sudo This provides a single point of configuration for all privilege escalation needs across the build scripts. --- Packaging/environment.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/Packaging/environment.sh b/Packaging/environment.sh index 3e8950aef..3a59ab6cc 100644 --- a/Packaging/environment.sh +++ b/Packaging/environment.sh @@ -134,6 +134,32 @@ else MAKE_CMD=make fi # +# Privilege escalation command +if [ "$(id -u)" = "0" ]; then + # Running as root + PRIV_CMD="" +elif [ ${OS_ID} = "freebsd" ]; then + # FreeBSD: prefer doas, fall back to sudo + if pkg info --quiet doas >/dev/null 2>&1; then + if doas -C /usr/local/etc/doas.conf >/dev/null 2>&1; then + PRIV_CMD="doas" + elif pkg info --quiet sudo >/dev/null 2>&1; then + PRIV_CMD="sudo" + else + printf "Warning: doas found but not configured, and no sudo available\n" + PRIV_CMD="doas" + fi + elif pkg info --quiet sudo >/dev/null 2>&1; then + PRIV_CMD="sudo" + else + printf "Warning: no privilege escalation command found\n" + PRIV_CMD="doas" + fi +else + # Linux: use sudo + PRIV_CMD="sudo" +fi + if [ "$1" != "" ];then INSTALL_CMD="${MAKE_CMD} install DESTDIR=${1}" else From ca21b48ce1ab24c3c09e2d0b627f291ee5960c4f Mon Sep 17 00:00:00 2001 From: "Steven G. Harms" Date: Wed, 7 Jan 2026 21:38:37 -0500 Subject: [PATCH 03/14] Packaging: add print_WARN function Add print_WARN() helper function for displaying warning messages with yellow/red formatting, consistent with other print helpers. --- Packaging/functions.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Packaging/functions.sh b/Packaging/functions.sh index 15194a717..63a8e1b77 100644 --- a/Packaging/functions.sh +++ b/Packaging/functions.sh @@ -94,6 +94,17 @@ print_ERR() printf "\033[0m" } +print_WARN() +{ + printf "\033[33m" + printf "================================================================================\n" + printf "\033[31m" + printf '\033[1m%s\n' "$1" + printf "\033[33m" + printf "================================================================================\n" + printf "\033[0m" +} + print_help() { SCRIPT_NAME=`basename $0` From 178507282d24593dbc7e940ba6c85bc99fda6005 Mon Sep 17 00:00:00 2001 From: "Steven G. Harms" Date: Wed, 7 Jan 2026 21:35:31 -0500 Subject: [PATCH 04/14] Packaging: update prepare_freebsd_environment for flexible privilege handling Refactor prepare_freebsd_environment() to intelligently handle privilege escalation: - Detect if running as root and skip privilege escalation - Try doas first (with config validation) if not root - Fall back to sudo if doas unavailable or unconfigured - Provide clear error if neither is available This replaces the previous approach that only checked for sudo and failed if it wasn't installed. --- Packaging/functions.sh | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/Packaging/functions.sh b/Packaging/functions.sh index 63a8e1b77..b7ada6e65 100644 --- a/Packaging/functions.sh +++ b/Packaging/functions.sh @@ -155,10 +155,28 @@ prepare_redhat_environment() prepare_freebsd_environment() { - pkg info --quiet sudo - if [ $? = 1 ];then - print_ERR "There's no 'sudo' package installed. Please run 'pkg install sudo' command as root." - exit 1 + # If running as root, no privilege escalation needed + if [ "$(id -u)" = "0" ]; then + pkg install --yes --quiet ${BUILD_TOOLS} + return 0 + fi + + # Not root, try doas or sudo + local pkg_cmd="" + if pkg info --quiet doas; then + if doas -C /usr/local/etc/doas.conf 2>/dev/null; then + pkg_cmd="doas" + fi + fi + + if [ -z "$pkg_cmd" ] && pkg info --quiet sudo; then + pkg_cmd="sudo" + fi + + if [ -n "$pkg_cmd" ]; then + $pkg_cmd pkg install --yes --quiet ${BUILD_TOOLS} + else + print_ERR "Not running as root and no working doas/sudo found. Install and configure doas or sudo." + return 1 fi - sudo pkg install --yes --quiet ${BUILD_TOOLS} } From 48dbca2df109dde1cc02319c4b37c06a6d79e31e Mon Sep 17 00:00:00 2001 From: "Steven G. Harms" Date: Wed, 7 Jan 2026 21:36:00 -0500 Subject: [PATCH 05/14] Packaging: use PRIV_CMD in environment.sh utility commands Replace hardcoded sudo references with PRIV_CMD variable in: - INSTALL_CMD: handles FreeBSD (no -E flag) vs Linux (with -E flag) - RM_CMD, LN_CMD, MV_CMD, CP_CMD, MKDIR_CMD: use PRIV_CMD prefix This allows these commands to adapt to the detected privilege escalation method (root, doas, or sudo). --- Packaging/environment.sh | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/Packaging/environment.sh b/Packaging/environment.sh index 3a59ab6cc..78c18f880 100644 --- a/Packaging/environment.sh +++ b/Packaging/environment.sh @@ -163,7 +163,14 @@ fi if [ "$1" != "" ];then INSTALL_CMD="${MAKE_CMD} install DESTDIR=${1}" else - INSTALL_CMD="sudo -E ${MAKE_CMD} install" + if [ -z "$PRIV_CMD" ]; then + # Running as root + INSTALL_CMD="${MAKE_CMD} install" + elif [ ${OS_ID} = "freebsd" ]; then + INSTALL_CMD="${PRIV_CMD} ${MAKE_CMD} install" + else + INSTALL_CMD="${PRIV_CMD} -E ${MAKE_CMD} install" + fi fi # Utilities @@ -174,11 +181,11 @@ if [ "$1" != "" ];then CP_CMD="cp -R" MKDIR_CMD="mkdir -p" else - RM_CMD="sudo rm" - LN_CMD="sudo ln -sf" - MV_CMD="sudo mv -v" - CP_CMD="sudo cp -R" - MKDIR_CMD="sudo mkdir -p" + RM_CMD="${PRIV_CMD} rm" + LN_CMD="${PRIV_CMD} ln -sf" + MV_CMD="${PRIV_CMD} mv -v" + CP_CMD="${PRIV_CMD} cp -R" + MKDIR_CMD="${PRIV_CMD} mkdir -p" fi # Linker From bae59a6a0c6da7c313424280bb227eb950078063 Mon Sep 17 00:00:00 2001 From: "Steven G. Harms" Date: Wed, 7 Jan 2026 21:40:46 -0500 Subject: [PATCH 06/14] Dependencies: add cmake to FreeBSD CoreFoundation dependencies Add cmake to CORE_SYSTEM_DEPS for FreeBSD 15. This package is required for building CoreFoundation and should be installed alongside the other build dependencies. --- Packaging/Sources/freebsd-15.deps.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/Packaging/Sources/freebsd-15.deps.sh b/Packaging/Sources/freebsd-15.deps.sh index 2b0caaadb..b1236a92b 100644 --- a/Packaging/Sources/freebsd-15.deps.sh +++ b/Packaging/Sources/freebsd-15.deps.sh @@ -13,6 +13,7 @@ CORE_SYSTEM_DEPS=" curl libuuid pkgconf + cmake " # libwraster From ba997fb0a5222452dcb1b2725254bc7df604ecf6 Mon Sep 17 00:00:00 2001 From: "Steven G. Harms" Date: Wed, 7 Jan 2026 21:36:40 -0500 Subject: [PATCH 07/14] Packaging: use PRIV_CMD in 1_build_libcorefoundation.sh Replace hardcoded sudo calls with PRIV_CMD variable: - pkg install command for FreeBSD dependencies - ldconfig command after installation This allows the script to work when running as root or with doas. --- Packaging/Sources/1_build_libcorefoundation.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Packaging/Sources/1_build_libcorefoundation.sh b/Packaging/Sources/1_build_libcorefoundation.sh index 27e0e0a4a..f2d0888ef 100755 --- a/Packaging/Sources/1_build_libcorefoundation.sh +++ b/Packaging/Sources/1_build_libcorefoundation.sh @@ -7,7 +7,7 @@ ${ECHO} ">>> Installing ${OS_ID} packages for CoreFoundation library build" if [ ${OS_ID} = "freebsd" ]; then ${ECHO} "FreeBSD: calling 'pkg install'..." - sudo pkg install --yes --quiet ${CORE_SYSTEM_DEPS} + ${PRIV_CMD} pkg install --yes --quiet ${CORE_SYSTEM_DEPS} elif [ ${OS_ID} = "debian" ] || [ ${OS_ID} = "ubuntu" ]; then ${ECHO} "Debian-based Linux distribution: calling 'apt-get install'." sudo apt-get install -y ${RUNTIME_DEPS} || exit 1 @@ -135,5 +135,5 @@ if [ ${OS_ID} != "freebsd" ]; then fi if [ "$DEST_DIR" = "" ]; then - sudo ldconfig + ${PRIV_CMD} ldconfig fi From cb85683aea4d0dcd5f314365d5ba8d67b5e789e7 Mon Sep 17 00:00:00 2001 From: "Steven G. Harms" Date: Wed, 7 Jan 2026 21:48:32 -0500 Subject: [PATCH 08/14] Packaging: configure ldconfig properly for FreeBSD On FreeBSD, create a dedicated ldconfig drop-in file at /usr/local/libdata/ldconfig/nextspace containing the NextSpace library path, then run 'ldconfig -R' to rebuild hints from all configured paths. This follows FreeBSD conventions for package-specific library paths and ensures the libraries are properly registered in the system. --- Packaging/Sources/1_build_libcorefoundation.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Packaging/Sources/1_build_libcorefoundation.sh b/Packaging/Sources/1_build_libcorefoundation.sh index f2d0888ef..b782a4a94 100755 --- a/Packaging/Sources/1_build_libcorefoundation.sh +++ b/Packaging/Sources/1_build_libcorefoundation.sh @@ -135,5 +135,11 @@ if [ ${OS_ID} != "freebsd" ]; then fi if [ "$DEST_DIR" = "" ]; then - ${PRIV_CMD} ldconfig + if [ ${OS_ID} = "freebsd" ]; then + ${ECHO} "Configuring ldconfig for NextSpace libraries..." + echo "/usr/NextSpace/lib" | ${PRIV_CMD} tee /usr/local/libdata/ldconfig/nextspace > /dev/null + ${PRIV_CMD} ldconfig -R + else + ${PRIV_CMD} ldconfig + fi fi From 5155bbe57aa570595e5e3a1a102460abd4687d1d Mon Sep 17 00:00:00 2001 From: "Steven G. Harms" Date: Wed, 7 Jan 2026 21:56:53 -0500 Subject: [PATCH 09/14] Packaging: add NEXTSPACE_ROOT variable for OS-specific install paths Introduce NEXTSPACE_ROOT variable to define the installation root: - FreeBSD: /usr/local/NextSpace (third-party software convention) - Linux: /usr/NextSpace (existing convention) This allows the NextSpace project to follow FreeBSD filesystem hierarchy standards while maintaining compatibility with existing Linux installations. --- Packaging/environment.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Packaging/environment.sh b/Packaging/environment.sh index 78c18f880..fc4cac966 100644 --- a/Packaging/environment.sh +++ b/Packaging/environment.sh @@ -81,6 +81,14 @@ PROJECT_DIR=`pwd` printf "NextSpace repo:\t${PROJECT_DIR}\n" cd ${_PWD} +# NextSpace installation root +if [ ${OS_ID} = "freebsd" ]; then + NEXTSPACE_ROOT="/usr/local/NextSpace" +else + NEXTSPACE_ROOT="/usr/NextSpace" +fi +printf "Install root:\t${NEXTSPACE_ROOT}\n" + if [ -z $BUILD_RPM ]; then BUILD_ROOT="${_PWD}/BUILD_ROOT" if [ ! -d ${BUILD_ROOT} ]; then From b53a03b474235eb0cea681864b3903ee30ee7ca7 Mon Sep 17 00:00:00 2001 From: "Steven G. Harms" Date: Wed, 7 Jan 2026 21:58:09 -0500 Subject: [PATCH 10/14] Packaging: use NEXTSPACE_ROOT in 1_build_libcorefoundation.sh Replace hardcoded /usr/NextSpace paths with NEXTSPACE_ROOT variable throughout the CoreFoundation build script: - CMake configuration flags (install prefix, library paths, include paths) - CFNetwork configuration (Linux only) - Install directory paths - ldconfig configuration path This allows the script to adapt to the correct installation location for each OS (FreeBSD: /usr/local/NextSpace, Linux: /usr/NextSpace). --- .../Sources/1_build_libcorefoundation.sh | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Packaging/Sources/1_build_libcorefoundation.sh b/Packaging/Sources/1_build_libcorefoundation.sh index b782a4a94..76fadc64f 100755 --- a/Packaging/Sources/1_build_libcorefoundation.sh +++ b/Packaging/Sources/1_build_libcorefoundation.sh @@ -40,16 +40,16 @@ cd ${BUILD_ROOT}/${CF_PKG_NAME} || exit 1 rm -rf .build 2>/dev/null mkdir -p .build cd .build -C_FLAGS="-I/usr/local/include -I/usr/NextSpace/include -Wno-switch -Wno-enum-conversion" +C_FLAGS="-I/usr/local/include -I${NEXTSPACE_ROOT}/include -Wno-switch -Wno-enum-conversion" $CMAKE_CMD .. \ -DCMAKE_C_COMPILER=${C_COMPILER} \ -DCMAKE_C_FLAGS="${C_FLAGS}" \ - -DCMAKE_SHARED_LINKER_FLAGS="-L/usr/local/lib -L/usr/NextSpace/lib -luuid" \ + -DCMAKE_SHARED_LINKER_FLAGS="-L/usr/local/lib -L${NEXTSPACE_ROOT}/lib -luuid" \ -DCF_DEPLOYMENT_SWIFT=NO \ -DBUILD_SHARED_LIBS=YES \ - -DCMAKE_INSTALL_PREFIX=/usr/NextSpace \ - -DCMAKE_INSTALL_LIBDIR=/usr/NextSpace/lib \ - -DCMAKE_LIBRARY_PATH=/usr/NextSpace/lib \ + -DCMAKE_INSTALL_PREFIX=${NEXTSPACE_ROOT} \ + -DCMAKE_INSTALL_LIBDIR=${NEXTSPACE_ROOT}/lib \ + -DCMAKE_LIBRARY_PATH=${NEXTSPACE_ROOT}/lib \ \ -DCMAKE_SKIP_RPATH=ON \ -DCMAKE_BUILD_TYPE=Debug \ @@ -65,16 +65,16 @@ if [ ${OS_ID} != "freebsd" ]; then rm -rf .build 2>/dev/null mkdir -p .build cd .build - CFN_CFLAGS="-F../../${CF_PKG_NAME}/.build -I/usr/local/include -I/usr/NextSpace/include" - CFN_LD_FLAGS="-L/usr/NextSpace/lib -L../../${CF_PKG_NAME}/.build/CoreFoundation.framework" + CFN_CFLAGS="-F../../${CF_PKG_NAME}/.build -I/usr/local/include -I${NEXTSPACE_ROOT}/include" + CFN_LD_FLAGS="-L${NEXTSPACE_ROOT}/lib -L../../${CF_PKG_NAME}/.build/CoreFoundation.framework" cmake .. \ -DCMAKE_C_COMPILER=${C_COMPILER} \ -DCMAKE_CXX_COMPILER=clang++ \ -DCFNETWORK_CFLAGS="${CFN_CFLAGS}" \ -DCFNETWORK_LDLAGS="${CFN_LD_FLAGS}" \ -DBUILD_SHARED_LIBS=YES \ - -DCMAKE_INSTALL_PREFIX=/usr/NextSpace \ - -DCMAKE_INSTALL_LIBDIR=/usr/NextSpace/lib \ + -DCMAKE_INSTALL_PREFIX=${NEXTSPACE_ROOT} \ + -DCMAKE_INSTALL_LIBDIR=${NEXTSPACE_ROOT}/lib \ \ -DCMAKE_SKIP_RPATH=ON \ -DCMAKE_BUILD_TYPE=Debug @@ -90,7 +90,7 @@ fi cd ${BUILD_ROOT}/${CF_PKG_NAME}/.build || exit 1 $INSTALL_CMD -CF_DIR=${DEST_DIR}/usr/NextSpace/Frameworks/CoreFoundation.framework +CF_DIR=${DEST_DIR}${NEXTSPACE_ROOT}/Frameworks/CoreFoundation.framework $MKDIR_CMD ${CF_DIR}/Versions/${libcorefoundation_version} cd $CF_DIR @@ -114,7 +114,7 @@ if [ ${OS_ID} != "freebsd" ]; then cd ${BUILD_ROOT}/${CFNET_PKG_NAME}/.build || exit 1 $INSTALL_CMD - CFNET_DIR=${DEST_DIR}/usr/NextSpace/Frameworks/CFNetwork.framework + CFNET_DIR=${DEST_DIR}${NEXTSPACE_ROOT}/Frameworks/CFNetwork.framework $MKDIR_CMD $CFNET_DIR/Versions/${libcfnetwork_version} cd $CFNET_DIR @@ -137,7 +137,7 @@ fi if [ "$DEST_DIR" = "" ]; then if [ ${OS_ID} = "freebsd" ]; then ${ECHO} "Configuring ldconfig for NextSpace libraries..." - echo "/usr/NextSpace/lib" | ${PRIV_CMD} tee /usr/local/libdata/ldconfig/nextspace > /dev/null + echo "${NEXTSPACE_ROOT}/lib" | ${PRIV_CMD} tee /usr/local/libdata/ldconfig/nextspace > /dev/null ${PRIV_CMD} ldconfig -R else ${PRIV_CMD} ldconfig From cffeece50e9cfec083a46c10b823eeaf27edb143 Mon Sep 17 00:00:00 2001 From: "Steven G. Harms" Date: Fri, 9 Jan 2026 11:38:56 -0500 Subject: [PATCH 11/14] Packaging: Simplify determination of PRIV_CMD --- Packaging/environment.sh | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/Packaging/environment.sh b/Packaging/environment.sh index fc4cac966..5f4e88690 100644 --- a/Packaging/environment.sh +++ b/Packaging/environment.sh @@ -144,27 +144,10 @@ fi # # Privilege escalation command if [ "$(id -u)" = "0" ]; then - # Running as root PRIV_CMD="" -elif [ ${OS_ID} = "freebsd" ]; then - # FreeBSD: prefer doas, fall back to sudo - if pkg info --quiet doas >/dev/null 2>&1; then - if doas -C /usr/local/etc/doas.conf >/dev/null 2>&1; then - PRIV_CMD="doas" - elif pkg info --quiet sudo >/dev/null 2>&1; then - PRIV_CMD="sudo" - else - printf "Warning: doas found but not configured, and no sudo available\n" - PRIV_CMD="doas" - fi - elif pkg info --quiet sudo >/dev/null 2>&1; then - PRIV_CMD="sudo" - else - printf "Warning: no privilege escalation command found\n" - PRIV_CMD="doas" - fi +elif [ ${OS_ID} = "freebsd" ] && command -v doas >/dev/null 2>&1; then + PRIV_CMD="doas" else - # Linux: use sudo PRIV_CMD="sudo" fi From c83fda886b7f2dfc54e8855331d6d173310c06d8 Mon Sep 17 00:00:00 2001 From: "Steven G. Harms" Date: Fri, 9 Jan 2026 11:44:37 -0500 Subject: [PATCH 12/14] Packaging: consolidate PRIV_CMD usage in prepare_freebsd_environment Move PRIV_CMD definition earlier and remove duplicated privilege escalation logic from prepare_freebsd_environment(). --- Packaging/environment.sh | 20 +++++++++++--------- Packaging/functions.sh | 25 +------------------------ 2 files changed, 12 insertions(+), 33 deletions(-) diff --git a/Packaging/environment.sh b/Packaging/environment.sh index 5f4e88690..bc9a3bd57 100644 --- a/Packaging/environment.sh +++ b/Packaging/environment.sh @@ -56,6 +56,17 @@ else fi printf "OS:\t\t${OS_ID}-${OS_VERSION}\n" +#--------------------------------------- +# Privilege escalation command +#--------------------------------------- +if [ "$(id -u)" = "0" ]; then + PRIV_CMD="" +elif [ ${OS_ID} = "freebsd" ] && command -v doas >/dev/null 2>&1; then + PRIV_CMD="doas" +else + PRIV_CMD="sudo" +fi + #--------------------------------------- # Machine #--------------------------------------- @@ -141,15 +152,6 @@ if type "gmake" 2>/dev/null >/dev/null ;then else MAKE_CMD=make fi -# -# Privilege escalation command -if [ "$(id -u)" = "0" ]; then - PRIV_CMD="" -elif [ ${OS_ID} = "freebsd" ] && command -v doas >/dev/null 2>&1; then - PRIV_CMD="doas" -else - PRIV_CMD="sudo" -fi if [ "$1" != "" ];then INSTALL_CMD="${MAKE_CMD} install DESTDIR=${1}" diff --git a/Packaging/functions.sh b/Packaging/functions.sh index b7ada6e65..d1560b5a3 100644 --- a/Packaging/functions.sh +++ b/Packaging/functions.sh @@ -155,28 +155,5 @@ prepare_redhat_environment() prepare_freebsd_environment() { - # If running as root, no privilege escalation needed - if [ "$(id -u)" = "0" ]; then - pkg install --yes --quiet ${BUILD_TOOLS} - return 0 - fi - - # Not root, try doas or sudo - local pkg_cmd="" - if pkg info --quiet doas; then - if doas -C /usr/local/etc/doas.conf 2>/dev/null; then - pkg_cmd="doas" - fi - fi - - if [ -z "$pkg_cmd" ] && pkg info --quiet sudo; then - pkg_cmd="sudo" - fi - - if [ -n "$pkg_cmd" ]; then - $pkg_cmd pkg install --yes --quiet ${BUILD_TOOLS} - else - print_ERR "Not running as root and no working doas/sudo found. Install and configure doas or sudo." - return 1 - fi + ${PRIV_CMD} pkg install --yes --quiet ${BUILD_TOOLS} } From 9b11e8aabd7eb8006d148dd8f7e19edcced6f18e Mon Sep 17 00:00:00 2001 From: "Steven G. Harms" Date: Fri, 9 Jan 2026 12:00:41 -0500 Subject: [PATCH 13/14] Packaging: Remove unused WARN function --- Packaging/functions.sh | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/Packaging/functions.sh b/Packaging/functions.sh index d1560b5a3..9bf210ca1 100644 --- a/Packaging/functions.sh +++ b/Packaging/functions.sh @@ -94,17 +94,6 @@ print_ERR() printf "\033[0m" } -print_WARN() -{ - printf "\033[33m" - printf "================================================================================\n" - printf "\033[31m" - printf '\033[1m%s\n' "$1" - printf "\033[33m" - printf "================================================================================\n" - printf "\033[0m" -} - print_help() { SCRIPT_NAME=`basename $0` From 0991896bd5db5534c67a7feec4631250445a8cef Mon Sep 17 00:00:00 2001 From: "Steven G. Harms" Date: Fri, 9 Jan 2026 12:16:24 -0500 Subject: [PATCH 14/14] Packaging: simplify INSTALL_CMD logic Reduce three-way branch to two-way: sudo needs -E flag, everything else (doas or root) doesn't. --- Packaging/environment.sh | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Packaging/environment.sh b/Packaging/environment.sh index bc9a3bd57..8328bf3f7 100644 --- a/Packaging/environment.sh +++ b/Packaging/environment.sh @@ -156,13 +156,10 @@ fi if [ "$1" != "" ];then INSTALL_CMD="${MAKE_CMD} install DESTDIR=${1}" else - if [ -z "$PRIV_CMD" ]; then - # Running as root - INSTALL_CMD="${MAKE_CMD} install" - elif [ ${OS_ID} = "freebsd" ]; then - INSTALL_CMD="${PRIV_CMD} ${MAKE_CMD} install" - else + if [ "$PRIV_CMD" = "sudo" ]; then INSTALL_CMD="${PRIV_CMD} -E ${MAKE_CMD} install" + else + INSTALL_CMD="${PRIV_CMD} ${MAKE_CMD} install" fi fi