From 710650c0bfdfed3423d0c17bb7955d4dc1151b25 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Sat, 21 Apr 2012 22:32:56 -0400 Subject: mkinitcpio: check return of cd before listing hooks $ mkinitcpio -L ==> Available hooks /usr/bin/mkinitcpio: line 173: cd: /lib/initcpio/install: No such file or directory sort and dedupe as well, since we deal with a hierarchy which may (for some horrible reason) contain duplicates. Signed-off-by: Dave Reisner --- mkinitcpio | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mkinitcpio b/mkinitcpio index 1281c0b..fb1db85 100755 --- a/mkinitcpio +++ b/mkinitcpio @@ -173,8 +173,8 @@ while :; do -L|--listhooks) msg "Available hooks" for dir in "${INSTDIR[@]}"; do - ( cd "$dir" >/dev/null; printf ' %s\n' * ) - done | column -c$(tput cols) + ( cd "$dir" &>/dev/null && printf ' %s\n' * ) + done | sort -u | column -c$(tput cols) exit 0 ;; -M|--automods) SHOW_AUTOMODS=1 ;; -- cgit v1.2.3-24-g4f1b