add_file symlink ignores mode argument and wrong destination
The recent change to add_file
ignores an explicitly set mode: 38a62e22
Additionally, the symlink is not created correctly (at least in my case), I think the correct way would be:
diff --git a/functions b/functions
--- a/functions
+++ b/functions
@@ -641,7 +641,7 @@ add_file() {
if [[ -L "$src" ]]; then
# add the file
srcrealpath="$(realpath -- "$src")"
- mode="$(stat -c %a -- "$srcrealpath")"
+ mode=${3:-$(stat -c %a -- "$srcrealpath")}
add_file "$srcrealpath" "$srcrealpath" "$mode"
[[ -d "${BUILDROOT}${dest%/*}" ]] || install -d -- "${BUILDROOT}${dest%/*}"
if [[ "$src" == "$dest" ]]; then
@@ -649,7 +649,7 @@ add_file() {
cp -adT -- "$src" "${BUILDROOT}${src}"
else
# create the symlink
- add_symlink "$src" "$dest"
+ add_symlink "$dest" "$srcrealpath"
fi
else
command install -Dm$mode "$src" "$BUILDROOT$dest"