From de5a6aa728b4b89583736ac3fc5445f40d0b694e Mon Sep 17 00:00:00 2001 From: Vladislav Nepogodin Date: Sun, 8 May 2022 01:41:46 +0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=20cleanup=20&=20use=20every=20pack?= =?UTF-8?q?age=20installed=20to=20perform=20query?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- archiso/airootfs/usr/local/bin/removeun | 12 ++++-------- archiso/airootfs/usr/local/bin/removeun-online | 4 ++-- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/archiso/airootfs/usr/local/bin/removeun b/archiso/airootfs/usr/local/bin/removeun index c704117..be83d9e 100755 --- a/archiso/airootfs/usr/local/bin/removeun +++ b/archiso/airootfs/usr/local/bin/removeun @@ -15,8 +15,7 @@ # ############################################################################### -_clean_packages(){ - +_clean_packages() { local _packages_to_remove=( gparted grsync @@ -43,18 +42,15 @@ _clean_packages(){ local xx # @ does one by one to avoid errors in the entire process # * can be used to treat all packages in one command - for xx in ${_packages_to_remove[@]}; do pacman -Rsc "$xx" --noconfirm; done - + for xx in "${_packages_to_remove[@]}"; do pacman -Rsc "$xx" --noconfirm; done } -_try_v3(){ - /lib/ld-linux-x86-64.so.2 --help | grep "x86-64-v3 (supported, searched)" > /dev/null - +_try_v3() { local pacman_conf="/etc/pacman.conf" local pacman_conf_cachyos="/etc/pacman-more.conf" local pacman_conf_path_backup="/etc/pacman.conf.bak" - if [ $? -eq 0 ]; then + if /lib/ld-linux-x86-64.so.2 --help | grep "x86-64-v3 (supported, searched)" > /dev/null; then echo "x86-64-v3 is supported" sed -i 's/Architecture = auto/#Architecture = auto/' $pacman_conf_cachyos diff --git a/archiso/airootfs/usr/local/bin/removeun-online b/archiso/airootfs/usr/local/bin/removeun-online index b8ed6d3..aa7bc7b 100755 --- a/archiso/airootfs/usr/local/bin/removeun-online +++ b/archiso/airootfs/usr/local/bin/removeun-online @@ -2,11 +2,11 @@ _clean_packages(){ local _leave_these_packages="base\nbase-devel\ncachyos-keyring\ncachyos-mirrorlist\ncachyos-v3-mirrorlist\ncachyos-hello\ngrub\nefibootmgr\n" - local _packages_to_remove=($(comm -23 <(pacman -Qqt | sort) <({ pacman -Qqg base-devel; printf $_leave_these_packages; } | sort -u))) + local _packages_to_remove=("$(comm -23 <(pacman -Qq | sort) <({ pacman -Qqg base-devel; printf "%s" $_leave_these_packages; } | sort -u))") local xx # @ does one by one to avoid errors in the entire process # * can be used to treat all packages in one command - for xx in ${_packages_to_remove[@]}; do pacman -Rsc "$xx" --noconfirm; done + for xx in "${_packages_to_remove[@]}"; do pacman -Rsc "$xx" --noconfirm; done rm /etc/sddm.conf || true }