From 6f9117eae2f2176d3ea36dc24fc0ba1ae63c0147 Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Thu, 19 Mar 2020 11:47:34 +0800 Subject: [PATCH] tools/sethost.sh: Remove argument Since this argument generate the expanding(deprecated) defconfig --- 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 52d51e0657..fcf4b75464 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] [] + 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 - selects configuration file. Default: .config simhostroute.sh --------------- diff --git a/tools/sethost.sh b/tools/sethost.sh index 4e776ab4a9..2d2bd18b67 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] []" + 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 " 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