From c45bf9c48100cb6ceb273fc474af52aa1f20721f Mon Sep 17 00:00:00 2001 From: Mattia Rizzolo Date: Mon, 6 Nov 2017 14:42:19 +0100 Subject: udd-query: remove the temporary file with a trap in case this script is called with the wrong argument, and in case of failures, etc, the temporary file would be left around otherwise Signed-off-by: Mattia Rizzolo --- bin/udd-query.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'bin') diff --git a/bin/udd-query.sh b/bin/udd-query.sh index 0efb18e8..fb62c8cb 100755 --- a/bin/udd-query.sh +++ b/bin/udd-query.sh @@ -62,7 +62,6 @@ multiarch_versionskew() { # TODO: show versions (per arch) too done fi - rm $UDD } orphaned_without_o_bug() { @@ -95,13 +94,15 @@ orphaned_without_o_bug() { done fi - rm -f "$UDD" "$WNPPRM" "$SORTED_UDD" + rm -f "$WNPPRM" "$SORTED_UDD" } # # main # UDD=$(mktemp) +function rmtmpfile { rm -f "$UDD"; } +trap rmtmpfile exit case $1 in orphaned_without_o_bug) orphaned_without_o_bug -- cgit v1.2.3-70-g09d2