From bc06ad3e823e4ce7e62617454598029b1f532b76 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 20 Apr 2021 10:53:24 +0200 Subject: [SSUS] Add function to add all files from a static_files module --- satellit_upgrader/updater.template.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/satellit_upgrader/updater.template.sh b/satellit_upgrader/updater.template.sh index 99641a0..37ccb35 100644 --- a/satellit_upgrader/updater.template.sh +++ b/satellit_upgrader/updater.template.sh @@ -129,6 +129,20 @@ diffcp () { return 0 } +# install_files +# returns 0 (true) if at least one file was copied +install_files () { + local SRC="$FILEDIR/$1" + local files file ret + [ -d "$SRC" ] || perror "NO SUCH DIRECTORY: $SRC" + readarray -t -d '' files < <( find "$SRC" -type f -print0 ) + ret=1 + for file in "${files[@]}"; do + diffcp "$1" "${file#$SRC}" && ret=0 + done + return $ret +} + # failprint apt-get install foobar # Only prints command output to stdout if exit code is not 0 failprint () { -- cgit v1.2.3-55-g7522