From 423dd13357b38a8cd2947fd52cf3918cc550f951 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Tue, 30 Aug 2022 21:02:00 +0200 Subject: [PATCH] Don't try restoring a file if no backup is available This caused `all.sh --force` to fail on a clean build tree. Signed-off-by: Gilles Peskine --- tests/scripts/all.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/scripts/all.sh b/tests/scripts/all.sh index 4705fe88a..f38657d6c 100755 --- a/tests/scripts/all.sh +++ b/tests/scripts/all.sh @@ -303,7 +303,9 @@ cleanup() # Restore files that may have been clobbered by the job for x in $files_to_back_up; do - cp -p "$x$backup_suffix" "$x" + if [[ -e "$x$backup_suffix" ]]; then + cp -p "$x$backup_suffix" "$x" + fi done }