diff options
author | Patrick Williams <patrick@stwcx.xyz> | 2021-10-26 14:46:48 +0300 |
---|---|---|
committer | Patrick Williams <patrick@stwcx.xyz> | 2021-10-27 00:08:02 +0300 |
commit | 7bf39c061342ec43d4fe59d041858515a5afca92 (patch) | |
tree | 132ff61cf7aa73eaf698e31593b3c03674454a0b | |
parent | 4c7f865663f8e92afd83517f99de1bfd4ef6612c (diff) | |
download | openbmc-7bf39c061342ec43d4fe59d041858515a5afca92.tar.xz |
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 <patrick@stwcx.xyz>
Change-Id: I403dcacbd15227e445d50ccb2c2627675376fdcd
-rwxr-xr-x | meta-phosphor/scripts/run-repotest | 5 |
1 files changed, 1 insertions, 4 deletions
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 |