You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by gn...@apache.org on 2020/03/13 15:44:41 UTC
[incubator-nuttx] branch pr563 updated: tools/refresh.sh: ad
--nocopy option to skip copy defconfig (#563)
This is an automated email from the ASF dual-hosted git repository.
gnutt pushed a commit to branch pr563
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
The following commit(s) were added to refs/heads/pr563 by this push:
new 86f540a tools/refresh.sh: ad --nocopy option to skip copy defconfig (#563)
86f540a is described below
commit 86f540a36ffb5f8617c2fddc3f01b070dd0b173b
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Fri Mar 13 10:44:23 2020 -0500
tools/refresh.sh: ad --nocopy option to skip copy defconfig (#563)
So we can normalize and copy the current .config to defconfig
---
tools/refresh.sh | 45 +++++++++++++++++++++++++++------------------
1 file changed, 27 insertions(+), 18 deletions(-)
diff --git a/tools/refresh.sh b/tools/refresh.sh
index 1e7fd42..d217b76 100755
--- a/tools/refresh.sh
+++ b/tools/refresh.sh
@@ -41,6 +41,7 @@ unset CONFIGS
silent=n
defaults=n
prompt=y
+nocopy=n
while [ ! -z "$1" ]; do
case $1 in
@@ -58,6 +59,9 @@ while [ ! -z "$1" ]; do
--defaults )
defaults=y
;;
+ --nocopy )
+ nocopy=y
+ ;;
--help )
echo "$0 is a tool for refreshing board configurations"
echo ""
@@ -74,6 +78,8 @@ while [ ! -z "$1" ]; do
echo " prompt unless --silent"
echo " --defaults"
echo " Do not prompt for new default selections; accept all recommended default values"
+ echo " --nocopy"
+ echo " Do not copy defconfig from nuttx/boards/<board>/configs to nuttx/.config"
echo " --help"
echo " Show this help message and exit"
echo " <board>"
@@ -207,29 +213,32 @@ for CONFIG in ${CONFIGS}; do
# Copy the .config and Make.defs to the toplevel directory
rm -f SAVEconfig
- if [ -e .config ]; then
- mv .config SAVEconfig || \
- { echo "ERROR: Failed to move .config to SAVEconfig"; exit 1; }
- fi
+ rm -f SAVEMake.defs
- cp -a $DEFCONFIG .config || \
- { echo "ERROR: Failed to copy $DEFCONFIG to .config"; exit 1; }
+ if [ "X${nocopy}" != "Xy" ]; then
+ if [ -e .config ]; then
+ mv .config SAVEconfig || \
+ { echo "ERROR: Failed to move .config to SAVEconfig"; exit 1; }
+ fi
- rm -f SAVEMake.defs
- if [ -e Make.defs ]; then
- mv Make.defs SAVEMake.defs || \
- { echo "ERROR: Failed to move Make.defs to SAVEMake.defs"; exit 1; }
- fi
+ cp -a $DEFCONFIG .config || \
+ { echo "ERROR: Failed to copy $DEFCONFIG to .config"; exit 1; }
- cp -a $MAKEDEFS Make.defs || \
- { echo "ERROR: Failed to copy $MAKEDEFS to Make.defs"; exit 1; }
+ if [ -e Make.defs ]; then
+ mv Make.defs SAVEMake.defs || \
+ { echo "ERROR: Failed to move Make.defs to SAVEMake.defs"; exit 1; }
+ fi
- # Then run oldconfig or oldefconfig
+ cp -a $MAKEDEFS Make.defs || \
+ { echo "ERROR: Failed to copy $MAKEDEFS to Make.defs"; exit 1; }
- if [ "X${defaults}" == "Xy" ]; then
- make olddefconfig
- else
- make oldconfig
+ # Then run oldconfig or oldefconfig
+
+ if [ "X${defaults}" == "Xy" ]; then
+ make olddefconfig
+ else
+ make oldconfig
+ fi
fi
# Run savedefconfig to create the new defconfig file