New comment by sgn on void-packages repository https://github.com/void-linux/void-packages/pull/26950#issuecomment-739903041 Comment: I tentative to add this change: ``` diff --git a/common/hooks/pre-pkg/99-pkglint-subpkgs.sh b/common/hooks/pre-pkg/99-pkglint-subpkgs.sh index 53e4e697e2..b932d122b6 100644 --- a/common/hooks/pre-pkg/99-pkglint-subpkgs.sh +++ b/common/hooks/pre-pkg/99-pkglint-subpkgs.sh @@ -32,13 +32,17 @@ hook() { /subpackages/s/.*"//p s/".*//p }' $XBPS_SRCPKGDIR/$pkgname/template | - tr ' ' '\n' | sort)" + tr '\v\t\r\n' ' ')" for s in $subpkgs; do - grep -q "^$s$" <<< "$matches" || - msg_warn "${s}_package() defined but will never be built.\n" + case " $matches " in + *" $s "*) ;; + *) msg_warn "${s}_package() defined but will never be built.\n" ;; + esac done - grep -q "^$pkgname$" <<< "$matches" && - msg_warn "$pkgname is sourcepkg but is in subpackages=.\n" || : + case " $matches " in + *" $pkgname "*) + msg_warn "$pkgname is sourcepkg but is in subpackages=.\n" ;; + esac } ``` On looping over 100 subpkgs, the new code show a reduction from 286ms to 4ms.