From 9d20b60fafb364d369c1633315c6e75639d86dba Mon Sep 17 00:00:00 2001 From: "Kyle J. McKay" Date: Tue, 7 Jul 2020 13:31:42 -0700 Subject: [PATCH] shlib.sh: improve speed of get_repo_list Replace slow shell loop with awk as it can filter the project list far, far, far faster. Signed-off-by: Kyle J. McKay --- shlib.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/shlib.sh b/shlib.sh index 80a2e00..3399670 100644 --- a/shlib.sh +++ b/shlib.sh @@ -658,9 +658,8 @@ get_repo_list() { LC_ALL=C cut -d : -f 1,3 "$cfg_chroot"/etc/group | LC_ALL=C grep "^$1" else LC_ALL=C cut -d : -f 1,3 "$cfg_chroot"/etc/group - fi | while IFS=: read name id; do - [ $id -lt 65536 ] || case "$name" in _*) :;; ?*) echo "$name"; esac - done + fi | + LC_ALL=C awk -F : 'substr($1,1,1) != "_" && $2 >= 65536 {print $1}' } # set the variable named by the first argument to the project part (i.e. WITH -- 2.11.4.GIT