From fb28c4fe687548541240894332ea75b4c4820167 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Mon, 25 Jul 2011 17:19:08 +0200 Subject: Use trap to cleanup --- checkrepo | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'checkrepo') diff --git a/checkrepo b/checkrepo index ddce82a..b88f7c1 100755 --- a/checkrepo +++ b/checkrepo @@ -7,6 +7,7 @@ tmp="$(mktemp -d)" [[ -f "${lock}" ]] && exit 1 touch "${lock}" +trap "rm -rf '${lock}' '${tmp}'" EXIT INT TERM echo ' BEGIN { @@ -49,6 +50,3 @@ done cat ${tmp}/md5sums-{i686,x86_64}.txt > ${tmp}/md5sums.txt md5sum -c --quiet ${tmp}/md5sums.txt - -rm -rf ${tmp} -rm -f "${lock}" -- cgit v1.2.3-24-g4f1b