summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-08-30 07:00:52 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-08-30 07:00:52 -0600
commitafbf87df914a6caedacd5a23c3e962143ddcfbe9 (patch)
tree1ec19c6b1ea96887afeb7e739283343e111a17a6
parenta5da539a58500a28f1c1b4de231b23a4b6c4eabc (diff)
downloadnuttx-afbf87df914a6caedacd5a23c3e962143ddcfbe9.tar.gz
nuttx-afbf87df914a6caedacd5a23c3e962143ddcfbe9.tar.bz2
nuttx-afbf87df914a6caedacd5a23c3e962143ddcfbe9.zip
Add prompt to refresh.sh
-rw-r--r--nuttx/tools/README.txt9
-rwxr-xr-xnuttx/tools/refresh.sh19
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] <board>/<config>"
+USAGE="USAGE: $0 [--debug|--help] <board>/<config>"
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; }