Files
snigdhaos-system-installation/usr/local/bin/snigdhaos-all-cores
2024-08-01 04:01:41 +05:30

28 lines
829 B
Bash
Executable File

#!/bin/bash
set -e
# Author : Eshan Roy <eshan@snigdhaos.or>
# Author URL : https://eshanized.github.io/
echo
echo "Starting Execution..."
echo
numberofcores=$(nproc)
if (( numberofcores > 1 )); then
echo "TOTAL CORES : $numberofcores"
echo "Changing makeflags for $numberofcores cores."
sudo sed -i "/^MAKEFLAGS=/c\MAKEFLAGS=\"-j$((numberofcores+1))\"" /etc/makepkg.conf
echo "Changing Compression..."
sudo sed -i 's/COMPRESSXZ=(xz -c -z -)/COMPRESSXZ=(xz -c -z --threads=0 -)/g' /etc/makepkg.conf
sudo sed -i 's/COMPRESSZST=(zstd -c -z -)/COMPRESSZST=(zstd -c -z --threads=0 -)/g' /etc/makepkg.conf
echo "Changing Default PKGEXT"
sudo sed -i 's/PKGEXT=.pkg.tar.xz/PKGEXT=.pkg.tar.zst/g' /etc/makepkg.conf
else
echo "Nothing Changed!"
fi
echo
echo "End Execution!"
echo