Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- From 180ebdffe6adbdb000caaa27f987791fd7880eaa Mon Sep 17 00:00:00 2001
- From: Liang Qi <liang.qi@nokia.com>
- Date: Fri, 18 Feb 2011 15:13:48 +0100
- Subject: [PATCH] to be reviewed
- ---
- modularize | 36 ++++++++++--
- scripts/780_symbianpkgrules | 51 ++++++++++++++++
- scripts/800_git_split | 132 ++++++++++++++++++++++++++++++++++++++++++
- scripts/810_qtwebkit_patches | 36 +++++++++++
- scripts/880_symbianpkgrules | 51 ----------------
- scripts/900_git_split | 132 ------------------------------------------
- scripts/910_qtwebkit_patches | 36 -----------
- scripts/999_modularized | 71 ++++++++++++++++++++++
- 8 files changed, 321 insertions(+), 224 deletions(-)
- create mode 100644 scripts/780_symbianpkgrules
- create mode 100644 scripts/800_git_split
- create mode 100644 scripts/810_qtwebkit_patches
- delete mode 100644 scripts/880_symbianpkgrules
- delete mode 100644 scripts/900_git_split
- delete mode 100644 scripts/910_qtwebkit_patches
- create mode 100644 scripts/999_modularized
- diff --git a/modularize b/modularize
- index 7570d89..b90ec8d 100755
- --- a/modularize
- +++ b/modularize
- @@ -297,8 +297,8 @@ sub patchHasChanges
- sub showUsage {
- print "$0 usage:\n";
- - print " -no-modularize Don't run the 0xx-8xx script range\n";
- - print " -no-split Don't run the 9xx script range\n";
- + print " -no-modularize Don't run the 0xx-7xx script range\n";
- + print " -no-split Don't run the 8xx script range\n";
- print " -no-commit Do not commit the changes\n";
- print " -move <dest> Copy the new folder in the given destination \n";
- print " -symlinks Uses symlinks for the mother repo instead of repo copies\n";
- @@ -315,6 +315,8 @@ sub showUsage {
- print " to current HEAD\n";
- print " -regenerate-patches Automatically regenerate all the patches for the\n";
- print " modularization project (does not copy to the repo!)\n";
- + print " -modularized <dest> Run the 999 script, \n";
- + print " and will copy all repos to the given destination\n";
- print " -? This help\n";
- }
- # -- End functions ---------------------------------------------------------------------------------
- @@ -323,6 +325,8 @@ sub showUsage {
- $OStype = checkOS;
- our $run_split = 1;
- our $run_rest = 1;
- +our $run_final = 0;
- +our $final_dest = "";
- our $commit_changes = 1;
- our $redo = 0;
- our $move = 0;
- @@ -378,6 +382,16 @@ while ( @ARGV ) {
- $rebase_patches = 1;
- } elsif ($arg eq "-regenerate-patches") {
- $regenerate_patches = 1;
- + } elsif($arg eq "-modularized") {
- + if (@ARGV) {
- + $run_final = 1;
- + $final_dest = shift @ARGV;
- + }
- + else {
- + print "Missing destination\n\n";
- + showUsage();
- + exit 1;
- + }
- } else {
- print "Unknown option: $arg\n\n";
- showUsage();
- @@ -495,11 +509,13 @@ if ($redo) {
- }
- my @scripts;
- -push @scripts, sort(findFiles("$basepath/scripts", '^[0-7]\d+_.*[^~]', 0)) if ($run_rest);
- +push @scripts, sort(findFiles("$basepath/scripts", '^[0-6]\d+_.*[^~]', 0)) if ($run_rest);
- my @scripts_generated_commits;
- -push @scripts_generated_commits, sort(findFiles("$basepath/scripts", '^8\d+_.*[^~]', 0)) if ($run_rest);
- +push @scripts_generated_commits, sort(findFiles("$basepath/scripts", '^7\d+_.*[^~]', 0)) if ($run_rest);
- my @scripts_split;
- -push @scripts_split, sort(findFiles("$basepath/scripts", '^9\d+_.*[^~]', 0)) if ($run_split);
- +push @scripts_split, sort(findFiles("$basepath/scripts", '^8\d+_.*[^~]', 0)) if ($run_split);
- +my @scripts_final;
- +push @scripts_final, sort(findFiles("$basepath/scripts", '999', 0)) if ($run_final);
- print "Scripts to execute (in order):\n ".join(", ", (@scripts, @scripts_generated_commits))."\n";
- # Remember that each script need to end with a "return 1;" on success, and "return 0;" when unsuccessful
- @@ -574,5 +590,15 @@ if($run_split) {
- }
- chdir($qtdir);
- +#create the final repository for git server
- +if($run_final) {
- + foreach my $script (@scripts_final) {
- + print "--> $script\n";
- + chdir($qtdir);
- + require("$basepath/scripts/$script");
- + }
- +}
- +chdir($qtdir);
- +
- print "===\n";
- print "Modularization done!\n";
- diff --git a/scripts/780_symbianpkgrules b/scripts/780_symbianpkgrules
- new file mode 100644
- index 0000000..a5820ac
- --- /dev/null
- +++ b/scripts/780_symbianpkgrules
- @@ -0,0 +1,51 @@
- +#--------------------------------------------------------------------------------------------------
- +# 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("qtkernel") # Ensures that qtkernel 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) {
- + 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;
- diff --git a/scripts/800_git_split b/scripts/800_git_split
- new file mode 100644
- index 0000000..2e615bd
- --- /dev/null
- +++ b/scripts/800_git_split
- @@ -0,0 +1,132 @@
- +#--------------------------------------------------------------------------------------------------
- +# 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("qtkernel") # Ensures that qtkernel exists and is a directory. Will create
- +# it if it does not exist.
- +#--------------------------------------------------------------------------------------------------
- +
- +# Ensure that nothing is left out
- +chdir("src");
- +fsRmdirWithParents("plugins/imageformats");
- +fsRmdir("tools");
- +fsRmdir("3rdparty");
- +chdir("..");
- +fsRmdir("src");
- +fsRmdir("tools");
- +
- +# Ensure that the mother repo <QTDIR>/qt is created
- +# any by default use that as the repo base for the modules
- +my $motherdir = "qt";
- +my $repos_base = $qtdir . "/" . $motherdir;
- +ensureDir($motherdir);
- +my $cacheDir = $qtWebKitType;
- +
- +
- +# if we told it to move, ensure that the move to directory is created
- +# and point the module repo base to that
- +if ($move) {
- + ensureDir($move_dest);
- + $repos_base = $move_dest;
- +}
- +
- +# Ensure that lns is compile before we can symlink/hardlink
- +if ($link_type != COPY) {
- + if($OStype == WINDOWS) {
- + my $lnsPath = "$basepath/src/lns";
- + $lnsPath =~ s,/,\\,g;
- + run("cd $lnsPath && nmake /f Makefile.win32");
- + } else {
- + run("cd $basepath/src/lns && make");
- + }
- +}
- +
- +# do a full copy/symlink/hardlink of each module into the repo base
- +# and initialize the module repo there
- +foreach my $module (@repos) {
- + my $i = "$qtdir/$module";
- + my $o = "$repos_base/$module";
- +
- + if ($link_type == SYMLINKS) {
- + print "Creating symlink from '$i' to '$o'\n";
- + run("$basepath/lns -v $o $i");
- + } elsif ($link_type == HARDLINKS) {
- + print "Creating hardlinks from '$i' to '$o'\n";
- + run("$basepath/lns -h -v $o $i");
- + } else {
- + print "Copying files from '$i' to '$o'\n";
- + fsCopy("-r", "$module", "$o");
- + }
- +
- + # initiate the Git repo here in the copy
- + chdir("$repos_base/$module");
- + run("git init . -q");
- + run("git add .");
- + run("git commit -F $basepath/misc/import-commit-msg --author \"Qt by Nokia <qt-info\@nokia.com>\" -q");
- + chdir($qtdir);
- +}
- +
- +#-- generate mother repo
- +chdir($motherdir);
- +run ("git init . -q");
- +fsCopy("-r", "$basepath/mother/*", ".");
- +if ($link_type == COPY) {
- + foreach my $module (@repos) {
- + # module repo will either be inside the mother repo already
- + # or in the move destination directory
- + run("git submodule -q add $repos_base/$module");
- + }
- +}
- +if (-d "$basepath/$cacheDir") {
- + # Check for a stale version of WebKit, in case the URL has been updated.
- + chdir("$basepath/$cacheDir");
- + my $remoteUrl = `git config --get remote.origin.url`;
- + chdir($repos_base);
- + if ($remoteUrl !~ $qtWebKitCloneUrl) {
- + print("Deleting cached qtwebkit clone because URLs don't match. remoteUrl=$remoteUrl, qtWebKitCloneUrl=$qtWebKitCloneUrl \n");
- + if ($OStype == WINDOWS) {
- + my $webkitPath = "$basepath/$cacheDir";
- + $webkitPath =~ s,/,\\,g;
- + run("rmdir /S/Q $webkitPath");
- + } else {
- + run("rm -rf $basepath/$cacheDir");
- + }
- + }
- +}
- +if (! -d "$basepath/$cacheDir") {
- + print("Note: Creating a cached clone of WebKit in\n");
- + print(" $basepath/$cacheDir.\n");
- + print(" This will be reused next time unless you delete it yourself.\n");
- + if (runNotDie("git clone --bare $qtWebKitCloneUrl $basepath/$cacheDir") != 0) {
- + # Try one more time. The gitorious server often works on the second attempt,
- + # when its caches are warm.
- + print("Retrying qtwebkit clone one more time...\n");
- + run("git clone --bare $qtWebKitCloneUrl $basepath/$cacheDir");
- + }
- +} else {
- + chdir("$basepath/$cacheDir");
- + # Update with latest objects.
- + run("git fetch");
- + chdir("$qtdir/$motherdir");
- +}
- +run("git submodule -q add --reference $basepath/$cacheDir $qtWebKitCloneUrl qtwebkit");
- +chdir("qtwebkit");
- +run("git reset --hard $qtWebKitCheckoutRef");
- +chdir("..");
- +run("git submodule init");
- +run ("git add . "); #
- +run("git commit -m \"Long live the mother Qt repository\" -q");
- +
- +
- +return 1;
- diff --git a/scripts/810_qtwebkit_patches b/scripts/810_qtwebkit_patches
- new file mode 100644
- index 0000000..f852dd2
- --- /dev/null
- +++ b/scripts/810_qtwebkit_patches
- @@ -0,0 +1,36 @@
- +#--------------------------------------------------------------------------------------------------
- +# 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("qtkernel") # Ensures that qtkernel exists and is a directory. Will create
- +# it if it does not exist.
- +#--------------------------------------------------------------------------------------------------
- +
- +chdir("qt/qtwebkit");
- +my @patches = findFiles("$basepath/patches/qtwebkit", '^\d+-.*\.patch', 0);
- +my @patchesForTrunk = findFiles("$basepath/patches/qtwebkit/webkit", '^\d+-.*\.patch', 0);
- +my @patchesToApply;
- +foreach (@patchesForTrunk) { $inPatchesForTrunk{$_} = 1; }
- +foreach my $patch (@patches) {
- + if ($qtWebKitType =~ /^webkit$/ && $inPatchesForTrunk{$patch}) {
- + push(@patchesToApply, "$basepath/patches/qtwebkit/webkit/$patch");
- + } else {
- + push(@patchesToApply, "$basepath/patches/qtwebkit/$patch");
- + }
- +}
- +run("git am --ignore-whitespace " . join(" ", @patchesToApply));
- +chdir("..");
- +run("git commit -a -m \"Committed Qt Modularization patches to QtWebKit.\" --author \"axis <qt-info\@nokia.com>\"");
- +
- +return 1;
- diff --git a/scripts/880_symbianpkgrules b/scripts/880_symbianpkgrules
- deleted file mode 100644
- index a5820ac..0000000
- --- a/scripts/880_symbianpkgrules
- +++ /dev/null
- @@ -1,51 +0,0 @@
- -#--------------------------------------------------------------------------------------------------
- -# 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("qtkernel") # Ensures that qtkernel 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) {
- - 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;
- diff --git a/scripts/900_git_split b/scripts/900_git_split
- deleted file mode 100644
- index c45523a..0000000
- --- a/scripts/900_git_split
- +++ /dev/null
- @@ -1,132 +0,0 @@
- -#--------------------------------------------------------------------------------------------------
- -# 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("qtkernel") # Ensures that qtkernel exists and is a directory. Will create
- -# it if it does not exist.
- -#--------------------------------------------------------------------------------------------------
- -
- -# Ensure that nothing is left out
- -chdir("src");
- -fsRmdirWithParents("plugins/imageformats");
- -fsRmdir("tools");
- -fsRmdir("3rdparty");
- -chdir("..");
- -fsRmdir("src");
- -fsRmdir("tools");
- -
- -# Ensure that the mother repo <QTDIR>/qt is created
- -# any by default use that as the repo base for the modules
- -my $motherdir = "qt";
- -my $repos_base = $qtdir . "/" . $motherdir;
- -ensureDir($motherdir);
- -my $cacheDir = $qtWebKitType;
- -
- -
- -# if we told it to move, ensure that the move to directory is created
- -# and point the module repo base to that
- -if ($move) {
- - ensureDir($move_dest);
- - $repos_base = $move_dest;
- -}
- -
- -# Ensure that lns is compile before we can symlink/hardlink
- -if ($link_type != COPY) {
- - if($OStype == WINDOWS) {
- - my $lnsPath = "$basepath/src/lns";
- - $lnsPath =~ s,/,\\,g;
- - run("cd $lnsPath && nmake /f Makefile.win32");
- - } else {
- - run("cd $basepath/src/lns && make");
- - }
- -}
- -
- -# do a full copy/symlink/hardlink of each module into the repo base
- -# and initialize the module repo there
- -foreach my $module (@repos) {
- - my $i = "$qtdir/$module";
- - my $o = "$repos_base/$module";
- -
- - if ($link_type == SYMLINKS) {
- - print "Creating symlink from '$i' to '$o'\n";
- - run("$basepath/lns -v $o $i");
- - } elsif ($link_type == HARDLINKS) {
- - print "Creating hardlinks from '$i' to '$o'\n";
- - run("$basepath/lns -h -v $o $i");
- - } else {
- - print "Copying files from '$i' to '$o'\n";
- - fsCopy("-r", "$module", "$o");
- - }
- -
- - # initiate the Git repo here in the copy
- - chdir("$repos_base/$module");
- - run("git init . -q");
- - run("git add .");
- - run("git commit -F $basepath/misc/import-commit-msg --author \"Qt by Nokia <qt-info\@nokia.com>\" -q");
- - chdir($qtdir);
- -}
- -
- -#-- generate mother repo
- -chdir($motherdir);
- -run ("git init . -q");
- -fsCopy("-r", "$basepath/mother/*", ".");
- -if ($link_type == COPY) {
- - foreach my $module (@repos) {
- - # module repo will either be inside the mother repo already
- - # or in the move destination directory
- - run("git submodule -q add $repos_base/$module");
- - }
- -}
- -if (-d "$basepath/$cacheDir") {
- - # Check for a stale version of WebKit, in case the URL has been updated.
- - chdir("$basepath/$cacheDir");
- - my $remoteUrl = `git config --get remote.origin.url`;
- - chdir($repos_base);
- - if ($remoteUrl !~ $qtWebKitCloneUrl) {
- - print("Deleting cached qtwebkit clone because URLs don't match.\n");
- - if ($OStype == WINDOWS) {
- - my $webkitPath = "$basepath/$cacheDir";
- - $webkitPath =~ s,/,\\,g;
- - run("rmdir /S/Q $webkitPath");
- - } else {
- - run("rm -rf $basepath/$cacheDir");
- - }
- - }
- -}
- -if (! -d "$basepath/$cacheDir") {
- - print("Note: Creating a cached clone of WebKit in\n");
- - print(" $basepath/$cacheDir.\n");
- - print(" This will be reused next time unless you delete it yourself.\n");
- - if (runNotDie("git clone --bare $qtWebKitCloneUrl $basepath/$cacheDir") != 0) {
- - # Try one more time. The gitorious server often works on the second attempt,
- - # when its caches are warm.
- - print("Retrying qtwebkit clone one more time...\n");
- - run("git clone --bare $qtWebKitCloneUrl $basepath/$cacheDir");
- - }
- -} else {
- - chdir("$basepath/$cacheDir");
- - # Update with latest objects.
- - run("git fetch");
- - chdir("$qtdir/$motherdir");
- -}
- -run("git submodule -q add --reference $basepath/$cacheDir $qtWebKitCloneUrl qtwebkit");
- -chdir("qtwebkit");
- -run("git reset --hard $qtWebKitCheckoutRef");
- -chdir("..");
- -run("git submodule init");
- -run ("git add . "); #
- -run("git commit -m \"Long live the mother Qt repository\" -q");
- -
- -
- -return 1;
- diff --git a/scripts/910_qtwebkit_patches b/scripts/910_qtwebkit_patches
- deleted file mode 100644
- index f852dd2..0000000
- --- a/scripts/910_qtwebkit_patches
- +++ /dev/null
- @@ -1,36 +0,0 @@
- -#--------------------------------------------------------------------------------------------------
- -# 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("qtkernel") # Ensures that qtkernel exists and is a directory. Will create
- -# it if it does not exist.
- -#--------------------------------------------------------------------------------------------------
- -
- -chdir("qt/qtwebkit");
- -my @patches = findFiles("$basepath/patches/qtwebkit", '^\d+-.*\.patch', 0);
- -my @patchesForTrunk = findFiles("$basepath/patches/qtwebkit/webkit", '^\d+-.*\.patch', 0);
- -my @patchesToApply;
- -foreach (@patchesForTrunk) { $inPatchesForTrunk{$_} = 1; }
- -foreach my $patch (@patches) {
- - if ($qtWebKitType =~ /^webkit$/ && $inPatchesForTrunk{$patch}) {
- - push(@patchesToApply, "$basepath/patches/qtwebkit/webkit/$patch");
- - } else {
- - push(@patchesToApply, "$basepath/patches/qtwebkit/$patch");
- - }
- -}
- -run("git am --ignore-whitespace " . join(" ", @patchesToApply));
- -chdir("..");
- -run("git commit -a -m \"Committed Qt Modularization patches to QtWebKit.\" --author \"axis <qt-info\@nokia.com>\"");
- -
- -return 1;
- diff --git a/scripts/999_modularized b/scripts/999_modularized
- new file mode 100644
- index 0000000..eec4c99
- --- /dev/null
- +++ b/scripts/999_modularized
- @@ -0,0 +1,71 @@
- +#--------------------------------------------------------------------------------------------------
- +# 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("qtkernel") # Ensures that qtkernel exists and is a directory. Will create
- +# it if it does not exist.
- +#--------------------------------------------------------------------------------------------------
- +
- +# Ensure that the mother repo <QTDIR>/qt is created
- +# any by default use that as the repo base for the modules
- +my $motherdir1 = "qt";
- +my $modularizeddir = "modularized";
- +my $modularized_base = $qtdir . "/" . $modularizeddir;
- +ensureDir($modularizeddir);
- +my $cacheDir = $qtWebKitType;
- +
- +#generate --bare repo for each module
- +chdir($modularizeddir);
- +foreach my $module (@repos) {
- + print("Modularized for $module.\n");
- + run("git clone --bare ../$motherdir1/$module $module.git");
- +}
- +
- +#scp module repos to dest
- +chdir($modularizeddir);
- +print("Copy all modularized modules to $final_dest.\n");
- +run("scp -r *.git $final_dest");
- +
- +#generate mother repo locally
- +print("Create mother repo based on remote submodule.\n");
- +my $motherdir = "mother";
- +my $motherdir_base = $modularized_base . "/" . $motherdir;
- +ensureDir($motherdir);
- +
- +chdir($motherdir);
- +run ("git init . -q");
- +fsCopy("-r", "$basepath/mother/*", ".");
- +foreach my $module (@repos) {
- + # module repo will either be inside the mother repo already
- + # or in the move destination directory
- + run("git submodule -q add $final_dest/$module $module");
- +}
- +run("git submodule -q add --reference $basepath/$cacheDir $qtWebKitCloneUrl qtwebkit");
- +chdir("qtwebkit");
- +run("git reset --hard $qtWebKitCheckoutRef");
- +chdir("..");
- +run("git submodule init");
- +run ("git add . "); #
- +run("git commit -m \"Long live the mother Qt repository\" -q");
- +
- +#generate --bare repo for mother
- +chdir("..");
- +print("Modularized for mother repo.\n");
- +run("git clone --bare $motherdir mother.git");
- +
- +#scp mother repo to dest
- +print("Copy all modularized mother to $final_dest.\n");
- +run("scp -r mother.git $final_dest");
- +
- +return 1;
- --
- 1.7.4
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement