summaryrefslogtreecommitdiffstats
path: root/functions
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2012-05-30 14:46:12 +0200
committerDave Reisner <dreisner@archlinux.org>2012-05-30 20:06:23 +0200
commit96e616f06785f4c885ee9c2532a043e620ab07ba (patch)
tree98382aa055c78d49a2b76720fad71ffa444ec330 /functions
parent61ae4752dc2de0c3cca201701b92908b1dd18dee (diff)
downloadmkinitcpio-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--functions7
1 files changed, 5 insertions, 2 deletions
diff --git a/functions b/functions
index ed6d78d..b37ac87 100644
--- a/functions
+++ b/functions
@@ -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