From 223eab4b5bfcc625c526a2e754a54b6250f5f6ec Mon Sep 17 00:00:00 2001 From: Alexis Menard Date: Wed, 29 Jun 2011 15:13:47 -0300 Subject: 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 --- bin/syncqt | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/bin/syncqt b/bin/syncqt index dd04e43..8e0b3e4 100755 --- a/bin/syncqt +++ b/bin/syncqt @@ -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 = ) { chomp $line; if($line =~ /^ *QT *\+?= *([^\r\n]*)/) { -- cgit v0.12