From 00fdd8cd0762ab8420e6fd63a7638c88521d39cc Mon Sep 17 00:00:00 2001 From: Diego Pertierra Date: Sun, 14 Jul 2024 01:15:20 +0200 Subject: [PATCH 1/2] default dtype to arch when it is unknown for rate-mirrors --- src/commands/system-update.sh | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/commands/system-update.sh b/src/commands/system-update.sh index d7cfec82..b3b2c6ff 100755 --- a/src/commands/system-update.sh +++ b/src/commands/system-update.sh @@ -48,11 +48,11 @@ checkEnv() { DTYPE="unknown" # Default to unknown - # Use /etc/os-release for modern distro identification - if [ -f /etc/os-release ]; then - source /etc/os-release - DTYPE=$ID - fi + # Use /etc/os-release for modern distro identification + if [ -f /etc/os-release ]; then + source /etc/os-release + DTYPE=$ID + fi } @@ -77,7 +77,13 @@ fastUpdate() { fi ${AUR_HELPER} --noconfirm -S rate-mirrors-bin sudo cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.bak - sudo rate-mirrors --top-mirrors-number-to-retest=5 --disable-comments --save /etc/pacman.d/mirrorlist --allow-root ${DTYPE} + + # If for some reason DTYPE is still unknown use always arch so the rate-mirrors does not fail + local dtype_local=${DTYPE} + if $DTYPE == "unknown"; then + dtype_local="arch" + fi + sudo rate-mirrors --top-mirrors-number-to-retest=5 --disable-comments --save /etc/pacman.d/mirrorlist --allow-root ${dtype_local} ;; apt-get|nala) sudo apt-get update @@ -129,4 +135,4 @@ updateSystem() { checkEnv fastUpdate -updateSystem \ No newline at end of file +updateSystem From f0bdcafefa45274f4426b8b6ce0c91a8182f512e Mon Sep 17 00:00:00 2001 From: Diego Pertierra Date: Sun, 14 Jul 2024 01:18:53 +0200 Subject: [PATCH 2/2] Update system-update.sh fixed issue in if statement --- src/commands/system-update.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/system-update.sh b/src/commands/system-update.sh index b3b2c6ff..356cd421 100755 --- a/src/commands/system-update.sh +++ b/src/commands/system-update.sh @@ -80,7 +80,7 @@ fastUpdate() { # If for some reason DTYPE is still unknown use always arch so the rate-mirrors does not fail local dtype_local=${DTYPE} - if $DTYPE == "unknown"; then + if [ ${DTYPE} == "unknown" ]; then dtype_local="arch" fi sudo rate-mirrors --top-mirrors-number-to-retest=5 --disable-comments --save /etc/pacman.d/mirrorlist --allow-root ${dtype_local}