From be95688d27c3e3e800265a2719e0de870127d3ff Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Wed, 20 Mar 2024 08:40:44 +0100 Subject: [PATCH] Configure `base-devel` using `conf.d` directory --- scripts/Arch/Config/base-devel/install.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/Arch/Config/base-devel/install.sh b/scripts/Arch/Config/base-devel/install.sh index 75842cf1..ba2e41fd 100755 --- a/scripts/Arch/Config/base-devel/install.sh +++ b/scripts/Arch/Config/base-devel/install.sh @@ -3,11 +3,13 @@ pushd "${BASH_SOURCE%/*}" > /dev/null; configFile="/etc/makepkg.conf"; +customFile="$configFile.d/makepkg.conf"; pattern="^\\(OPTIONS=(.*[( ]\\)\\(debug[ )].*)\\)$"; -if cat "$configFile" | grep "$pattern" > /dev/null +if [ ! -f "$customFile" ]; then - sudo sed -i "/$pattern/s/$pattern/\\1!\\2/" "$configFile" + sed "/$pattern/{ s/$pattern/\\1!\\2/; p; }; d" "$configFile" | sudo tee "$customFile" > /dev/null; + echo "MAKEFLAGS=\"-j\$(nproc)\"" | sudo tee --append "$customFile" > /dev/null; fi; popd > /dev/null;