summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorJason McDonald <jason.mcdonald@nokia.com>2009-09-25 04:19:14 (GMT)
committerJason McDonald <jason.mcdonald@nokia.com>2009-09-25 04:19:14 (GMT)
commit9ff18885e24529d43b9a0be2da863d1f52741789 (patch)
treef8894a4f5972740ffd17b296b3ce5a50b69f22e4 /bin
parentb768917f043bd78ac8af125c1993f05776a052b7 (diff)
downloadQt-9ff18885e24529d43b9a0be2da863d1f52741789.zip
Qt-9ff18885e24529d43b9a0be2da863d1f52741789.tar.gz
Qt-9ff18885e24529d43b9a0be2da863d1f52741789.tar.bz2
Make syncqt order headers deterministically.
Syncqt was relying on the order that headers appear in the filesystem. That order is effectively non-deterministic, meaning that the files generated when running syncqt on different copies of the same source are very hard to compare. For example, when generating source packages for the same sha1 twice in a row, you would expect to get identical source packages, but you don't because each packaging run downlaods the source tree from git, thus randomizing the order of files on the filesystem. This commit forces syncqt to be deterministic by making it sort each directory it reads before it processes the directory. On a side note: syncqt should probably be using Perl's File::Find function instead of recursing through directories itself. Reviewed-by: Lincoln Ramsay
Diffstat (limited to 'bin')
-rwxr-xr-xbin/syncqt2
1 files changed, 1 insertions, 1 deletions
diff --git a/bin/syncqt b/bin/syncqt
index 5cb5d86..6605bfa 100755
--- a/bin/syncqt
+++ b/bin/syncqt
@@ -529,7 +529,7 @@ sub findFiles {
} else {
($dir =~ /\/$/) || ($dir .= "/");
}
- foreach $file ( readdir(D) ) {
+ foreach $file ( sort readdir(D) ) {
next if ( $file =~ /^\.\.?$/ );
$p = $file;
($file =~ /$match/) && (push @files, $p);