summaryrefslogtreecommitdiffstats
path: root/bin/qt5_tool
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2015-02-20 13:14:28 +0100
committerFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2015-03-11 14:36:01 +0000
commitee349f4be8da8ca0fc03f9470b50bd5a6e57f005 (patch)
tree6d25de47417febcb3a48c1a992e5fb3fc1ea219a /bin/qt5_tool
parent59cbffd1b905ae2b85759b46ee37fc19b6dfb0c1 (diff)
qt5_tool: Introduce function for preferred branch.
Replace hash %preferredBranches by a function, making it possible to return values depending on the Qt branch. Change-Id: I2271cb945dabeb544290f5152ab8ad6c628d8c33 Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
Diffstat (limited to 'bin/qt5_tool')
-rwxr-xr-xbin/qt5_tool38
1 files changed, 26 insertions, 12 deletions
diff --git a/bin/qt5_tool b/bin/qt5_tool
index b05409f..5c8d849 100755
--- a/bin/qt5_tool
+++ b/bin/qt5_tool
@@ -101,15 +101,6 @@ done in '/home/user/qt-5-build'. It is overridden by a value for the checkout
'/home/user/qt-5special', which would result in '/home/user/qt-5-special-build'
EOF
-# Empty entry means: Do not touch.
-my %preferredBranches = (
- 'qtrepotools' => 'master',
-# -- Unmaintained modules as of 4.12.2012. Qt3D currently only has 'dev'
- 'qtfeedback' => 'master',
- 'qtpim' => 'master',
- 'qtqa' => 'master',
-);
-
# --------------- Detect OS
my ($OS_LINUX, $OS_WINDOWS, $OS_MAC) = (0, 1, 2);
@@ -473,6 +464,31 @@ sub determineModules
return (@nonWebKit, @webKit)
}
+# ---- Return the preferred branch for a module/Qt branch.
+# Empty result means: Do not touch the module.
+sub preferredBranch
+{
+ my ($module, $desiredQtBranch) = @_;
+ my %preferredBranches = ( # Fixed branches
+ 'qtrepotools' => 'master',
+# -- Unmaintained modules as of 4.12.2012. Qt3D currently only has 'dev'
+ 'qtfeedback' => 'master',
+ 'qtpim' => 'master',
+ 'qtqa' => 'master',
+ );
+ my $result = $preferredBranches{$module};
+ return $result if defined $result;
+ if ($module eq 'qtenginio') {
+ my %enginioMapping = (
+ '5.4' => '1.1',
+ '5.5' => '1.2'
+ );
+ my $mapped = $enginioMapping{$desiredQtBranch};
+ return defined $mapped ? $mapped : 'dev';
+ }
+ return $desiredQtBranch;
+}
+
# ---- Helper to be called before pull. Checks if
# the module is in a 'no branch' state after init-repository or in the wrong
# branch as from the configuration file.
@@ -481,9 +497,7 @@ sub determineModules
sub checkoutBranch
{
my ($mod, $desiredBranchIn) = @_;
- # -- Special treatment for webkit: Do not touch.
- my $desiredBranch = $preferredBranches{$mod};
- $desiredBranch = $desiredBranchIn unless defined $desiredBranch;
+ my $desiredBranch = preferredBranch($mod, $desiredBranchIn);
if ($desiredBranch eq '') {
print 'Skipping ', $mod, ".\n";
return 0;