[pacman-dev] [PATCH v2] pacman-db-upgrade: fix issue with find argument list length overflow

Allan McRae allan at archlinux.org
Wed Nov 26 02:54:27 UTC 2014


Signed-off-by: Allan McRae <allan at archlinux.org>
---
 scripts/pacman-db-upgrade.sh.in | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/scripts/pacman-db-upgrade.sh.in b/scripts/pacman-db-upgrade.sh.in
index 2fced9b..7bb277b 100644
--- a/scripts/pacman-db-upgrade.sh.in
+++ b/scripts/pacman-db-upgrade.sh.in
@@ -174,7 +174,10 @@ if [[ -z "$db_version" ]]; then
 		dirlist+=("${pacroot}${dir%/}")
 	done < <(grep -h '/$' "$dbroot"/local/*/files | sort -ru)
 
-	mapfile -t dirlist < <(find "${dirlist[@]}" -maxdepth 0 -type l)
+	mapfile -t dirlist < <(
+		for dir in "${dirlist[@]}"; do
+			[[ -L "$dir" ]] && echo "$dir"
+		done)
 
 	if [[ ${#dirlist[@]} != 0 ]]; then
 		msg "$(gettext "Pre-4.2 database format detected - upgrading...")"
-- 
2.1.3


More information about the pacman-dev mailing list