diff mbox series

merge_config.sh: do not report some differencess between input and output

Message ID 20230203123140.2227880-1-l.stelmach@samsung.com (mailing list archive)
State New, archived
Headers show
Series merge_config.sh: do not report some differencess between input and output | expand

Commit Message

Łukasz Stelmach Feb. 3, 2023, 12:31 p.m. UTC
If an input config file contains CONFIG_FOO=n the output one
will contain a line '# CONFIG_FOO is not set'. merge_config.sh
should not report it as difference because the end result of
CONFIG_FOO being disabled is achieved.

Inexistence of CONFIG_FOO (because of unment dependencies) in case
CONFIG_FOO=n is requested, should also be ignored.

Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
---
 scripts/kconfig/merge_config.sh | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

Comments

Masahiro Yamada Feb. 4, 2023, 6:49 p.m. UTC | #1
On Fri, Feb 3, 2023 at 9:32 PM Łukasz Stelmach <l.stelmach@samsung.com> wrote:
>
> If an input config file contains CONFIG_FOO=n the output one
> will contain a line '# CONFIG_FOO is not set'. merge_config.sh
> should not report it as difference because the end result of
> CONFIG_FOO being disabled is achieved.
>
> Inexistence of CONFIG_FOO (because of unment dependencies) in case
> CONFIG_FOO=n is requested, should also be ignored.
>
> Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
> ---
>  scripts/kconfig/merge_config.sh | 12 ++++++++----
>  1 file changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/scripts/kconfig/merge_config.sh b/scripts/kconfig/merge_config.sh
> index e5b46980c22a..c6fd6722f1a4 100755
> --- a/scripts/kconfig/merge_config.sh
> +++ b/scripts/kconfig/merge_config.sh
> @@ -196,9 +196,13 @@ for CFG in $(sed -n -e "$SED_CONFIG_EXP1" -e "$SED_CONFIG_EXP2" $TMP_FILE); do
>         REQUESTED_VAL=$(grep -w -e "$CFG" $TMP_FILE)
>         ACTUAL_VAL=$(grep -w -e "$CFG" "$KCONFIG_CONFIG" || true)
>         if [ "x$REQUESTED_VAL" != "x$ACTUAL_VAL" ] ; then
> -               echo "Value requested for $CFG not in final .config"
> -               echo "Requested value:  $REQUESTED_VAL"
> -               echo "Actual value:     $ACTUAL_VAL"
> -               echo ""
> +               if [ "x$REQUESTED_VAL" != "x$CFG=n" -o \
> +                    \( "x$ACTUAL_VAL" != "x"  -a \
> +                       "x$ACTUAL_VAL" != "x# $CFG is not set" \) ]; then
> +                       echo "Value requested for $CFG not in final .config"
> +                       echo "Requested value:  $REQUESTED_VAL"
> +                       echo "Actual value:     $ACTUAL_VAL"
> +                       echo ""
> +               fi
>         fi
>  done
> --
> 2.30.2
>



[Problem 1]

The behaviour is inconsistent
between =n and "is not set".



 Requested: CONFIG_FOO=n
 Actual   : missing due to unmet dep

     -> suppress the report


 Requested: CONFIG_FOO is not set
 Actual   : missing due to unmet dep

     -> show the report



[Problem 2]

This patch introduces another consistency
because line 148 may report something similar.





--
Best Regards
Masahiro Yamada
diff mbox series

Patch

diff --git a/scripts/kconfig/merge_config.sh b/scripts/kconfig/merge_config.sh
index e5b46980c22a..c6fd6722f1a4 100755
--- a/scripts/kconfig/merge_config.sh
+++ b/scripts/kconfig/merge_config.sh
@@ -196,9 +196,13 @@  for CFG in $(sed -n -e "$SED_CONFIG_EXP1" -e "$SED_CONFIG_EXP2" $TMP_FILE); do
 	REQUESTED_VAL=$(grep -w -e "$CFG" $TMP_FILE)
 	ACTUAL_VAL=$(grep -w -e "$CFG" "$KCONFIG_CONFIG" || true)
 	if [ "x$REQUESTED_VAL" != "x$ACTUAL_VAL" ] ; then
-		echo "Value requested for $CFG not in final .config"
-		echo "Requested value:  $REQUESTED_VAL"
-		echo "Actual value:     $ACTUAL_VAL"
-		echo ""
+		if [ "x$REQUESTED_VAL" != "x$CFG=n" -o \
+		     \( "x$ACTUAL_VAL" != "x"  -a \
+			"x$ACTUAL_VAL" != "x# $CFG is not set" \) ]; then
+			echo "Value requested for $CFG not in final .config"
+			echo "Requested value:  $REQUESTED_VAL"
+			echo "Actual value:     $ACTUAL_VAL"
+			echo ""
+		fi
 	fi
 done