From ad40db1a5da6799af9c8ec0ad56d1d5a3359c912 Mon Sep 17 00:00:00 2001 From: Tobias Powalowski Date: Tue, 18 Jun 2024 15:01:18 +0200 Subject: [PATCH] replace find with fd --- usr/lib/archboot/common.sh | 2 +- usr/lib/archboot/container.sh | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/usr/lib/archboot/common.sh b/usr/lib/archboot/common.sh index 398868172..2de74bba7 100644 --- a/usr/lib/archboot/common.sh +++ b/usr/lib/archboot/common.sh @@ -264,7 +264,7 @@ _fix_network() { _create_archboot_db() { echo "Creating archboot repository db..." #shellcheck disable=SC2046 - LANG=C repo-add -q "${1}"/archboot.db.tar.gz $(find "${1}"/ -type f ! -name '*.sig') + LANG=C repo-add -q "${1}"/archboot.db.tar.gz $(fd -t f -E '*.sig' . "${1}"/) } _pacman_parameters() { diff --git a/usr/lib/archboot/container.sh b/usr/lib/archboot/container.sh index 029816523..a8311ce92 100644 --- a/usr/lib/archboot/container.sh +++ b/usr/lib/archboot/container.sh @@ -67,15 +67,15 @@ _clean_container() { rm -r "${1}"/usr/share/{aclocal,applications,audit-rules,awk,common-lisp,emacs,et,fish,gettext,gettext-[0-9]*,glib-[0-9]*,gnupg,gtk-doc,iana-etc,icons,icu,keyutils,libalpm,libgpg-error,makepkg-template,misc,pixmaps,pkgconfig,screen,smartmontools,ss,tabset,vala,xml,man,doc,info,xtables} rm -r "${1}"/usr/lib/{audit,awk,binfmt.d,cmake,dracut,e2fsprogs,environment.d,gawk,getconf,gettext,glib-[0-9]*,gnupg,gssproxy,icu,krb5,ldscripts,libnl,pkgconfig,siconv,tar,xfsprogs,xtables} # locale cleaning - find "${1}"/usr/share/locale/ -mindepth 2 ! -path '*/be/*' ! -path '*/bg/*' \ - ! -path '*/cs/*' ! -path '*/da/*' ! -path '*/de/*' ! -path '*/en/*' \ - ! -path '*/el/*' ! -path '*/es/*' ! -path '*/fi/*' ! -path '*/fr/*' \ - ! -path '*/hu/*' ! -path '*/it/*' ! -path '*/lt/*' ! -path '*/lv/*' \ - ! -path '*/mk/*' ! -path '*/nl/*' ! -path '*/nn/*' ! -path '*/pl/*' \ - ! -path '*/pt/*' ! -path '*/ro/*' ! -path '*/ru/*' ! -path '*/sk/*' \ - ! -path '*/sr/*' ! -path '*/sv/*' ! -path '*/tr/*' ! -path '*/uk/*' \ - -delete &>"${_NO_LOG}" - find "${1}"/usr/share/i18n/charmaps ! -name 'UTF-8.gz' -delete &>"${_NO_LOG}" + fd -u --min-depth 2 -E '*/be/*' -E '*/bg/*' \ + -E '*/cs/*' -E '*/da/*' -E '*/de/*' -E '*/en/*' \ + -E '*/el/*' -E '*/es/*' -E '*/fi/*' -E '*/fr/*' \ + -E '*/hu/*' -E '*/it/*' -E '*/lt/*' -E '*/lv/*' \ + -E '*/mk/*' -E '*/nl/*' -E '*/nn/*' -E '*/pl/*' \ + -E '*/pt/*' -E '*/ro/*' -E '*/ru/*' -E '*/sk/*' \ + -E '*/sr/*' -E '*/sv/*' -E '*/tr/*' -E '*/uk/*' \ + . "${1}"/usr/share/locale/ -X rm &>"${_NO_LOG}" + fd -u -t f -E 'UTF-8.gz' . "${1}"/usr/share/i18n/charmaps -X rm &>"${_NO_LOG}" fi }