summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2010-09-01 17:51:37 (GMT)
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2010-09-01 17:53:27 (GMT)
commitb2643a207a23599dbf1aec37cd2b6f8adae1e2dd (patch)
treec414cfb05e829bbe700e3d4c7a9c26944507990e /bin
parent8aa5b8cf04baa11891918ebb57ff0d2d7ada7f78 (diff)
downloadQt-b2643a207a23599dbf1aec37cd2b6f8adae1e2dd.zip
Qt-b2643a207a23599dbf1aec37cd2b6f8adae1e2dd.tar.gz
Qt-b2643a207a23599dbf1aec37cd2b6f8adae1e2dd.tar.bz2
make syncqt propagate timestamps as well
this should reduce the number of unnecessary rebuilds of qt-using code even after re-building qt from scratch - provided the timestamp of qconfig.h is preserved externally. Task-number: QTBUG-12731
Diffstat (limited to 'bin')
-rwxr-xr-xbin/syncqt15
1 files changed, 10 insertions, 5 deletions
diff --git a/bin/syncqt b/bin/syncqt
index 60ecf3a..907869d 100755
--- a/bin/syncqt
+++ b/bin/syncqt
@@ -309,16 +309,17 @@ sub classNames {
}
######################################################################
-# Syntax: syncHeader(header, iheader, copy)
+# Syntax: syncHeader(header, iheader, copy, timestamp)
# Params: header, string, filename to create "symlink" for
# iheader, string, destination name of symlink
# copy, forces header to be a copy of iheader
+# timestamp, the requested modification time if copying
#
# Purpose: Syncronizes header to iheader
# Returns: 1 if successful, else 0.
######################################################################
sub syncHeader {
- my ($header, $iheader, $copy) = @_;
+ my ($header, $iheader, $copy, $ts) = @_;
$iheader =~ s=\\=/=g;
$header =~ s=\\=/=g;
return copyFile($iheader, $header) if($copy);
@@ -332,6 +333,7 @@ sub syncHeader {
open HEADER, ">$header" || die "Could not open $header for writing!\n";
print HEADER "#include \"$iheader_out\"\n";
close HEADER;
+ utime(time, $ts, $header) or die "$iheader, $header";
return 1;
}
return 0;
@@ -472,6 +474,7 @@ sub copyFile
binmode O;
print O $ifilecontents;
close O;
+ utime time, (stat($ifile))[9], $file;
return 1;
} elsif ( $copy < 0 ) {
my $ifile_dir = dirname($ifile);
@@ -481,6 +484,7 @@ sub copyFile
binmode O;
print O $filecontents;
close O;
+ utime time, (stat($file))[9], $ifile;
return 1;
}
}
@@ -823,6 +827,7 @@ foreach my $lib (@modules_to_sync) {
print "SYMBOL: $_\n";
}
} else {
+ my $ts = (stat($iheader))[9];
#find out all the places it goes..
my @headers;
if ($public_header) {
@@ -861,18 +866,18 @@ foreach my $lib (@modules_to_sync) {
# class =~ s,::,/,g;
# }
$class_lib_map_contents .= "QT_CLASS_LIB($full_class, $lib, $header_base)\n";
- $header_copies++ if(syncHeader("$out_basedir/include/$lib/$class", "$out_basedir/include/$lib/$header", 0));
+ $header_copies++ if(syncHeader("$out_basedir/include/$lib/$class", "$out_basedir/include/$lib/$header", 0, $ts));
# KDE-Compat headers for Phonon
if ($lib eq "phonon") {
- $header_copies++ if (syncHeader("$out_basedir/include/phonon_compat/Phonon/$class", "$out_basedir/include/$lib/$header", 0));
+ $header_copies++ if (syncHeader("$out_basedir/include/phonon_compat/Phonon/$class", "$out_basedir/include/$lib/$header", 0, $ts));
}
}
} elsif ($create_private_headers) {
@headers = ( "$out_basedir/include/$lib/private/$header" );
}
foreach(@headers) { #sync them
- $header_copies++ if(syncHeader($_, $iheader, $copy_headers));
+ $header_copies++ if(syncHeader($_, $iheader, $copy_headers, $ts));
}
if($public_header) {