diff options
| -rw-r--r-- | build-helpers.sh | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/build-helpers.sh b/build-helpers.sh index 26de872..20a6a2b 100644 --- a/build-helpers.sh +++ b/build-helpers.sh @@ -553,8 +553,17 @@ verify_remote() { local remote_host="${REMOTE_TARGET%%:*}" local remote_path="${REMOTE_TARGET#*:}" local remote_path_q + local remote_file_script + local remote_link_script + local remote_file_command + local remote_link_command printf -v remote_path_q "%q" "${remote_path%/}" + remote_file_script="cd $remote_path_q && find . -type f -print | LC_ALL=C sort | while IFS= read -r file; do sha256sum \"\$file\"; done" + remote_link_script="cd $remote_path_q && find . -type l -print | LC_ALL=C sort | while IFS= read -r link; do printf \"%s -> %s\\n\" \"\$link\" \"\$(readlink \"\$link\")\"; done" + remote_file_command="'${remote_file_script//\'/\'\\\'\'}'" + remote_link_command="'${remote_link_script//\'/\'\\\'\'}'" + local local_files local remote_files local local_links @@ -571,7 +580,7 @@ verify_remote() { done ) > "$local_files" - if ! ssh "$remote_host" "cd $remote_path_q && find . -type f -print | LC_ALL=C sort | while IFS= read -r file; do sha256sum \"\$file\"; done" > "$remote_files"; then + if ! ssh "$remote_host" "bash -lc $remote_file_command" > "$remote_files"; then echo "❌ ERROR: Remote checksum collection failed" rm -f "$local_files" "$remote_files" "$local_links" "$remote_links" return 1 @@ -590,7 +599,7 @@ verify_remote() { done ) > "$local_links" - if ! ssh "$remote_host" "cd $remote_path_q && find . -type l -print | LC_ALL=C sort | while IFS= read -r link; do printf \"%s -> %s\\n\" \"\$link\" \"\$(readlink \"\$link\")\"; done" > "$remote_links"; then + if ! ssh "$remote_host" "bash -lc $remote_link_command" > "$remote_links"; then echo "❌ ERROR: Remote symlink collection failed" rm -f "$local_files" "$remote_files" "$local_links" "$remote_links" return 1 |
