nuttx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From btash...@apache.org
Subject [incubator-nuttx] 06/06: tools/refresh.sh: restore BOARD_DIR when refresh with a different host
Date Wed, 29 Apr 2020 04:28:28 GMT
This is an automated email from the ASF dual-hosted git repository.

btashton pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 97afe1c40228a8baa96ab993b3832933902aa3f2
Author: liuhaitao <liuhaitao@xiaomi.com>
AuthorDate: Tue Apr 28 17:33:24 2020 +0800

    tools/refresh.sh: restore BOARD_DIR when refresh with a different host
    
    There is case as below:
    When do testbuild under Linux host, such as './tools/configure.sh stmf4discovery:nsh',
    arch/arm/src/board is a symlink to boards/arm/stm32/stm32f3discovery/src. Then do
    './tools/refresh.sh --silent stmf4discovery:nsh' after build, it would break the board
    symlink with copydir.sh instead of link.sh since defconfig with Windows host config.
    So call sethost.sh to restore BOARD_DIR. Or it results in 'make distclean' not correctly.
    
    Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
---
 tools/refresh.sh | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/tools/refresh.sh b/tools/refresh.sh
index cbeecfc..e55959f 100755
--- a/tools/refresh.sh
+++ b/tools/refresh.sh
@@ -235,13 +235,13 @@ for CONFIG in ${CONFIGS}; do
     # Then run oldconfig or oldefconfig
 
     if [ "X${defaults}" == "Xy" ]; then
-      if [ "X${debug}" = "Xy" ]; then
+      if [ "X${debug}" == "Xy" ]; then
         make olddefconfig V=1
       else
         make olddefconfig 1>/dev/null
       fi
     else
-      if [ "X${debug}" = "Xy" ]; then
+      if [ "X${debug}" == "Xy" ]; then
         make oldconfig V=1
       else
         make oldconfig 1>/dev/null
@@ -251,7 +251,7 @@ for CONFIG in ${CONFIGS}; do
 
   # Run savedefconfig to create the new defconfig file
 
-  if [ "X${debug}" = "Xy" ]; then
+  if [ "X${debug}" == "Xy" ]; then
     make savedefconfig V=1
   else
     make savedefconfig 1>/dev/null
@@ -285,14 +285,20 @@ for CONFIG in ${CONFIGS}; do
 
   # Restore any previous .config and Make.defs files
 
+  if [ -e SAVEMake.defs ]; then
+    mv SAVEMake.defs Make.defs || \
+      { echo "ERROR: Failed to move SAVEMake.defs to Make.defs"; exit 1; }
+  fi
+
   if [ -e SAVEconfig ]; then
     mv SAVEconfig .config || \
       { echo "ERROR: Failed to move SAVEconfig to .config"; exit 1; }
-  fi
 
-  if [ -e SAVEMake.defs ]; then
-    mv SAVEMake.defs Make.defs || \
-      { echo "ERROR: Failed to move SAVEMake.defs to Make.defs"; exit 1; }
+    if [ "X${debug}" == "Xy" ]; then
+      ./tools/sethost.sh V=1
+    else
+      ./tools/sethost.sh 1>/dev/null
+    fi
   fi
 done
 


Mime
View raw message