diff options
author | Dave Reisner <dreisner@archlinux.org> | 2011-08-07 22:39:09 +0200 |
---|---|---|
committer | Dave Reisner <dreisner@archlinux.org> | 2011-10-01 05:31:39 +0200 |
commit | e17f8d09ad9ef5f640d5397942221ed3ef290cdb (patch) | |
tree | d84f13efc2777ce47a736e088b495809b7c61f6c | |
parent | 0495018de76d5f18a14b3adf6522ff0421aa5d35 (diff) | |
download | mkinitcpio-e17f8d09ad9ef5f640d5397942221ed3ef290cdb.tar.gz mkinitcpio-e17f8d09ad9ef5f640d5397942221ed3ef290cdb.tar.xz |
lsinitcpio: follow symlinks only when necessary
If the image we're pointing to is a symlink, show the resolution as part
of the name in -a's output.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
-rwxr-xr-x | lsinitcpio | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -86,7 +86,7 @@ readonly NC BOLD BLUE GREEN RED YELLOW [[ -f $image ]] || die "$image: No such file" # read compression type -case "$(file -b "$image")" in +case "$(file -Lb "$image")" in @(data|LZMA)*) compress=lzma ;; gzip*) compress=gzip ;; bzip2*) compress=bzip2 ;; @@ -129,7 +129,9 @@ if (( analyze )); then done # print results - msg 'Image: %s' "$(readlink -e "$image")" + imagename=$image + [[ -L $image ]] && imagename+=" -> $(readlink -e "$image")" + msg 'Image: %s' "$imagename" msg 'Kernel: %s' "${kernver:-unknown}" if [[ $compress ]]; then |