summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2012-04-22 04:32:56 +0200
committerDave Reisner <dreisner@archlinux.org>2012-04-22 05:43:52 +0200
commit710650c0bfdfed3423d0c17bb7955d4dc1151b25 (patch)
tree3742bd47814929029e4de2cf4192ee16186e123b
parentb5cd0b31a03772056137db8246b3696844843713 (diff)
downloadmkinitcpio-710650c0bfdfed3423d0c17bb7955d4dc1151b25.tar.gz
mkinitcpio-710650c0bfdfed3423d0c17bb7955d4dc1151b25.tar.xz
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 <dreisner@archlinux.org>
-rwxr-xr-xmkinitcpio4
1 files 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 ;;