diff options
author | Dave Reisner <dreisner@archlinux.org> | 2012-05-30 14:46:12 +0200 |
---|---|---|
committer | Dave Reisner <dreisner@archlinux.org> | 2012-05-30 20:06:23 +0200 |
commit | 96e616f06785f4c885ee9c2532a043e620ab07ba (patch) | |
tree | 98382aa055c78d49a2b76720fad71ffa444ec330 /functions | |
parent | 61ae4752dc2de0c3cca201701b92908b1dd18dee (diff) | |
download | mkinitcpio-96e616f06785f4c885ee9c2532a043e620ab07ba.tar.gz mkinitcpio-96e616f06785f4c885ee9c2532a043e620ab07ba.tar.xz |
add_full_dir: properly handle symlinks and empty dirs
Note that we're intentionally very liberal about what we accept for
symlinks, and don't actually care if the target exists.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Diffstat (limited to 'functions')
-rw-r--r-- | functions | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -346,9 +346,12 @@ add_full_dir() { if [[ -n $1 && -d $1 ]]; then for f in "$1"/*; do - if [[ -d "$f" ]]; then + if [[ -L $f ]]; then + add_symlink "$f" "$(readlink "$f")" + elif [[ -d $f ]]; then + add_dir "$f" add_full_dir "$f" - else + elif [[ -f $f ]]; then add_file "$f" fi done |