From 7bf39c061342ec43d4fe59d041858515a5afca92 Mon Sep 17 00:00:00 2001 From: Patrick Williams Date: Tue, 26 Oct 2021 06:46:48 -0500 Subject: repotest: clean up via trap In the case of early exit, the script could leave tempfiles laying around. Use `trap` to ensure they're properly cleaned up. Signed-off-by: Patrick Williams Change-Id: I403dcacbd15227e445d50ccb2c2627675376fdcd --- meta-phosphor/scripts/run-repotest | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'meta-phosphor') diff --git a/meta-phosphor/scripts/run-repotest b/meta-phosphor/scripts/run-repotest index 1111d0dfd..0a2f4fb39 100755 --- a/meta-phosphor/scripts/run-repotest +++ b/meta-phosphor/scripts/run-repotest @@ -11,6 +11,7 @@ obmc_dir=${script_dir}/../../ patch_files_tmp=$(mktemp) allowed_patches_tmp=$(mktemp) +trap "rm $patch_files_tmp $allowed_patches_tmp" exit git -C "$obmc_dir" ls-files -- \ '*.patch' \ @@ -64,11 +65,7 @@ meta-yadro/recipes-phosphor/ipmi/phosphor-ipmi-host/0002-Add-support-for-boot-in meta-yadro/recipes-phosphor/ipmi/phosphor-ipmi-host/0003-Fix-version-parsing-update-AUX-revision-info.patch " | sort > $allowed_patches_tmp - - files_diff=$(comm -23 $patch_files_tmp $allowed_patches_tmp) -rm $allowed_patches_tmp -rm $patch_files_tmp files_count=$(echo -n "$files_diff" | grep -c '^' || true) if [[ $files_count -ne 0 ]]; then -- cgit v1.2.3