Deal with "sed -i" portability

An empty extension for sed -i is not widely available.

* Where it isn't available (eg. macOS's sed) "sed -i -e" will
  create a backup file with the "-e" suffix.

* Even GNU sed documentation says it's "not recommended".

This commit deals with it by:

* Replace it with a more appropriate tool (kconfig-tweak)

* Or, specify the extension (.bak)
This commit is contained in:
YAMAMOTO Takashi
2021-01-05 13:29:08 +09:00
committed by Alin Jerpelea
parent fbc68912b9
commit fc7cddee39
6 changed files with 6 additions and 13 deletions

View File

@@ -244,12 +244,11 @@ function configure {
varname=`echo $setting | cut -d'=' -f1`
if [ ! -z "$varname" ]; then
echo " Disabling $varname"
sed -i -e "/$varname/d" $nuttx/.config
kconfig-tweak --file $nuttx/.config -d $varname
fi
echo " Enabling $toolchain"
sed -i -e "/$toolchain/d" $nuttx/.config
echo "$toolchain=y" >> $nuttx/.config
kconfig-tweak --file $nuttx/.config -e $toolchain
makefunc olddefconfig
fi