This commit is contained in:
2026-05-07 21:35:53 +02:00
parent 9ad5127393
commit b2e7eaf3af
6 changed files with 65 additions and 19 deletions
+34 -2
View File
@@ -68,9 +68,41 @@ remove_packages() {
##########################
# 1. Add repositories if missing and update system
##########################
# Helper function to check and add a repository
add_repo_if_missing() {
local repo_name="$1"
local repo_config="$2"
if grep -q "\[$repo_name\]" /etc/pacman.conf; then
say_yellow "Repository [$repo_name] already exists. Skipping."
else
say_yellow "Adding [$repo_name] to /etc/pacman.conf..."
# Add a newline and the repo config to the end of the file
echo -e "\n$repo_config" | sudo tee -a /etc/pacman.conf > /dev/null
fi
}
say_yellow "Checking pacman.conf and sources..."
sudo cp /etc/pacman.conf /etc/pacman.conf.bak.$(date +%s)
sudo cp -v "$installed_dir/config-files/pacman.conf" /etc/pacman.conf
# 1. Create the backup
sudo cp /etc/pacman.conf "/etc/pacman.conf.bak.$(date +%s)"
# 2. Add yuku_repo
YUKU_BLOCK="[yuku_repo]
SigLevel = Never
Server = https://yurikuit.github.io/\$repo/\$arch"
add_repo_if_missing "yuku_repo" "$YUKU_BLOCK"
# 3. Add nemesis_repo
NEMESIS_BLOCK="[nemesis_repo]
SigLevel = Never
Server = https://erikdubois.github.io/\$repo/\$arch"
add_repo_if_missing "nemesis_repo" "$NEMESIS_BLOCK"
# 4. Refresh databases
sudo pacman -Sy
# Update the system
say_gray "Updating the system - sudo pacman -Syyu"