lint: Use temporary build directory

`util/lint/lint-stable-002-build-dir-handling` always overwrites your
current `config.h` and `auto.conf` when the pre-commit hook is run. It
can be very confusing when your configuration is suddenly broken. So fix
it by not using the default build directory.

Change-Id: If2bbc97ac2f12a8203a3769d813386a023f93dd6
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/3593
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
This commit is contained in:
Nico Huber 2013-07-02 16:39:28 +02:00 committed by Patrick Georgi
parent a1179cafdb
commit 1bfe37470e
1 changed files with 5 additions and 2 deletions

View File

@ -53,9 +53,12 @@ if [ "$MAKE" = "" ]; then
fi
# prepare a config to use
TMPOBJ=`mktemp .tmpobj.XXXXXX`
rm $TMPOBJ
mkdir -p ${TMPOBJ}
TMPCONFIG=`mktemp .tmpconfig.XXXXXX`
rm -f $TMPCONFIG
$MAKE DOTCONFIG=$TMPCONFIG allyesconfig >/dev/null
$MAKE obj=$TMPOBJ DOTCONFIG=$TMPCONFIG allyesconfig >/dev/null
# look up parent directory
CURRENTDIR=`pwd -P`
@ -66,5 +69,5 @@ compare_output "`run_printall ../obj`" "$PARENTDIR/obj/.../static.c $PARENTDIR/o
compare_output "`run_printall /tmp`" "/tmp/.../static.c /tmp/.../static.c /tmp/.../static.romstage.o"
compare_output "`run_printall /../tmp`" "/tmp/.../static.c /tmp/.../static.c /tmp/.../static.romstage.o"
rm -f $TMPCONFIG
rm -rf $TMPCONFIG $TMPOBJ