From 84c61723afc288833f4ce655abdb899048eef685 Mon Sep 17 00:00:00 2001 From: "Luis R. Rodriguez" Date: Wed, 5 Aug 2009 11:09:56 -0700 Subject: [PATCH] Cleanup upon new driver-request This lets you switch between drivers with driver-select. Signed-off-by: Luis R. Rodriguez --- scripts/driver-select | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/scripts/driver-select b/scripts/driver-select index a7ec5e4c63fd..df3c1013e8ac 100755 --- a/scripts/driver-select +++ b/scripts/driver-select @@ -142,11 +142,28 @@ if [ ! -f compat-release ]; then exit fi +if [[ ! -f built-in.o ]]; then + if [[ "$1" != "restore" ]]; then + echo -e "${YELLOW}Processing new driver-select request...${NORMAL}" + fi +fi + # Always backup the top level Makefile, unless restoring if [[ "$1" != "restore" ]]; then backup_file Makefile fi +# If a user selects a new driver make sure we clean up for them +# first and also restore the backup makefiles then. Otherwise +# we'll be trying to leave drivers on Makefiles which are not +# already there from a previous run. +if [ -f built-in.o ]; then + echo -e "${YELLOW}Old build found, going to clean this up first...${NORMAL}" + make clean + echo -e "${YELLOW}Restoring Makefiles...${NORMAL}" + ./$0 restore +fi + case $1 in restore) restore_compat -- 2.30.2