diff options
author | stefan.kuhn@foss-group.ch <stefan.kuhn@foss-group.ch> | 2013-03-02 20:31:38 +0100 |
---|---|---|
committer | Luis R. Rodriguez <mcgrof@do-not-panic.com> | 2013-03-04 17:07:12 -0800 |
commit | c541fafe27487a4806aa09b302c61c7d6bdb90db (patch) | |
tree | ea71e6a461a2541d6dd320a4f924da04b7256ed6 /scripts | |
parent | 24feb35c98a9452d202a122d99755c7edd2a9850 (diff) |
scripts/driver-select: use $BACKUP_EXT everywhere
Signed-off-by: Stefan Kuhn <stefan.kuhn@hispeed.ch>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/driver-select | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/scripts/driver-select b/scripts/driver-select index 4f71e342..a14d1b1f 100755 --- a/scripts/driver-select +++ b/scripts/driver-select @@ -20,9 +20,6 @@ SSB_MAKEFILE="drivers/ssb/Makefile" BCMA_MAKEFILE="drivers/bcma/Makefile" # used to backup files from foo to foo.${BACKUP_EXT} -# If you change this also modify restore_compat() and -# restore_file() below I couldn't find a way to use -# the $BACKUP_EXT there. BACKUP_EXT="bk" # Pretty colors @@ -90,7 +87,7 @@ function backup_file { return fi echo -e "Backing up makefile: ${CYAN}${1}.${BACKUP_EXT}${NORMAL}" - cp $1 $1.bk + cp "${1}" "${1}.${BACKUP_EXT}" } function disable_makefile @@ -301,16 +298,14 @@ function select_brcm80211_driver } function restore_file { - #ORIG=$(shell ${1%%.${BACKUP_EXT}}) - ORIG=${1%%.bk} + local ORIG="${1%%.${BACKUP_EXT}}" cp $1 $ORIG rm -f $1 echo -e "Restored makefile: ${CYAN}${ORIG}${NORMAL} (and removed backup)" } function restore_compat { - #FILES=$(find ./ -type f -name *.$BACKUP_EXT) - FILES=$(find ./ -type f -name *.bk) + local FILES=$(find ./ -type f -name *\."${BACKUP_EXT}") for i in $FILES; do restore_file $i done |