From afbf87df914a6caedacd5a23c3e962143ddcfbe9 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 30 Aug 2014 07:00:52 -0600 Subject: Add prompt to refresh.sh --- nuttx/tools/README.txt | 9 ++++++++- nuttx/tools/refresh.sh | 19 ++++++++++--------- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/nuttx/tools/README.txt b/nuttx/tools/README.txt index 0e48ba365..ee50a1c87 100644 --- a/nuttx/tools/README.txt +++ b/nuttx/tools/README.txt @@ -564,9 +564,16 @@ refresh.sh two configuration files is often not useful. But tools/cmpconfig will show only the meaningful differences between the two configuration files. + 4. It will edit the .config file to comment out the setting + of the CONFIG_APPS_DIR= setting. This setting should not + be in checked-in defconfig files because the actually must + be determined at the next time that the configuration is + installed. 5. Finally, the refreshed defconfig file is copied back in place where it can be committed with the next set of - difference (unless you add --dry-run) to the command line. + difference to the command line. refresh.sh will prompt + you first to avoid overwriting the defconfig file with + changes that you do not want. ` zipme.sh -------- diff --git a/nuttx/tools/refresh.sh b/nuttx/tools/refresh.sh index 54ec12724..a35b25b41 100755 --- a/nuttx/tools/refresh.sh +++ b/nuttx/tools/refresh.sh @@ -32,17 +32,13 @@ # POSSIBILITY OF SUCH DAMAGE. # -USAGE="USAGE: $0 [--dry-run|--debug|--help] /" +USAGE="USAGE: $0 [--debug|--help] /" ADVICE="Try '$0 --help' for more information" unset CONFIG -DRYRUN=n while [ ! -z "$1" ]; do case $1 in - --dry-run ) - DRYRUN=y - ;; --debug ) set -x ;; @@ -52,8 +48,6 @@ while [ ! -z "$1" ]; do echo $USAGE echo "" echo "Where:" - echo " --dry-run" - echo " Do no change the defconfig file" echo " --debug" echo " Enable script debug" echo " --help" @@ -169,16 +163,23 @@ make oldconfig # Show differences +sed -i -e "s/^CONFIG_APPS_DIR/# CONFIG_APPS_DIR/g" .config $CMPCONFIG $DEFCONFIG .config -if [ "X$DRYRUN" = "Xn" ]; then +# Save the refreshed configuration + +read -p "Save the new configuration (y/n)?" -n 1 -r +echo +if [[ $REPLY =~ ^[Yy]$ ]] +then echo "Saving the new configuration file" - sed -i -e "s/^CONFIG_APPS_DIR/# CONFIG_APPS_DIR/g" .config mv .config $DEFCONFIG || \ { echo "ERROR: Failed to move .config to $DEFCONFIG"; exit 1; } chmod 644 $DEFCONFIG fi +# Restore any previous .config file + if [ -e SAVEconfig ]; then mv SAVEconfig .config || \ { echo "ERROR: Failed to move SAVEconfig to .config"; exit 1; } -- cgit v1.2.3