diff options
author | Alexis Menard <alexis.menard@nokia.com> | 2011-06-29 18:13:47 (GMT) |
---|---|---|
committer | Sergio Ahumada <sergio.ahumada@nokia.com> | 2011-06-29 18:24:56 (GMT) |
commit | 223eab4b5bfcc625c526a2e754a54b6250f5f6ec (patch) | |
tree | d6c7fac1d39a0089903fbc43ec1254b00cdb0cbf | |
parent | 85ba298af99c42adce62c68fcaef1055ceb228c1 (diff) | |
download | Qt-223eab4b5bfcc625c526a2e754a54b6250f5f6ec.zip Qt-223eab4b5bfcc625c526a2e754a54b6250f5f6ec.tar.gz Qt-223eab4b5bfcc625c526a2e754a54b6250f5f6ec.tar.bz2 |
Fix headers generation for QtWebKit.
syncqt assumes that the pro files of modules are named the same way as
the directory they are in. QtWebKit 2.2 has its main pro file called
QtWebKit.pro and not qt.pro even if it's located in src/3rdParty/webkit/Source/WebKit/qt.
This patch ensure that syncqt will look for a pro file if there is one in
the directory in the case there isn't one named the same way as the directory.
Reviewed-by:mariusSO
-rwxr-xr-x | bin/syncqt | 21 |
1 files changed, 19 insertions, 2 deletions
@@ -714,8 +714,25 @@ foreach my $lib (@modules_to_sync) { my $master_contents = "#ifndef QT_".$libcapitals."_MODULE_H\n#define QT_".$libcapitals."_MODULE_H\n"; #get dependencies - if(-e "$dir/" . basename($dir) . ".pro") { - if(open(F, "<$dir/" . basename($dir) . ".pro")) { + my $pro_file = "$dir/" . basename($dir) . ".pro"; + if(!open(F, "<$pro_file")) { + #the pro file doesn't exist let's try to find one + opendir(DIR, $dir); + $pro_file = ""; + foreach my $file (readdir(DIR)) + { + if ( $file =~ /\.pro$/i) { + die "There are multiple pro files for $lib module, which one should I use? \n" if ($pro_file ne ""); + $pro_file = "$dir/" . $file; + } + } + closedir(DIR); + if ($pro_file eq "") { + die "I couldn't find a pro file for $lib module \n"; + } + } + if(-e "$pro_file") { + if(open(F, "<$pro_file")) { while(my $line = <F>) { chomp $line; if($line =~ /^ *QT *\+?= *([^\r\n]*)/) { |