Re: [PATCH 1/1] merge_config.sh: Replace prefix CONFIG_ with any prefix

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Masahiro,

thanks for a quick review and patch.

> I'd like to filter "CONFIG_", "BR2_", or whatever specified prefix.

> Some fragment files (e.g. arch/x86/configs/xen.config)
> have comment lines.

> Matching '# ' + arbitrary string
> might hit comment lines accidentally.
Make sense.

> The kconfig binary checks the environment variable 'CONFIG_'
> to override the default prefix:
> https://github.com/torvalds/linux/blob/v4.19/scripts/kconfig/lkc.h#L28
What a crazy variable name. But we're not going to change it.

> For similarity, how about doing in the same way in merge_config.sh ?
Make sense to keep the same approach.

> Does the following work for you ?
> (you can pass CONFIG_=BR2_ to merge_config.sh)
Patch is good (with one note bellow).

Reviewed-by: Petr Vorel <petr.vorel@xxxxxxxxx>

Could you push your patch into your tree?
Or going to post a patch? If not here is mine:


> diff --git a/scripts/kconfig/merge_config.sh b/scripts/kconfig/merge_config.sh
> index 67d1314..391ee6c 100755
> --- a/scripts/kconfig/merge_config.sh
> +++ b/scripts/kconfig/merge_config.sh
> @@ -90,6 +90,10 @@ if [ -z "$KCONFIG_CONFIG" ]; then
>         fi
>  fi

> +# Check the environment variable "CONFIG_" for the config option prefix.
> +# If unset, the default is "CONFIG_".
> +: ${CONFIG_=CONFIG_}
Although I guess this could be less cryptic:
CONFIG_="${CONFIG_:-CONFIG_}"
but too verbose, so I'm for your variant.

...
>  MERGE_LIST=$*
> -SED_CONFIG_EXP="s/^\(# \)\{0,1\}\(CONFIG_[a-zA-Z0-9_]*\)[= ].*/\2/p"
> +SED_CONFIG_EXP="s/^\(# \)\{0,1\}\(${CONFIG_}[a-zA-Z0-9_]*\)[= ].*/\2/p"
>  TMP_FILE=$(mktemp ./.tmp.config.XXXXXXXXXX)

Kind regards,
Petr



[Index of Archives]     [Linux&nblp;USB Development]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite Secrets]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux