Fix internal mimetypes db on Windows when compressed by an external tool

Ensure to use binary encoding when handling the output of the
compression tool.
With out this change \r are dropped and the compressed file is corrupted.

Change-Id: Iaf9b1fc015a376682f793aff079f45d03b201aec
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Hannah von Reth 2021-11-04 16:16:48 +01:00
parent 1a984b3d2d
commit 740d652f2d

View File

@ -81,6 +81,7 @@ if (checkCommand("xmlstarlet")) {
if ($cmd) {
# Run the command and read everything
open CMD, "$cmd |";
binmode CMD;
$data = <CMD>;
close CMD;
die("Failed to run $cmd") if ($? >> 8);