From 4dc56c649314dd97abca10308e1ab06f7997c542 Mon Sep 17 00:00:00 2001 From: JaKooLit Date: Mon, 1 Jan 2024 22:33:09 +0900 Subject: [PATCH] Migration to better install completed --- CHANGELOGS.md | 4 ++++ install-scripts/00-base.sh | 36 ++++++++++++++++++++++++++++++++++++ install-scripts/paru.sh | 2 +- install-scripts/yay.sh | 2 +- 4 files changed, 42 insertions(+), 2 deletions(-) diff --git a/CHANGELOGS.md b/CHANGELOGS.md index 8a5654a..1352352 100644 --- a/CHANGELOGS.md +++ b/CHANGELOGS.md @@ -1,5 +1,9 @@ ## Changelogs +## 01 Jan 2024 +- Re-coded complete and test +- Added to spice up pacman.conf including adding of ILoveCandy on it :) + ## 30 Dec 2023 - Install scripts reconstructed diff --git a/install-scripts/00-base.sh b/install-scripts/00-base.sh index 21cf82f..ee80779 100755 --- a/install-scripts/00-base.sh +++ b/install-scripts/00-base.sh @@ -27,4 +27,40 @@ for PKG1 in "${base[@]}"; do install_package_pacman "$PKG1" | tee -a "$LOG" done + + +echo -e "${NOTE} Adding Extra Spice in pacman.conf ... ${RESET}" 2>&1 | tee -a "$LOG" +pacman_conf="/etc/pacman.conf" + +# Remove comments '#' from specific lines +lines_to_edit=( + "color" + "CheckSpace" + "VerbosePkgLists" + "ParallelDownloads" +) + +# Uncomment specified lines if they are commented out +for line in "${lines_to_edit[@]}"; do + if grep -q "^#$line" "$pacman_conf"; then + sudo sed -i "s/^#$line/$line/" "$pacman_conf" + echo -e "${CAT} Uncommented: $line ${RESET}" 2>&1 | tee -a "$LOG" + else + echo -e "${CAT} $line is already uncommented. ${RESET}" 2>&1 | tee -a "$LOG" + fi +done + +# Add "ILoveCandy" below ParallelDownloads if it doesn't exist +if grep -q "^#ParallelDownloads" "$pacman_conf" && ! grep -q "^ILoveCandy" "$pacman_conf"; then + sudo sed -i "/^#ParallelDownloads/a ILoveCandy" "$pacman_conf" + echo -e "${CAT} Added ILoveCandy below ParallelDownloads. ${RESET}" 2>&1 | tee -a "$LOG" +else + echo -e "${CAT} ILoveCandy already exists ${RESET}" 2>&1 | tee -a "$LOG" +fi + +echo -e "${CAT} Pacman.conf spicing up completed ${RESET}" 2>&1 | tee -a "$LOG" + +# updating pacman.conf +sudo pacman -Sy + clear \ No newline at end of file diff --git a/install-scripts/paru.sh b/install-scripts/paru.sh index 46bcd0f..c9770dc 100755 --- a/install-scripts/paru.sh +++ b/install-scripts/paru.sh @@ -41,7 +41,7 @@ else makepkg -si --noconfirm 2>&1 | tee -a "$LOG" || { printf "%s - Failed to install paru from AUR\n" "${ERROR}"; exit 1; } # moving install logs in to Install-Logs folder - mv $LOG ../Install-Logs/ || true + mv install*.log ../Install-Logs/ || true cd .. fi diff --git a/install-scripts/yay.sh b/install-scripts/yay.sh index 446fa9e..6c0c550 100755 --- a/install-scripts/yay.sh +++ b/install-scripts/yay.sh @@ -40,7 +40,7 @@ else makepkg -si --noconfirm 2>&1 | tee -a "$LOG" || { printf "%s - Failed to install yay from AUR\n" "${ERROR}"; exit 1; } # moving install logs in to Install-Logs folder - mv $LOG ../Install-Logs/ || true + mv install*.log ../Install-Logs/ || true cd .. fi