Update fileDelete.xml to remove files where only the case changed
It is not guaranteed that new file case was successfully applied on case
insensitive file system, so these files might be deleted even with the
fileDelete PIP verifying the actual casing since
49c488354f3fd5b02a851a48d912d6aad3601161.
Remove those files from fileDelete.xml to be on the safe side. This is no
longer easily doable with bash only. The following PHP script was used to
generate fileDelete.xml:
<?php
\exec(<<<'EOT'
git log --root --diff-filter=D --no-renames --summary |awk '/delete mode/{print $NF}' |grep wcfsetup/install/files/ |sort -u
EOT, $delete);
\exec(<<<'EOT'
find wcfsetup/install/files/ |sort -u
EOT, $preserve);
$preserve = \array_map('strtolower', $preserve);
$delete = \array_filter($delete, static function ($file) use ($preserve) {
return !\in_array(\strtolower($file), $preserve);
});
echo <<<'EOT'
<?xml version="1.0" encoding="UTF-8"?>
<data xmlns="http://www.woltlab.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.woltlab.com http://www.woltlab.com/XSD/2019/fileDelete.xsd">
<delete>
<!-- Special files -->
<file>acp/masterPassword.inc.php</file>
<!-- /Special files -->
EOT, "\n";
echo \implode("\n", \array_map(static function ($file) {
$file = \preg_replace('/^wcfsetup\\/install\\/files\\//', '', $file);
return "\t\t<file>{$file}</file>";
}, $delete))."\n";
echo <<<'EOT'
</delete>
</data>
EOT, "\n";