diff mbox series

[3/9] metadata: parse.sh: Pass -v to metaparse on VERBOSE=1

Message ID 20240104204614.1426027-4-pvorel@suse.cz
State Changes Requested
Headers show
Series metadata: improvements | expand

Commit Message

Petr Vorel Jan. 4, 2024, 8:46 p.m. UTC
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 metadata/parse.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Cyril Hrubis Feb. 23, 2024, 12:46 p.m. UTC | #1
Hi!
> +[ "$VERBOSE" ] && v="-v"

The build system uses just V=1 for a verbose mode so we should probably
be consistent...

Other than that:

Reviewed-by: Cyril Hrubis <chrubis@suse.cz>

>  for test in $tests; do
> -	a=$($top_builddir/metadata/metaparse -Iinclude -Itestcases/kernel/syscalls/utils/ "$test")
> +	a=$($top_builddir/metadata/metaparse $v -Iinclude -Itestcases/kernel/syscalls/utils/ "$test")
>  	if [ -n "$a" ]; then
>  		if [ -z "$first" ]; then
>  			echo ','
> -- 
> 2.43.0
> 
> 
> -- 
> Mailing list info: https://lists.linux.it/listinfo/ltp
Petr Vorel Feb. 23, 2024, 2:33 p.m. UTC | #2
Hi Cyril,

> Hi!
> > +[ "$VERBOSE" ] && v="-v"

> The build system uses just V=1 for a verbose mode so we should probably
> be consistent...

We actually use both, see include/mk/env_pre.mk

ifeq ($V,1)
VERBOSE=1
endif

Therefore should I use both here as well?

[ "$VERBOSE" -o "$V" ] && v="-v"

Kind regards,
Petr
Petr Vorel Feb. 23, 2024, 2:37 p.m. UTC | #3
> Hi Cyril,

> > Hi!
> > > +[ "$VERBOSE" ] && v="-v"

> > The build system uses just V=1 for a verbose mode so we should probably
> > be consistent...

> We actually use both, see include/mk/env_pre.mk

> ifeq ($V,1)
> VERBOSE=1
> endif

> Therefore should I use both here as well?

> [ "$VERBOSE" -o "$V" ] && v="-v"

[ "$V" ] && VERBOSE=1
...
a=$($top_builddir/metadata/metaparse $VERBOSE -Iinclude -Itestcases/kernel/syscalls/utils/ "$test")

(for global scope variable is better to use upper case)

Kind regards,
Petr

> Kind regards,
> Petr
Cyril Hrubis Feb. 23, 2024, 2:40 p.m. UTC | #4
Hi!
> Therefore should I use both here as well?

I guess checking for both in shell scripts is the easiest solution.
diff mbox series

Patch

diff --git a/metadata/parse.sh b/metadata/parse.sh
index 9dd097153..83a3683b5 100755
--- a/metadata/parse.sh
+++ b/metadata/parse.sh
@@ -36,8 +36,10 @@  else
 	tests=$(find testcases/ -name '*.c' | sort)
 fi
 
+[ "$VERBOSE" ] && v="-v"
+
 for test in $tests; do
-	a=$($top_builddir/metadata/metaparse -Iinclude -Itestcases/kernel/syscalls/utils/ "$test")
+	a=$($top_builddir/metadata/metaparse $v -Iinclude -Itestcases/kernel/syscalls/utils/ "$test")
 	if [ -n "$a" ]; then
 		if [ -z "$first" ]; then
 			echo ','