From dd06efbb8d1475832c3992381b21b60fc9d7ddb6 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 03561390ed..fbea5577fb 100755 --- a/tests/scripts/all.sh +++ b/tests/scripts/all.sh @@ -314,7 +314,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 }