[coreboot-gerrit] New patch to review for coreboot: crossgcc: Move temp file handling into cleanup function

Stefan Reinauer (stefan.reinauer@coreboot.org) gerrit at coreboot.org
Wed Apr 13 21:50:52 CEST 2016


Stefan Reinauer (stefan.reinauer at coreboot.org) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/14346

-gerrit

commit 754bdfee4407c0f25c01c1e95cde6ab4834e44b8
Author: Stefan Reinauer <stefan.reinauer at coreboot.org>
Date:   Wed Apr 6 15:39:48 2016 -0700

    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 at coreboot.org>
---
 util/crossgcc/buildgcc | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/util/crossgcc/buildgcc b/util/crossgcc/buildgcc
index 4641ae9..4cf8179 100755
--- a/util/crossgcc/buildgcc
+++ b/util/crossgcc/buildgcc
@@ -319,6 +319,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 $(eval echo \$$package"_DIR")
@@ -797,10 +802,6 @@ PROGNAME=$(basename "$0")
 rm -f "$DESTDIR$TARGETDIR/$PROGNAME".commit.*
 cp "$PROGNAME" $DESTDIR$TARGETDIR/"$PROGNAME.commit.$(git describe)"
 
-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"



More information about the coreboot-gerrit mailing list