This is an automated email from the ASF dual-hosted git repository.

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

commit b109c92043077d05e2e861f8baeaa203b42af5f9
Author: Xiang Xiao <[email protected]>
AuthorDate: Thu Mar 19 11:47:34 2020 +0800

    tools/sethost.sh: Remove <config> argument
    
    since this argument generate the expanding(deprecated) defconfig
    
    Signed-off-by: Xiang Xiao <[email protected]>
    Change-Id: I16fe3634b23c97209f5b28fd54d10f60913aa3df
---
 tools/README.txt |  3 +-
 tools/sethost.sh | 84 +++++---------------------------------------------------
 2 files changed, 8 insertions(+), 79 deletions(-)

diff --git a/tools/README.txt b/tools/README.txt
index 52d51e0..fcf4b75 100644
--- a/tools/README.txt
+++ b/tools/README.txt
@@ -940,7 +940,7 @@ sethost.sh
 
     $ ./sethost.sh -h
 
-    USAGE: ./sethost.sh [-l|m|c|u|g|n] [<config>]
+    USAGE: ./sethost.sh [-l|m|c|u|g|n]
            ./sethost.sh -h
 
     Where:
@@ -948,7 +948,6 @@ sethost.sh
          Ubuntu under Windows 10 (u), MSYS/MSYS2 (g)
          or Windows native (n).  Default Linux
       -h will show this help test and terminate
-      <config> selects configuration file.  Default: .config
 
 simhostroute.sh
 ---------------
diff --git a/tools/sethost.sh b/tools/sethost.sh
index 4e776ab..2d2bd18 100755
--- a/tools/sethost.sh
+++ b/tools/sethost.sh
@@ -36,11 +36,10 @@ progname=$0
 debug=n
 host=
 wenv=
-unset configfile
 
 function showusage {
   echo ""
-  echo "USAGE: $progname -d [-l|m|c|u|g|n] [<config>]"
+  echo "USAGE: $progname -d [-l|m|c|u|g|n]"
   echo "       $progname -h"
   echo ""
   echo "Where:"
@@ -49,7 +48,6 @@ function showusage {
   echo "     Ubuntu under Windows 10 (u), MSYS/MSYS2 (g)"
   echo "     or Windows native (n). Default Linux"
   echo "  -h will show this help test and terminate"
-  echo "  <config> selects configuration file.  Default: .config"
   exit 1
 }
 
@@ -86,8 +84,6 @@ while [ ! -z "$1" ]; do
     showusage
     ;;
   * )
-    configfile="$1"
-    shift
     break;
     ;;
   esac
@@ -139,60 +135,14 @@ else
   fi
 fi
 
-rm -f $nuttx/SAVEconfig
-rm -f $nuttx/SAVEMake.defs
-
-unset dotconfig
-if [ -z "$configfile" ]; then
-  dotconfig=y
-else
-  if [ "X$configfile" = "X.config" ]; then
-    dotconfig=y
-  else
-    if [ "X$configfile" = "X$nuttx/.config" ]; then
-      dotconfig=y
-    fi
-  fi
+if [ ! -r $nuttx/.config ]; then
+  echo "There is no .config at $nuttx"
+  exit 1
 fi
 
-if [ "X$dotconfig" = "Xy" ]; then
-  unset configfile
-  if [ -r $nuttx/.config ]; then
-    configfile=$nuttx/.config
-  else
-    echo "There is no .config at $nuttx"
-    exit 1
-  fi
-
-  if [ ! -r $nuttx/Make.defs ]; then
-    echo "ERROR: No readable Make.defs file exists at $nuttx"
-    exit 1
-  fi
-else
-  if [ ! -r "$configfile" ]; then
-    echo "ERROR: No readable configuration file exists at $configfile"
-    exit 1
-  fi
-
-  configdir=`dirname $configfile`
-  makedefs=$configdir/Make.defs
-
-  if [ ! -r $makedefs ]; then
-    echo "ERROR: No readable Make.defs file exists at $configdir"
-    exit 1
-  fi
-
-  if [ -f $nuttx/.config ]; then
-    mv $nuttx/.config $nuttx/SAVEconfig
-  fi
-  cp $configfile $nuttx/.config || \
-    { echo "ERROR: cp to $nuttx/.config failed"; exit 1; }
-
-  if [ -f $nuttx/Make.defs ]; then
-    mv $nuttx/Make.defs $nuttx/SAVEMake.defs
-  fi
-  cp $makedefs $nuttx/Make.defs || \
-    { echo "ERROR: cp to $nuttx/Make.defs failed"; exit 1; }
+if [ ! -r $nuttx/Make.defs ]; then
+  echo "ERROR: No readable Make.defs file exists at $nuttx"
+  exit 1
 fi
 
 # Modify the configuration
@@ -276,23 +226,3 @@ if [ "X${debug}" = "Xy" ]; then
 else
   make olddefconfig 1>/dev/null || { echo "ERROR: failed to refresh"; exit 1; }
 fi
-
-# Move config file to correct location and restore any previous .config
-# and Make.defs files
-
-if [ "X$dotconfig" != "Xy" ]; then
-  sed -i -e "s/^CONFIG_APPS_DIR/# CONFIG_APPS_DIR/g" .config
-
-  mv .config $configfile || \
-      { echo "ERROR: Failed to move .config to $configfile"; exit 1; }
-
-  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; }
-  fi
-fi

Reply via email to