summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorStefan Reinauer <stefan.reinauer@coreboot.org>2016-04-06 15:39:48 -0700
committerStefan Reinauer <stefan.reinauer@coreboot.org>2016-04-19 01:38:06 +0200
commit88e83e580d0a95058be474014fb4f4e0be28d169 (patch)
tree0a948907cb4aaed586bb2784cac0661c7817ac51 /util
parent7844912f3788a3ce116fa20d388ee974d7209cc5 (diff)
downloadcoreboot-88e83e580d0a95058be474014fb4f4e0be28d169.tar.xz
crossgcc: Move temp file handling into cleanup function
Move code to handle leaving temp files around into cleanup. Change-Id: Ief346d7973f693ec06c8bef6492cf1330858d9e1 Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Reviewed-on: https://review.coreboot.org/14346 Tested-by: build bot (Jenkins) Reviewed-by: Nico Huber <nico.h@gmx.de>
Diffstat (limited to 'util')
-rwxr-xr-xutil/crossgcc/buildgcc11
1 files changed, 6 insertions, 5 deletions
diff --git a/util/crossgcc/buildgcc b/util/crossgcc/buildgcc
index ea7c2e9853..98b57f7bb6 100755
--- a/util/crossgcc/buildgcc
+++ b/util/crossgcc/buildgcc
@@ -332,6 +332,11 @@ build() {
cleanup()
{
+ if [ $SAVETEMPS -ne 0 ]; then
+ printf "Leaving temporary files around... ${green}ok${NC}\n"
+ return
+ fi
+
printf "Cleaning up temporary files... "
for package in $PACKAGES; do
rm -rf build-${TARGETARCH}-$package build-$package $(eval echo \$$package"_DIR")
@@ -811,10 +816,6 @@ PROGNAME=$(basename "$0")
rm -f "$DESTDIR$TARGETDIR/share/$PROGNAME-*"
cp "$PROGNAME" "$DESTDIR$TARGETDIR/share/$PROGNAME-$CROSSGCC_VERSION-$CROSGCC_COMMIT"
-if [ $SAVETEMPS -eq 0 ]; then
- cleanup
-else
- printf "Leaving temporary files around... ${green}ok${NC}\n"
-fi
+cleanup
printf "\n${green}You can now run your $NAME toolchain from $TARGETDIR.${NC}\n"