Windows: Avoid syncqt needlessly re-generating headers

Normalize newlines so that headers on Windows are not
always treated as outdated.

This amends 108fb2f197.

Task-number: QTBUG-86121
Change-Id: I46ddb3c5b42852bff75fd56ca224c555ac0bae94
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This commit is contained in:
Kai Koehne 2020-08-19 09:45:37 +02:00
parent 5f729da74a
commit 29bd0b781a

View File

@ -435,8 +435,9 @@ sub syncHeader {
# If remove_stale option is on, make sure to overwrite the
# forwarding header contents if the file already exists and its
# content is different from what we will generate.
if ($remove_stale) {
if ($forwarding_header_exists && $remove_stale) {
my $existing_forwarding_header_content = fileContents($header);
$existing_forwarding_header_content =~ s/\r//g; # remove \r's , so comparison is ok on all platforms
my $header_content_is_different =
$new_forwarding_header_content ne $existing_forwarding_header_content;
$update_forwarding_header ||= $header_content_is_different;