From adc241326c6b751911d4ef6763aa9bea0fa12934 Mon Sep 17 00:00:00 2001 From: Patrick Georgi Date: Wed, 14 May 2014 14:30:08 +0200 Subject: xcompile: move tempfile cleanup closer together Change-Id: I4fb3041d505402de3cbcd7ec079dde5e168a90cf Signed-off-by: Patrick Georgi Reviewed-on: http://review.coreboot.org/5744 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer --- util/xcompile/xcompile | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'util') diff --git a/util/xcompile/xcompile b/util/xcompile/xcompile index e256c0d749..cb27306935 100644 --- a/util/xcompile/xcompile +++ b/util/xcompile/xcompile @@ -33,6 +33,12 @@ clean_up() { fi } +# Create temporary file(s). +TMPFILE="$(mktemp /tmp/temp.XXXX 2>/dev/null || echo /tmp/temp.78gOIUGz)" +touch "$TMPFILE" +trap clean_up EXIT + + program_exists() { type "$1" >/dev/null 2>&1 } @@ -155,11 +161,6 @@ AR_${TARCH}:=${GCCPREFIX}ar EOF } -# Create temporary file(s). -TMPFILE="$(mktemp /tmp/temp.XXXX 2>/dev/null || echo /tmp/temp.78gOIUGz)" -touch "$TMPFILE" -trap clean_up EXIT - # Architecture definition SUPPORTED_ARCHITECTURE="x86 armv7 aarch64" -- cgit v1.2.3