replace more grep with rg

This commit is contained in:
Tobias Powalowski 2024-07-29 09:19:37 +02:00
parent 3fb5a52c5e
commit 4837c6a021
11 changed files with 12 additions and 12 deletions

View file

@ -4,7 +4,7 @@
_run () _run ()
{ {
! grep -qw 'archboot' /etc/hostname && return ! rg -qw 'archboot' /etc/hostname && return
_install_files _install_files
rm /usr/bin/{3cpio,blkid,gzip,journalctl,less,lsmod,mkfs.btrfs,\ rm /usr/bin/{3cpio,blkid,gzip,journalctl,less,lsmod,mkfs.btrfs,\
mountpoint,setfont,sulogin,systemctl} mountpoint,setfont,sulogin,systemctl}

View file

@ -15,7 +15,7 @@ usr/lib/{coreutils,cryptsetup,gconv,modules-load.d,p11-kit,pam.d,pkcs11,polkit-1
usr/share/{bash-completion,dbus-1,factory,hwdata,i18n/locales,makepkg,nano,pacman/keyrings,polkit-1,readline,systemd,terminfo} \ usr/share/{bash-completion,dbus-1,factory,hwdata,i18n/locales,makepkg,nano,pacman/keyrings,polkit-1,readline,systemd,terminfo} \
| tar -C "${_ROOTFS}" -xpf - | tar -C "${_ROOTFS}" -xpf -
# only run on archboot container # only run on archboot container
if grep -qw 'archboot' /etc/hostname; then if rg -qw 'archboot' /etc/hostname; then
_map _binary locale{-gen,def} _map _binary locale{-gen,def}
_map _file /etc/locale.gen /usr/share/locale/locale.alias _map _file /etc/locale.gen /usr/share/locale/locale.alias
# only support UTF-8 # only support UTF-8

View file

@ -4,7 +4,7 @@
_run () _run ()
{ {
! grep -qw 'archboot' /etc/hostname && return ! rg -qw 'archboot' /etc/hostname && return
# remove pacman-init.service # remove pacman-init.service
rm -f /tmp/etc/systemd/system/multi-user.target.wants/pacman-init.service rm -f /tmp/etc/systemd/system/multi-user.target.wants/pacman-init.service
rm -f /tmp/etc/systemd/system/pacman-init.service rm -f /tmp/etc/systemd/system/pacman-init.service

View file

@ -16,7 +16,7 @@ _run ()
# only take services from systemd package # only take services from systemd package
pacman -Sy &>"${_NO_LOG}" pacman -Sy &>"${_NO_LOG}"
#shellcheck disable=SC2046 #shellcheck disable=SC2046
_map _file $(pacman -Ql systemd | grep '/usr/lib/systemd/system/.' | choose 1) _map _file $(pacman -Ql systemd | rg '/usr/lib/systemd/system/.' | choose 1)
_map _file /usr/lib/sysusers.d/{arch,basic}.conf _map _file /usr/lib/sysusers.d/{arch,basic}.conf
# disable systemd services: # disable systemd services:
for i in lvm2-{lvmpolld,monitor} systemd-{boot,random-seed,sysusers\ for i in lvm2-{lvmpolld,monitor} systemd-{boot,random-seed,sysusers\

View file

@ -4,7 +4,7 @@
_run () _run ()
{ {
! grep -qw 'archboot' /etc/hostname && return ! rg -qw 'archboot' /etc/hostname && return
_install_files _install_files
rm /usr/bin/{\[,addpart,attr,b2sum,base{32,64},basenc,blk{discard,pr,zone},blockdev,bunzip2,\ rm /usr/bin/{\[,addpart,attr,b2sum,base{32,64},basenc,blk{discard,pr,zone},blockdev,bunzip2,\
bz{cat,diff,grep,ip2,ip2recover,more},cal,capsh,ch{acl,con,cpu,grp,mem,oom,own,root,rt},\ bz{cat,diff,grep,ip2,ip2recover,more},cal,capsh,ch{acl,con,cpu,grp,mem,oom,own,root,rt},\

View file

@ -4,7 +4,7 @@
_run () _run ()
{ {
! grep -qw 'archboot' /etc/hostname && return ! rg -qw 'archboot' /etc/hostname && return
[[ -d /var/cache/pacman/pkg ]] && rm -r /var/cache/pacman/pkg [[ -d /var/cache/pacman/pkg ]] && rm -r /var/cache/pacman/pkg
} }

View file

@ -4,7 +4,7 @@
_run () _run ()
{ {
! grep -qw 'archboot' /etc/hostname && return ! rg -qw 'archboot' /etc/hostname && return
_install_files _install_files
rm /usr/bin/{badblocks,blkmapd,btrfs-{find-root,image,map-logical,select-super},btrfs{,ck,tune},\ rm /usr/bin/{badblocks,blkmapd,btrfs-{find-root,image,map-logical,select-super},btrfs{,ck,tune},\
chattr,cifscreds,cifs.{idmap,upcall},compile_et,debugfs,\ chattr,cifscreds,cifs.{idmap,upcall},compile_et,debugfs,\

View file

@ -4,7 +4,7 @@
_run () _run ()
{ {
! grep -qw 'archboot' /etc/hostname && return ! rg -qw 'archboot' /etc/hostname && return
rm -r /lib/firmware rm -r /lib/firmware
} }

View file

@ -4,7 +4,7 @@
_run () _run ()
{ {
! grep -qw 'archboot' /etc/hostname && return ! rg -qw 'archboot' /etc/hostname && return
_install_mods _install_mods
rm -r /lib/modules rm -r /lib/modules
_MODS="" _MOD_DEPS="" _MODS="" _MOD_DEPS=""

View file

@ -18,12 +18,12 @@ _run ()
echo -e "|-----------|---------|--------|----------|---------|" >> "${_MOTD}" echo -e "|-----------|---------|--------|----------|---------|" >> "${_MOTD}"
echo -e "| \e[1;92mALT+F1-F4\e[m | \e[1;92mALT+F5\e[m | \e[1;92mALT+F6\e[m | \e[1;92mALT+F11\e[m | \e[1;92mALT+F12\e[m |" >> "${_MOTD}" echo -e "| \e[1;92mALT+F1-F4\e[m | \e[1;92mALT+F5\e[m | \e[1;92mALT+F6\e[m | \e[1;92mALT+F11\e[m | \e[1;92mALT+F12\e[m |" >> "${_MOTD}"
echo -e "-----------------------------------------------------" >> "${_MOTD}" echo -e "-----------------------------------------------------" >> "${_MOTD}"
if echo "${_HOOKS[@]}" | grep -qw net; then if echo "${_HOOKS[@]}" | rg -qw net; then
#shellcheck disable=SC2129 #shellcheck disable=SC2129
echo -e "\e[1mFor Additional Wi-Fi Authentification Or Online Help:\e[m" >> "${_MOTD}" echo -e "\e[1mFor Additional Wi-Fi Authentification Or Online Help:\e[m" >> "${_MOTD}"
echo -e " - Use the \e[1;92m'elinks'\e[m text mode browser." >> "${_MOTD}" echo -e " - Use the \e[1;92m'elinks'\e[m text mode browser." >> "${_MOTD}"
fi fi
if echo "${_HOOKS[@]}" | grep -qw installer; then if echo "${_HOOKS[@]}" | rg -qw installer; then
#shellcheck disable=SC2129 #shellcheck disable=SC2129
echo -e "\e[1mManage Archboot Environment:\e[m" >> "${_MOTD}" echo -e "\e[1mManage Archboot Environment:\e[m" >> "${_MOTD}"
echo -e " - Use the \e[1;92m'launcher'\e[m or the expert \e[1;92m'update'\e[m script." >> "${_MOTD}" echo -e " - Use the \e[1;92m'launcher'\e[m or the expert \e[1;92m'update'\e[m script." >> "${_MOTD}"

View file

@ -4,7 +4,7 @@
_run () _run ()
{ {
! grep -qw 'archboot' /etc/hostname && return ! rg -qw 'archboot' /etc/hostname && return
_install_files _install_files
rm /usr/bin/{arpd,arping,bridge,clockdiff,ctstat,dcb,devlink,\ rm /usr/bin/{arpd,arping,bridge,clockdiff,ctstat,dcb,devlink,\
elinks,ethtool,genl,ifstat,lnstat,nstat,ssh,tracepath,rdma,rtacct,\ elinks,ethtool,genl,ifstat,lnstat,nstat,ssh,tracepath,rdma,rtacct,\