tools/configure.sh: Create -E command for distcleaning regardless of

configuration changes

According to the usage documentation, [-e] option should "enforce
distclean if already configured". This behavior was broken due to the -e
option being evaluated only if the current defconfig is different from
the backup defconfig. The new -E command inherits this behavior.
This commit is contained in:
Gustavo Henrique Nihei
2020-08-20 09:37:10 -03:00
committed by Abdelatif Guettouche
parent 2953880f5c
commit b90c8914f3
+14 -5
View File
@@ -37,10 +37,11 @@ WD=`test -d ${0%/*} && cd ${0%/*}; pwd`
TOPDIR="${WD}/.." TOPDIR="${WD}/.."
USAGE=" USAGE="
USAGE: ${0} [-e] [-l|m|c|u|g|n] [-a <app-dir>] <board-name>:<config-name> [make-opts] USAGE: ${0} [-E] [-e] [-l|m|c|u|g|n] [-a <app-dir>] <board-name>:<config-name> [make-opts]
Where: Where:
-e enforce distclean if already configured -E enforces distclean.
-e performs distclean if configuration changed.
-l selects the Linux (l) host environment. -l selects the Linux (l) host environment.
-m selects the macOS (m) host environment. -m selects the macOS (m) host environment.
-c selects the Windows host and Cygwin (c) environment. -c selects the Windows host and Cygwin (c) environment.
@@ -71,7 +72,8 @@ unset boardconfig
unset winnative unset winnative
unset appdir unset appdir
unset host unset host
unset enforce unset enforce_distclean
unset distclean
while [ ! -z "$1" ]; do while [ ! -z "$1" ]; do
case "$1" in case "$1" in
@@ -87,8 +89,11 @@ while [ ! -z "$1" ]; do
winnative=y winnative=y
host+=" $1" host+=" $1"
;; ;;
-E )
enforce_distclean=y
;;
-e ) -e )
enforce=y distclean=y
;; ;;
-h ) -h )
echo "$USAGE" echo "$USAGE"
@@ -166,13 +171,17 @@ if [ ! -r ${src_config} ]; then
exit 5 exit 5
fi fi
if [ "X${enforce_distclean}" = "Xy" ]; then
make -C ${TOPDIR} distclean $*
fi
if [ -r ${dest_config} ]; then if [ -r ${dest_config} ]; then
if cmp -s ${src_config} ${backup_config}; then if cmp -s ${src_config} ${backup_config}; then
echo "No configuration change." echo "No configuration change."
exit 0 exit 0
fi fi
if [ "X${enforce}" = "Xy" ]; then if [ "X${distclean}" = "Xy" ]; then
make -C ${TOPDIR} distclean $* make -C ${TOPDIR} distclean $*
else else
echo "Already configured!" echo "Already configured!"