From: Oswald Buddenhagen Date: Wed, 11 Apr 2012 13:40:37 +0000 (+0200) Subject: make sure that forwards for injected headers are not garbage-collected X-Git-Tag: 071012110112~338^2^2~58 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=94bd205575cc807a9a3559a3fd811e683d07fc2b;p=profile%2Fivi%2Fqtbase.git make sure that forwards for injected headers are not garbage-collected qmake-generated version headers don't exist yet at the time syncqt runs, so the forwarding headers would be deleted - just to be re-created a moment later, thus changing the timestamp for no good reason. Change-Id: I1b4c2f05f57c2315adf4b8dd726ea413ede1be5b Reviewed-by: Joerg Bornemann --- diff --git a/bin/syncqt b/bin/syncqt index 04d3162..6bcaccc 100755 --- a/bin/syncqt +++ b/bin/syncqt @@ -597,6 +597,12 @@ sub basePrettify { $$arg =~ s,^\Q$out_basedir\E,,; } +sub cleanPath { + my ($arg) = @_; + while ($arg =~ s,[^/]+/\.\.(/|$),,) {} + return $arg; +} + sub locateSyncProfile { my ($directory) = @_; @@ -876,6 +882,15 @@ foreach my $lib (@modules_to_sync) { #remove the old files if($remove_stale) { + my %injections = (); + for my $p (keys %inject_headers) { + next unless ($p =~ /^\Q$dir\E(\/|$)/); + my $sp = $p; + $sp =~ s,^\Q$basedir\E/,$out_basedir/,; + for my $n (@{$inject_headers{$p}}) { + $injections{$sp."/".$n} = 1; + } + } my @subdirs = ("$out_basedir/include/$lib"); foreach my $subdir (@subdirs) { if (opendir DIR, $subdir) { @@ -894,7 +909,7 @@ foreach my $lib (@modules_to_sync) { if($line =~ /^\#include \"([^\"]*)\"$/) { my $include = $1; $include = $subdir . "/" . $include unless(substr($include, 0, 1) eq "/"); - $remove_file = 1 unless(-e $include); + $remove_file = 1 unless(-e $include or defined $injections{cleanPath($include)}); } else { $remove_file = 0; last;