2024-03-07 20:23:55 +00:00
|
|
|
#!/bin/bash
|
2024-03-07 20:33:58 +00:00
|
|
|
# Bacause of: https://www.reddit.com/r/archlinux/s/KTx9AbsFfT
|
2024-03-07 20:23:55 +00:00
|
|
|
pushd "${BASH_SOURCE%/*}" > /dev/null;
|
|
|
|
|
|
|
|
configFile="/etc/makepkg.conf";
|
2024-03-20 07:40:44 +00:00
|
|
|
customFile="$configFile.d/makepkg.conf";
|
2024-03-07 20:23:55 +00:00
|
|
|
pattern="^\\(OPTIONS=(.*[( ]\\)\\(debug[ )].*)\\)$";
|
|
|
|
|
2024-03-20 07:40:44 +00:00
|
|
|
if [ ! -f "$customFile" ];
|
2024-03-07 20:23:55 +00:00
|
|
|
then
|
2024-03-20 07:40:44 +00:00
|
|
|
sed "/$pattern/{ s/$pattern/\\1!\\2/; p; }; d" "$configFile" | sudo tee "$customFile" > /dev/null;
|
|
|
|
echo "MAKEFLAGS=\"-j\$(nproc)\"" | sudo tee --append "$customFile" > /dev/null;
|
2024-03-07 20:23:55 +00:00
|
|
|
fi;
|
|
|
|
|
|
|
|
popd > /dev/null;
|