From 0ec84aec6a475327f02569a189c31d007eb95ffe Mon Sep 17 00:00:00 2001 From: Tobias Powalowski Date: Fri, 28 Jun 2024 14:50:32 +0200 Subject: [PATCH] replace grep with rg and sed with sd --- usr/lib/archboot/installer/autoconfiguration.sh | 6 +++--- usr/lib/archboot/installer/common.sh | 4 +--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/usr/lib/archboot/installer/autoconfiguration.sh b/usr/lib/archboot/installer/autoconfiguration.sh index e3769a159..9261d7db7 100644 --- a/usr/lib/archboot/installer/autoconfiguration.sh +++ b/usr/lib/archboot/installer/autoconfiguration.sh @@ -113,12 +113,12 @@ _auto_pacman_keyring() _progress "47" "Enable pacman's GPG keyring files on installed system..." cp -ar /etc/pacman.d/gnupg "${_DESTDIR}"/etc/pacman.d &>"${_NO_LOG}" read -r -t 2 - fi +# fi } _auto_testing() { - if rg -q "^\[core-testing" /etc/pacman.conf; then + if rg -q '^\[core-testing' /etc/pacman.conf; then _progress "53" "Enable [testing] repository on installed system..." sd '^#(\[[c,e].*-testing\]\n)#' '$1' "${_DESTDIR}"/etc/pacman.conf read -r -t 2 @@ -130,7 +130,7 @@ _auto_pacman_mirror() { # add installer-selected mirror to the top of the mirrorlist if rg -q '^Server' /etc/pacman.d/mirrorlist; then _progress "62" "Enable pacman mirror on installed system..." - _SYNC_URL=$(rg '^Server.* (.*)' -r '$1') + _SYNC_URL=$(rg '^Server.* (.*)' -r '$1' /etc/pacman.d/mirrorlist) #shellcheck disable=SC2027,SC2086 cat << EOF > /tmp/inst-mirrorlist # Mirror used during installation diff --git a/usr/lib/archboot/installer/common.sh b/usr/lib/archboot/installer/common.sh index 64d1b342d..642765dbf 100644 --- a/usr/lib/archboot/installer/common.sh +++ b/usr/lib/archboot/installer/common.sh @@ -78,9 +78,7 @@ _chroot_mount() _chroot_umount() { if rg -qw '^archboot' /etc/hostname; then - umount -R "${_DESTDIR}/proc" - umount -R "${_DESTDIR}/sys" - umount -R "${_DESTDIR}/dev" + umount -R "${_DESTDIR}"/{proc,sys,dev} fi }