diff options
author | Jędrzej Nowacki <jedrzej.nowacki@digia.com> | 2014-06-17 11:38:48 +0200 |
---|---|---|
committer | Sergio Ahumada <sahumada@blackberry.com> | 2014-06-18 16:31:18 +0200 |
commit | 00c1f83da2d3a32810c69f74706238cc73317ec8 (patch) | |
tree | 75db42a2888852e8f9265c18700a21756b939b60 /scripts/qt | |
parent | 982412967ea21ddb06756d614e12c4e36327f038 (diff) |
Create a mapping between Enginio and Qt5 branches.
The mapping is supposed to be a temporary workaround until we have
a smarter system in place.
Change-Id: I42c884cf510a8ab139abf96c095bd46cbdc44bfe
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
Diffstat (limited to 'scripts/qt')
-rwxr-xr-x | scripts/qt/qt_update_submodules.pl | 36 |
1 files changed, 26 insertions, 10 deletions
diff --git a/scripts/qt/qt_update_submodules.pl b/scripts/qt/qt_update_submodules.pl index 8396944f..14d364ae 100755 --- a/scripts/qt/qt_update_submodules.pl +++ b/scripts/qt/qt_update_submodules.pl @@ -84,15 +84,31 @@ Readonly my @PROPERTIES => ( # Map from submodule to the ref which should be tracked. # When omitted, defaults to `refs/heads/stable'. -Readonly my %SUBMODULE_TRACKING_REF => ( - qt3d => 'refs/heads/master', - qtdocgallery => 'refs/heads/master', - qtfeedback => 'refs/heads/master', - qtjsondb => 'refs/heads/master', - qtpim => 'refs/heads/dev', - qtqa => 'refs/heads/master', - qtrepotools => 'refs/heads/master', -); +sub get_submodule_ref +{ + my ($submodule, $qt_branch) = @_; + + my @submodules_based_only_on_master_branch = ('qt3d', 'qtdocgallery', 'qtfeedback', 'qtjsondb', 'qtqa', 'qtrepotools'); + my @submodules_based_only_on_dev_branch = ('qtpim'); + my %submodules_based_on_custom_branch = ( + 'qtenginio' => + { + 'refs/heads/5.3' => 'refs/heads/1.0', + 'refs/heads/5.3.1' => 'refs/heads/1.0.5', + 'refs/heads/5.3.2' => 'refs/heads/1.0.6', + } + ); + + if ($submodule ~~ @submodules_based_only_on_master_branch) { + return "refs/heads/master"; + } + + if ($submodule ~~ @submodules_based_only_on_dev_branch) { + return "refs/heads/dev"; + } + + return $submodules_based_on_custom_branch{$submodule}{$qt_branch} // $qt_branch; +} # Author and committer to be used for commits by this script. Readonly my $GIT_USER_NAME => 'Qt Submodule Update Bot'; @@ -254,7 +270,7 @@ sub update_submodule my $base_dir = $self->{ 'base.dir' }; my $qt_git_submodule_ref = $self->{ 'qt.git.submodule.ref' }; - my $ref = $SUBMODULE_TRACKING_REF{ $submodule } // $qt_git_submodule_ref; + my $ref = get_submodule_ref($submodule, $qt_git_submodule_ref); # Note that we always use the giturl stored in .gitmodules, even though # init-repository may have used some other giturl. |