diff options
author | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2016-02-18 07:18:11 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2016-02-19 09:21:52 +0100 |
commit | d4bb78696363384b4b1ac8bedaba3eba47f1a5ef (patch) | |
tree | e83c61ca5586149d14a59e5b70790140ce43532f | |
parent | 3fa8726fa7a0feb61e5f6f53c2fcc8f4a44767f2 (diff) | |
parent | fdf1b3cc8df45afbf620155ae1bf2f277a56db22 (diff) |
Merge remote-tracking branch 'origin/5.6' into 5.7
Change-Id: I2bc1389ece7f12efc334f0292edbbea837f9adc2
-rw-r--r-- | .gitmodules | 85 | ||||
-rwxr-xr-x | init-repository | 98 |
2 files changed, 122 insertions, 61 deletions
diff --git a/.gitmodules b/.gitmodules index 8a9cd4f4..3e1147c1 100644 --- a/.gitmodules +++ b/.gitmodules @@ -2,72 +2,72 @@ path = qtbase url = ../qtbase.git branch = 5.7 - initrepo = true + status = essential [submodule "qtsvg"] depends = qtbase path = qtsvg url = ../qtsvg.git branch = 5.7 - initrepo = true + status = addon [submodule "qtdeclarative"] depends = qtbase recommends = qtsvg qtxmlpatterns path = qtdeclarative url = ../qtdeclarative.git branch = 5.7 - initrepo = true + status = essential [submodule "qtactiveqt"] depends = qtbase path = qtactiveqt url = ../qtactiveqt.git branch = 5.7 - initrepo = true + status = addon [submodule "qtscript"] depends = qtbase recommends = qttools path = qtscript url = ../qtscript.git branch = 5.7 - initrepo = true + status = addon [submodule "qtmultimedia"] depends = qtbase recommends = qtdeclarative path = qtmultimedia url = ../qtmultimedia.git branch = 5.7 - initrepo = true + status = essential [submodule "qttools"] depends = qtbase recommends = qtdeclarative qtactiveqt qtwebkit path = qttools url = ../qttools.git branch = 5.7 - initrepo = true + status = essential [submodule "qtxmlpatterns"] depends = qtbase path = qtxmlpatterns url = ../qtxmlpatterns.git branch = 5.7 - initrepo = true + status = addon [submodule "qttranslations"] depends = qttools path = qttranslations url = ../qttranslations.git branch = 5.7 - initrepo = true + status = essential priority = 30 [submodule "qtdoc"] depends = qtdeclarative path = qtdoc url = ../qtdoc.git branch = 5.7 - initrepo = true + status = essential priority = 40 [submodule "qtrepotools"] path = qtrepotools url = ../qtrepotools.git branch = master - initrepo = true + status = essential qt = false [submodule "qtwebkit"] depends = qtbase @@ -75,6 +75,7 @@ path = qtwebkit url = ../qtwebkit.git branch = 5.7 + status = obsolete project = WebKit.pro priority = 20 [submodule "qtwebkit-examples"] @@ -82,12 +83,13 @@ path = qtwebkit-examples url = ../qtwebkit-examples.git branch = 5.7 + status = obsolete [submodule "qtqa"] depends = qtbase path = qtqa url = ../qtqa.git branch = master - initrepo = true + status = essential priority = 50 [submodule "qtlocation"] depends = qtbase @@ -95,207 +97,214 @@ path = qtlocation url = ../qtlocation.git branch = 5.7 - initrepo = true + status = addon [submodule "qtsensors"] depends = qtbase recommends = qtdeclarative path = qtsensors url = ../qtsensors.git branch = 5.7 - initrepo = true + status = addon [submodule "qtsystems"] depends = qtbase recommends = qtdeclarative path = qtsystems url = ../qtsystems.git branch = 5.7 + status = ignore [submodule "qtfeedback"] depends = qtdeclarative recommends = qtmultimedia path = qtfeedback url = ../qtfeedback.git branch = master + status = ignore [submodule "qtdocgallery"] depends = qtdeclarative path = qtdocgallery url = ../qtdocgallery.git branch = master + status = ignore [submodule "qtpim"] depends = qtdeclarative path = qtpim url = ../qtpim.git branch = 5.7 + status = ignore [submodule "qtconnectivity"] depends = qtbase recommends = qtdeclarative qtandroidextras path = qtconnectivity url = ../qtconnectivity.git branch = 5.7 - initrepo = true + status = addon [submodule "qtwayland"] depends = qtbase recommends = qtdeclarative path = qtwayland url = ../qtwayland.git branch = 5.7 - initrepo = true + status = addon [submodule "qt3d"] depends = qtdeclarative qtimageformats path = qt3d url = ../qt3d.git branch = 5.7 - initrepo = true + status = preview [submodule "qtimageformats"] depends = qtbase path = qtimageformats url = ../qtimageformats.git branch = 5.7 - initrepo = true + status = addon [submodule "qtquick1"] depends = qtscript recommends = qtsvg qtxmlpatterns path = qtquick1 url = ../qtquick1.git branch = 5.7 + status = obsolete [submodule "qtgraphicaleffects"] depends = qtdeclarative path = qtgraphicaleffects url = ../qtgraphicaleffects.git branch = 5.7 - initrepo = true + status = addon [submodule "qtquickcontrols"] depends = qtdeclarative recommends = qtgraphicaleffects path = qtquickcontrols url = ../qtquickcontrols.git branch = 5.7 - initrepo = true + status = essential [submodule "qtserialbus"] depends = qtserialport path = qtserialbus url = ../qtserialbus.git branch = 5.7 + status = preview [submodule "qtserialport"] depends = qtbase path = qtserialport url = ../qtserialport.git branch = 5.7 - initrepo = true + status = addon [submodule "qtx11extras"] depends = qtbase path = qtx11extras url = ../qtx11extras.git branch = 5.7 - initrepo = true + status = addon [submodule "qtmacextras"] depends = qtbase path = qtmacextras url = ../qtmacextras.git branch = 5.7 - initrepo = true + status = addon [submodule "qtwinextras"] depends = qtbase recommends = qtdeclarative qtmultimedia path = qtwinextras url = ../qtwinextras.git branch = 5.7 - initrepo = true + status = addon [submodule "qtandroidextras"] depends = qtbase path = qtandroidextras url = ../qtandroidextras.git branch = 5.7 - initrepo = true + status = addon [submodule "qtenginio"] depends = qtdeclarative path = qtenginio url = ../qtenginio.git branch = 5.7 - initrepo = true + status = obsolete [submodule "qtwebsockets"] depends = qtbase recommends = qtdeclarative path = qtwebsockets url = ../qtwebsockets.git branch = 5.7 - initrepo = true + status = addon [submodule "qtwebchannel"] depends = qtbase recommends = qtdeclarative qtwebsockets path = qtwebchannel url = ../qtwebchannel.git branch = 5.7 - initrepo = true + status = addon [submodule "qtwebengine"] depends = qtquickcontrols qtwebchannel recommends = qtlocation path = qtwebengine url = ../qtwebengine.git branch = 5.7 - initrepo = true + status = addon priority = 10 [submodule "qtcanvas3d"] depends = qtdeclarative path = qtcanvas3d url = ../qtcanvas3d.git branch = 5.7 - initrepo = true + status = addon [submodule "qtwebview"] depends = qtdeclarative recommends = qtwebengine path = qtwebview url = ../qtwebview.git branch = 5.7 - initrepo = true + status = addon [submodule "qtquickcontrols2"] depends = qtquickcontrols path = qtquickcontrols2 url = ../qtquickcontrols2.git branch = 5.7 - initrepo = true + status = preview [submodule "qtpurchasing"] depends = qtbase recommends = qtdeclarative path = qtpurchasing url = ../qtpurchasing.git branch = 5.7 - initrepo = true + status = addon [submodule "qtcharts"] depends = qtbase recommends = qtdeclarative qtmultimedia path = qtcharts url = ../qtcharts.git branch = 5.7 - initrepo = true + status = addon [submodule "qtdatavis3d"] depends = qtbase recommends = qtdeclarative qtmultimedia path = qtdatavis3d url = ../qtdatavis3d.git branch = 5.7 - initrepo = true + status = addon [submodule "qtvirtualkeyboard"] depends = qtbase qtdeclarative qtsvg recommends = qtmultimedia qtquickcontrols path = qtvirtualkeyboard url = ../qtvirtualkeyboard.git branch = 5.7 - initrepo = true + status = addon [submodule "qtgamepad"] depends = qtbase recommends = qtdeclarative path = qtgamepad url = ../qtgamepad branch = 5.7 - initrepo = true + status = preview [submodule "qtscxml"] depends = qtbase qtdeclarative path = qtscxml url = ../qtscxml branch = 5.7 - initrepo = true + status = preview [submodule "qtspeech"] depends = qtbase path = qtspeech url = ../qtspeech branch = dev + status = ignore diff --git a/init-repository b/init-repository index f0407f63..b941646b 100755 --- a/init-repository +++ b/init-repository @@ -71,9 +71,12 @@ Options: --module-subset=<module1>,<module2>... Only initialize the specified subset of modules given as the argument. Specified modules must already exist in .gitmodules. The - string "all" results in cloning all known modules. The default is - the set of maintained modules. Module names may be prefixed with a - dash to exclude them from a bigger set. + string "all" results in cloning all known modules. The strings + "essential", "addon", "preview", "obsolete", and "ignore" refer to + classes of modules; "default" maps to "essential,addon,preview", + which corresponds with the set of maintained modules and is also + the default set. Module names may be prefixed with a dash to + exclude them from a bigger set, e.g. "all,-ignore". --no-update Skip the `git submodule update' command. @@ -153,7 +156,10 @@ EOF use Carp qw( confess ); use English qw( -no_match_vars ); use Getopt::Long qw( GetOptions ); -use Cwd qw( getcwd ); +use Cwd qw( getcwd abs_path ); + +my $script_path = abs_path($0); +$script_path =~ s,[/\\][^/\\]+$,,; my $GERRIT_SSH_BASE = 'ssh://@USER@codereview.qt-project.org@PORT@/'; @@ -234,6 +240,7 @@ sub parse_arguments # Replace any double trailing slashes from end of mirror $self->{'mirror-url'} =~ s{//+$}{/}; + $self->{'module-subset'} =~ s/\bdefault\b/preview,essential,addon/; $self->{'module-subset'} = [ split(/,/, $self->{'module-subset'}) ]; return; @@ -272,6 +279,13 @@ sub git_submodule_init return; } +use constant { + STS_PREVIEW => 1, + STS_ESSENTIAL => 2, + STS_ADDON => 3, + STS_OBSOLETE => 4 +}; + sub git_clone_all_submodules { my ($self, $my_repo_base, $co_branch, @subset) = @_; @@ -296,8 +310,20 @@ sub git_clone_all_submodules $subbases{$mod} = $base; } elsif ($2 eq "update") { push @subset, '-'.$1 if ($3 eq 'none'); - } elsif ($2 eq "initrepo") { - $subinits{$1} = ($3 eq "yes" or $3 eq "true"); + } elsif ($2 eq "status") { + if ($3 eq "preview") { + $subinits{$1} = STS_PREVIEW; + } elsif ($3 eq "essential") { + $subinits{$1} = STS_ESSENTIAL; + } elsif ($3 eq "addon") { + $subinits{$1} = STS_ADDON; + } elsif ($3 eq "obsolete") { + $subinits{$1} = STS_OBSOLETE; + } elsif ($3 eq "ignore") { + delete $subinits{$1}; + } else { + die("Invalid subrepo status '$3' for '$1'.\n"); + } } } @@ -305,11 +331,21 @@ sub git_clone_all_submodules foreach my $mod (@subset) { if ($mod eq "all") { map { $include{$_} = 1; } keys %subbases; - } elsif ($mod eq "default") { - map { $include{$_} = 1; } grep { $subinits{$_} } keys %subbases; + } elsif ($mod eq "essential") { + map { $include{$_} = 1; } grep { ($subinits{$_} || 0) eq STS_ESSENTIAL } keys %subbases; + } elsif ($mod eq "addon") { + map { $include{$_} = 1; } grep { ($subinits{$_} || 0) eq STS_ADDON } keys %subbases; + } elsif ($mod eq "preview") { + map { $include{$_} = 1; } grep { ($subinits{$_} || 0) eq STS_PREVIEW } keys %subbases; + } elsif ($mod eq "obsolete") { + map { $include{$_} = 1; } grep { ($subinits{$_} || 0) eq STS_OBSOLETE } keys %subbases; } elsif ($mod =~ s/^-//) { + print "Warning: excluding non-existent module '$mod'.\n" + if (!defined($subdirs{$mod})); delete $include{$mod}; } else { + die("Error: module subset names non-existent '$mod'.\n") + if (!defined($subdirs{$mod})); $include{$mod} = 1; } } @@ -483,11 +519,16 @@ sub ensure_link return if (!$self->{'force-hooks'} and -f $tgt); unlink($tgt); # In case we have a dead symlink or pre-existing hook print "Aliasing $src\n as $tgt ...\n" if (!$self->{quiet}); - return if eval { symlink($src, $tgt) }; + if ($^O ne "msys" && $^O ne "MSWin32") { + return if eval { symlink($src, $tgt) }; + } # Windows doesn't do (proper) symlinks. As the post_commit script needs # them to locate itself, we write a forwarding script instead. open SCRIPT, ">".$tgt or die "Cannot create forwarding script $tgt: $!\n"; - print SCRIPT "#!/bin/sh\nexec `dirname \$0`/$src \"\$\@\"\n"; + # Make the path palatable for MSYS. + $src =~ s,\\,/,g; + $src =~ s,^(.):/,/$1/,g; + print SCRIPT "#!/bin/sh\nexec $src \"\$\@\"\n"; close SCRIPT; } @@ -495,19 +536,30 @@ sub git_install_hooks { my ($self) = @_; - return if (!-d 'qtrepotools/git-hooks'); - - # Force C locale as git submodule returns the localized string "Entering" - local $ENV{LC_ALL} = 'C'; - chomp(my @modules = `git submodule foreach :`); - push @modules, ""; - for my $module (@modules) { - $module =~ s,^Entering \'([^\']+)\'$,$1/,; - my $rel = $module; - $rel =~ s,[^/]+,..,g; - $rel .= "../../qtrepotools/git-hooks/"; - $self->ensure_link($rel.'gerrit_commit_msg_hook', $module.'.git/hooks/commit-msg'); - $self->ensure_link($rel.'git_post_commit_hook', $module.'.git/hooks/post-commit'); + my $hooks = $script_path.'/qtrepotools/git-hooks'; + return if (!-d $hooks); + + my @configresult = qx(git config --list --local); + foreach my $line (@configresult) { + next if ($line !~ /submodule\.([^.=]+)\.url=/); + my $module = $1.'/.git'; + if (!-d $module) { + open GITD, $module or die "Cannot open $module: $!\n"; + my $gd = <GITD>; + close GITD; + chomp($gd); + $gd =~ s/^gitdir: // or die "Malformed .git file $module\n"; + $module = $gd; # We expect it to be always absolute. + if (open COMD, $module.'/commondir') { + my $cd = <COMD>; + chomp($cd); + $module .= '/'.$cd; + $module = abs_path($module); + close COMD; + } + } + $self->ensure_link($hooks.'/gerrit_commit_msg_hook', $module.'/hooks/commit-msg'); + $self->ensure_link($hooks.'/git_post_commit_hook', $module.'/hooks/post-commit'); } } |