From 236302c44d6392bb0a9c7d32d7ff1c03dd42fdb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kai=20K=C3=B6hne?= Date: Fri, 22 Jan 2021 10:27:10 +0100 Subject: [PATCH] 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 Reviewed-by: Thiago Macieira (cherry picked from commit 87ffd79622915509d73c04821ea1d2ada470ba2c) Reviewed-by: Qt Cherry-pick Bot --- src/corelib/mimetypes/mime/generate.pl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/corelib/mimetypes/mime/generate.pl b/src/corelib/mimetypes/mime/generate.pl index 1427658e595..4f2d7d5f2bf 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" }