devtools: fix invalid config check when building tags

Message ID 20190313150958.22581-1-bruce.richardson@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series devtools: fix invalid config check when building tags |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/mellanox-Performance-Testing success Performance Testing PASS
ci/intel-Performance-Testing success Performance Testing PASS
ci/Intel-compilation success Compilation OK

Commit Message

Bruce Richardson March 13, 2019, 3:09 p.m. UTC
  The check for a valid configuration in build-tags.sh relied on the output
of "make showconfig" rather than checking directly for a config file of
that name. This broke when as part of the rename of the linuxapp/bsdapp
configs to just linux/freebsd, as we stopped advertising the old names
even if they worked. Changing the code to just look for the config
file by name fixes this issue while shortening the code too.

Fixes: 218c4e68c1d9 ("mk: use linux and freebsd in config names")
Fixes: aafaea3d3b70 ("devtools: add tags and cscope index generation")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 devtools/build-tags.sh | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)
  

Comments

Ferruh Yigit March 13, 2019, 3:16 p.m. UTC | #1
On 3/13/2019 3:09 PM, Bruce Richardson wrote:
> The check for a valid configuration in build-tags.sh relied on the output
> of "make showconfig" rather than checking directly for a config file of
> that name. This broke when as part of the rename of the linuxapp/bsdapp
> configs to just linux/freebsd, as we stopped advertising the old names
> even if they worked. Changing the code to just look for the config
> file by name fixes this issue while shortening the code too.
> 
> Fixes: 218c4e68c1d9 ("mk: use linux and freebsd in config names")
> Fixes: aafaea3d3b70 ("devtools: add tags and cscope index generation")
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>

Tested-by: Ferruh Yigit <ferruh.yigit@intel.com>
  
Jerin Jacob Kollanukkaran March 14, 2019, 8:40 p.m. UTC | #2
On Wed, 2019-03-13 at 15:09 +0000, Bruce Richardson wrote:
> The check for a valid configuration in build-tags.sh relied on the
> output
> of "make showconfig" rather than checking directly for a config file
> of
> that name. This broke when as part of the rename of the
> linuxapp/bsdapp
> configs to just linux/freebsd, as we stopped advertising the old
> names
> even if they worked. Changing the code to just look for the config
> file by name fixes this issue while shortening the code too.
> 
> Fixes: 218c4e68c1d9 ("mk: use linux and freebsd in config names")
> Fixes: aafaea3d3b70 ("devtools: add tags and cscope index
> generation")
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>


Acked-by: Jerin Jacob <jerinj@marvell.com>

> ---
>  devtools/build-tags.sh | 9 +--------
>  1 file changed, 1 insertion(+), 8 deletions(-)
> 
> diff --git a/devtools/build-tags.sh b/devtools/build-tags.sh
> index 753e4c23c..d395da47e 100755
> --- a/devtools/build-tags.sh
> +++ b/devtools/build-tags.sh
> @@ -129,14 +129,7 @@ ppc_64_sources()
>  
>  check_valid_target()
>  {
> -	cfgfound=false
> -	allconfigs=$(make showconfigs)
> -	for cfg in $allconfigs ; do
> -		if [ "$cfg" = "$1" ] ; then
> -			cfgfound=true
> -		fi
> -	done
> -	if ! $cfgfound ; then
> +	if [ ! -f "config/defconfig_$1" ] ; then
>  		echo "Invalid config: $1"
>  		print_usage
>  		exit 0
  
Thomas Monjalon March 26, 2019, 11:57 p.m. UTC | #3
13/03/2019 16:09, Bruce Richardson:
> The check for a valid configuration in build-tags.sh relied on the output
> of "make showconfig" rather than checking directly for a config file of
> that name. This broke when as part of the rename of the linuxapp/bsdapp
> configs to just linux/freebsd, as we stopped advertising the old names
> even if they worked. Changing the code to just look for the config
> file by name fixes this issue while shortening the code too.
> 
> Fixes: 218c4e68c1d9 ("mk: use linux and freebsd in config names")
> Fixes: aafaea3d3b70 ("devtools: add tags and cscope index generation")
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>

Applied, thanks
  

Patch

diff --git a/devtools/build-tags.sh b/devtools/build-tags.sh
index 753e4c23c..d395da47e 100755
--- a/devtools/build-tags.sh
+++ b/devtools/build-tags.sh
@@ -129,14 +129,7 @@  ppc_64_sources()
 
 check_valid_target()
 {
-	cfgfound=false
-	allconfigs=$(make showconfigs)
-	for cfg in $allconfigs ; do
-		if [ "$cfg" = "$1" ] ; then
-			cfgfound=true
-		fi
-	done
-	if ! $cfgfound ; then
+	if [ ! -f "config/defconfig_$1" ] ; then
 		echo "Invalid config: $1"
 		print_usage
 		exit 0