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.

Change-Id: I4381b256850e4101b760df21f2b0baffb4414620
Reviewed-by: Eric Lemanissier <eric.lemanissier@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 87ffd79622915509d73c04821ea1d2ada470ba2c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Kai Köhne 2021-01-22 10:27:10 +01:00 committed by Qt Cherry-pick Bot
parent 7d3fee7ca9
commit 236302c44d

View File

@ -71,6 +71,10 @@ if (checkCommand("xmlstarlet")) {
# Minify the data before compressing # Minify the data before compressing
$cmd = "xmlstarlet sel -D -B -t -c / $fname"; $cmd = "xmlstarlet sel -D -B -t -c / $fname";
$cmd .= "| $compress" if $compress; $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) { } elsif ($compress) {
$cmd = "$compress < $fname" $cmd = "$compress < $fname"
} }