1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
#--------------------------------------------------------------------------------------------------
# Standard modularization template
# --------------------------------
#
# The script will start execution from <QTDIR>.
#
# Available variables:
# $qtdir = <QTDIR> or where you started the modularize script from
# $basepath = path for the modularize script, and basepath for the modularization repo
# $OStype = <n> where <n> is one of 0 = Windows, 1 = Unix, 2 = Mac
#
# To execute a command:
# run("git mv foo bar") # runs command, reports error possition and dies
# runNotDie("git mv foo bar") # runs command, reports error possition, returns error code
# and continues. Use ($? >> 8) to get the real exit code.
# ensureDir("qtbase") # Ensures that qtbase exists and is a directory. Will create
# it if it does not exist.
#--------------------------------------------------------------------------------------------------
sub fixSymbianPkgFile {
my $profile = $_[0];
my $readFd;
my $writeFd;
my @stat = stat($profile);
open($readFd, "< $profile") or die("Could not open $profile");
open($writeFd, "> $profile.tmp") or die("Could not open $profile.tmp");
while (<$readFd>) {
s,include\(\$\$QT_SOURCE_TREE/demos/symbianpkgrules\.pri\),CONFIG += qt_demo,;
s,include\(\$\$QT_SOURCE_TREE/examples/symbianpkgrules\.pri\),CONFIG += qt_example,;
print($writeFd $_);
}
close($readFd);
close($writeFd);
unlink($profile);
rename("$profile.tmp", $profile) or die("Could not rename $profile.tmp -> $profile");
chmod($stat[2], $profile) or die("Could not chmod $profile") if ($OStype != 0);
}
my @demosAndExamples;
foreach my $repo (@repos) {
push(@demosAndExamples, findFiles("$repo", ".*\\.pr[iof]", 1));
}
foreach my $profile (@demosAndExamples) {
next if ($profile eq "qtbase/config.profiles");
fixSymbianPkgFile($profile);
}
# axis wrote this script, so he should be the author.
run("git commit -a -q \"--author=axis <qt-info\@nokia.com>\" -m \"Moved to using a feature profile instead of direct inclusion.\"") if ($commit_changes);
return 1;
|