From 40a5a15fce533523ea63f7d49356e7958148e56d Mon Sep 17 00:00:00 2001 From: natemaia Date: Mon, 26 Dec 2022 15:13:38 -0800 Subject: [PATCH] Fix: issue with removing LVM partitions containing a slash --- installer | 40 ++++++++++++++++++---------------------- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/installer b/installer index b53322f..dc5384a 100755 --- a/installer +++ b/installer @@ -1120,6 +1120,7 @@ part_pretty() # find the root device: /dev/sda1 -> /dev/sda, /dev/nvme0n1p12 -> /dev/nvme0n1 drive="$(sed 's/p\?[1-9][0-9]*$//' <<< "$dev")" model=$(lsblk -lno MODEL "$drive" | awk '{gsub(/ |\t/, "_"); print}') + model=$(sed 's/^\s*//; s/\s*$//' <<< "$model") [[ $size_t == 'K' || ($size_t == 'M' && ${isize%.*} -lt 80) ]] || printf "%s\n" "$dev ${size}__$model" done < <(lsblk -lno TYPE,PATH,SIZE,FSTYPE,LABEL $part | awk "/$regexp/"' && !'"/${IGNORE_DEV:-NONEXX}/"' { @@ -1237,7 +1238,7 @@ part_countdec() { # loop all passed partitions and remove them from the list, decrementing the counter for p; do if (( PART_COUNT )); then - PARTS="$(sed "/${p##/dev/} /d" <<< "$PARTS")" # sed //d doesn't like slashes so strip the /dev/ + PARTS="$(sed "/${p##*/} /d" <<< "$PARTS")" # sed //d doesn't like slashes so strip the everything to the last slash (( PART_COUNT-- )) fi done @@ -1603,9 +1604,6 @@ install_main() errshow 0 "chrun '$USERCMD'" fi - # reset the signature check in pacman.conf - # tr '\n' '\a' < "$MNT/etc/pacman.conf" | sed 's/\(\[archlabs]\).*SigLevel = Optional TrustAll/\1/' | tr '\a' '\n' - while :; do dlg choice menu "Finalization" "$_edit" \ finished "exit the installer and reboot" \ @@ -3209,29 +3207,25 @@ al_repo() { local conf="$1" - # disable the signature check for AL repo in pacman.conf - # [[ $(tr '\n' '\a' < "$conf" | grep -o '\[archlabs].*SigLevel = Optional TrustAll' | tr '\a' '\n') ]] && return 0 - # SigLevel = Optional TrustAll - - grep -q '\[archlabs]' "$conf" 2> /dev/null && return 0 - if ! grep -q 'ILoveCandy' "$conf" 2> /dev/null; then sed -i 's/^#Color/Color/' "$conf" sed -i '/^Color/a ILoveCandy' "$conf" fi - cat >> "$conf" <<- EOF + if ! grep -q '\[archlabs]' "$conf" 2> /dev/null; then + cat >> "$conf" <<- EOF - # [archlabs-testing] - # Server = https://github.com/ArchLabs/\$repo/raw/master/\$arch - # Server = https://bitbucket.org/archlabslinux/\$repo/raw/master/\$arch + # [archlabs-testing] + # Server = https://github.com/ArchLabs/\$repo/raw/master/\$arch + # Server = https://bitbucket.org/archlabslinux/\$repo/raw/master/\$arch - [archlabs] - Server = https://bitbucket.org/archlabslinux/\$repo/raw/master/\$arch - Server = https://github.com/ArchLabs/\$repo/raw/master/\$arch - Server = https://sourceforge.net/projects/archlabs-repo/files/\$repo/\$arch + [archlabs] + Server = https://bitbucket.org/archlabslinux/\$repo/raw/master/\$arch + Server = https://github.com/ArchLabs/\$repo/raw/master/\$arch + Server = https://sourceforge.net/projects/archlabs-repo/files/\$repo/\$arch - EOF + EOF + fi return 1 } @@ -3593,7 +3587,7 @@ if [[ -z $NOFONT ]]; then if [[ $TERM == 'linux' ]]; then if [[ -f /tmp/font ]]; then FONT="$(< /tmp/font)" - : "${FONT=ter-i16n}" + : "${FONT=ter-i16n}" # if FONT is empty we reset the default 16 setfont "$FONT" else fontsize=16 @@ -3629,7 +3623,7 @@ mirrorpid='' if [[ ! -f /tmp/new ]]; then msg "Update" "\nChecking for installer updates.\n" 0 ( reflector --list-countries 2>/dev/null | sed '1,2d' | awk 'NF{NF--}; {print}' > /tmp/mcountry ) & - mirrorpid=$! + echo $! > /tmp/mirrorpid if curl -fsSL 'https://bitbucket.org/archlabslinux/installer/raw/master/installer' -o /tmp/new; then if (( $(vercmp "$(awk -F= '/^VER=/ {print $2}' /tmp/new)" "$VER") > 0 )); then cp /tmp/new /usr/local/bin/installer @@ -3637,9 +3631,11 @@ if [[ ! -f /tmp/new ]]; then exec /usr/local/bin/installer "$@" fi fi +elif [[ -f /tmp/mirrorpid ]]; then + mirrorpid=$(< /tmp/mirrorpid) + rm /tmp/mirrorpid fi - # warn before starting the background process if [[ $NOMOUNT ]]; then wrn="\nA background install process will begin early when using -n flag\n\nSome files may be overwritten during the process\n"