Fix handling ownership of parent directories.

This commit is contained in:
Tom Alexander
2025-08-10 12:54:34 -04:00
parent f1eaaf12b3
commit c947def321
2 changed files with 43 additions and 10 deletions

View File

@@ -64,12 +64,8 @@ let
find ${source} -type f -print0 | while read -r -d "" file; do
relative_path=$(realpath -s --relative-to ${source} "$file")
full_dest=${destination}/"$relative_path"
containing_directory=$(dirname "$full_dest")
if [ ! -e "$containing_directory" ]; then
echo ""
$DRY_RUN_CMD install $VERBOSE_ARG -d ${dir_flags} "$containing_directory"
fi
$DRY_RUN_CMD install $VERBOSE_ARG -D --compare ${flags} "$file" "$full_dest"
create_containing_directories "$full_dest" ${dir_flags}
$DRY_RUN_CMD install $VERBOSE_ARG --compare ${flags} "$file" "$full_dest"
done
''
]
@@ -137,10 +133,7 @@ let
find ${source} -type f -print0 | while read -r -d "" file; do
relative_path=$(realpath -s --relative-to ${source} "$file")
full_dest=${destination}/"$relative_path"
containing_directory=$(dirname "$full_dest")
if [ ! -e "$containing_directory" ]; then
$DRY_RUN_CMD install $VERBOSE_ARG -d ${dir_flags} "$containing_directory"
fi
create_containing_directories "$full_dest" ${dir_flags}
$DRY_RUN_CMD ln $VERBOSE_ARG -s "$file" "$full_dest"
$DRY_RUN_CMD chown $VERBOSE_ARG -h ${owner} "$full_dest"
done
@@ -318,6 +311,7 @@ in
''
set -o pipefail
IFS=$'\n\t'
source ${./files/lib.bash}
''
+ (lib.strings.concatStringsSep "\n" (
[
@@ -329,6 +323,7 @@ in
''
set -o pipefail
IFS=$'\n\t'
source ${./files/lib.bash}
''
+ (lib.strings.concatStringsSep "\n" uninstall_commands);
};