summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKai Köhne <kai.koehne@qt.io>2021-01-22 10:27:10 +0100
committerKai Koehne <kai.koehne@qt.io>2021-01-25 19:00:53 +0000
commit87ffd79622915509d73c04821ea1d2ada470ba2c (patch)
treea0e45d8e4ea8147c80d2f4b7b0d35054bd453780
parent9165866b191f324b81cabe31a812f606827796ec (diff)
QMimeDatabase/xml: support both 'xmlstarlet' and 'xml' for minifying XML
Commit 370324f6e2f3 changed the call to 'xml' to 'xmlstarlet' because some Linux distributions do not provide a binary called xml. Anyhow, the official Windows packages of xmlstarlet only provide 'xml.exe'. Therefore just check for both. Pick-to: 5.15 6.0 Change-Id: I4381b256850e4101b760df21f2b0baffb4414620 Reviewed-by: Eric Lemanissier <eric.lemanissier@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
-rw-r--r--src/corelib/mimetypes/mime/generate.pl4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/corelib/mimetypes/mime/generate.pl b/src/corelib/mimetypes/mime/generate.pl
index 1427658e59..4f2d7d5f2b 100644
--- a/src/corelib/mimetypes/mime/generate.pl
+++ b/src/corelib/mimetypes/mime/generate.pl
@@ -71,6 +71,10 @@ if (checkCommand("xmlstarlet")) {
# Minify the data before compressing
$cmd = "xmlstarlet sel -D -B -t -c / $fname";
$cmd .= "| $compress" if $compress;
+} elsif (checkCommand("xml")) {
+ # Minify the data before compressing
+ $cmd = "xml sel -D -B -t -c / $fname";
+ $cmd .= "| $compress" if $compress;
} elsif ($compress) {
$cmd = "$compress < $fname"
}