Skip to contentSkip to conversation

configure: Fix summary for --disable-metadata

PATCH In review Cyril Hrubis 2 participants 3 messages Jan 20, 2022 – Jan 24, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 configure: Fix summary for --disable-metadata

This changes the m4/ltp-docparse.m4 to skip the detection and sets the corresponding variables so that we get correct summary when the metadata are disable by users.

---
 m4/ltp-docparse.m4 | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
m4/ltp-docparse.m4 +7 -1
index 88d2e08e4..9514e5e1e 100644
@@ -35,7 +35,13 @@ with_metadata=no
 with_metadata_html=no
 with_metadata_pdf=no
 
-if test "x$enable_metadata" = xyes && test "x$enable_metadata_html" = xyes -o "x$enable_metadata_pdf" = xyes; then
+if test "x$enable_metadata" != xyes; then
+	enable_metadata_html=no
+	enable_metadata_pdf=no
+	with_metadata_generator=none
+fi
+
+if test "x$enable_metadata_html" = xyes -o "x$enable_metadata_pdf" = xyes; then
 	AX_PROG_PERL_MODULES(Cwd File::Basename JSON LWP::Simple)
 fi
 
Signature · 5 lines
2.34.1


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
Reviewed-by on v1 1/1
#1 lore raw

Hi Cyril,

Quoted 3 lines

This changes the m4/ltp-docparse.m4 to skip the detection and sets the corresponding variables so that we get correct summary when the metadata are disable by users.

LGTM, I'm for applying this before release.

./configure --disable-metadata-pdf --disable-metadata-html
...
configure: metadata generation disabled
...
METADATA
metadata generator: detect
HTML metadata: no
PDF metadata: no

=> this case is not handled well. Output during configure ("metadata generation disabled") is IMHO more descriptive than our summary - "detect" can be confusing for people. We could further tweak configure.ac:

@@ -43,6 +43,9 @@ fi

if test "x$enable_metadata_html" = xyes -o "x$enable_metadata_pdf" = xyes; then
AX_PROG_PERL_MODULES(Cwd File::Basename JSON LWP::Simple)
+else
+ with_metadata=no
+ with_metadata_generator=none
fi

---
=> would lead to:
METADATA
metadata generator: none
HTML metadata: no
PDF metadata: no

But instead of that I'd also adjusted the summary to print "metadata disabled" to reflect the reality, i.e. apply also my patch
https://lore.kernel.org/ltp/[email protected]/

Kind regards,
Petr

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
#2 lore raw

Hi Cyril,

I merged the patchset.

Kind regards,
Petr

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp