keep information about default repos in .gitmodules 95/92395/3
authorOswald Buddenhagen <oswald.buddenhagen@digia.com>
Fri, 15 Aug 2014 17:11:24 +0000 (19:11 +0200)
committerOswald Buddenhagen <oswald.buddenhagen@digia.com>
Tue, 23 Sep 2014 18:29:02 +0000 (20:29 +0200)
it's backwards to keep this in the script itself.

Change-Id: I4248ba3fef984bdff5d034cb2e6db6cae3209d68
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
.gitmodules
init-repository

index 1793289..81d528c 100644 (file)
@@ -1,51 +1,67 @@
 [submodule "qtbase"]
        path = qtbase
        url = ../qtbase.git
+       initrepo = true
 [submodule "qtsvg"]
        path = qtsvg
        url = ../qtsvg.git
+       initrepo = true
 [submodule "qtdeclarative"]
        path = qtdeclarative
        url = ../qtdeclarative.git
+       initrepo = true
 [submodule "qtactiveqt"]
        path = qtactiveqt
        url = ../qtactiveqt.git
+       initrepo = true
 [submodule "qtscript"]
        path = qtscript
        url = ../qtscript.git
+       initrepo = true
 [submodule "qtmultimedia"]
        path = qtmultimedia
        url = ../qtmultimedia.git
+       initrepo = true
 [submodule "qttools"]
        path = qttools
        url = ../qttools.git
+       initrepo = true
 [submodule "qtxmlpatterns"]
        path = qtxmlpatterns
        url = ../qtxmlpatterns.git
+       initrepo = true
 [submodule "qttranslations"]
        path = qttranslations
        url = ../qttranslations.git
+       initrepo = true
 [submodule "qtdoc"]
        path = qtdoc
        url = ../qtdoc.git
+       initrepo = true
 [submodule "qtrepotools"]
        path = qtrepotools
        url = ../qtrepotools.git
+       initrepo = true
 [submodule "qtwebkit"]
        path = qtwebkit
        url = ../qtwebkit.git
+       initrepo = true
 [submodule "qtwebkit-examples"]
        path = qtwebkit-examples
        url = ../qtwebkit-examples.git
+       initrepo = true
 [submodule "qtqa"]
        path = qtqa
        url = ../qtqa.git
+       initrepo = true
 [submodule "qtlocation"]
        path = qtlocation
        url = ../qtlocation.git
+       initrepo = true
 [submodule "qtsensors"]
        path = qtsensors
        url = ../qtsensors.git
+       initrepo = true
 [submodule "qtsystems"]
        path = qtsystems
        url = ../qtsystems.git
@@ -61,6 +77,7 @@
 [submodule "qtconnectivity"]
        path = qtconnectivity
        url = ../qtconnectivity.git
+       initrepo = true
 [submodule "qtwayland"]
        path = qtwayland
        url = ../qtwayland.git
 [submodule "qtimageformats"]
        path = qtimageformats
        url = ../qtimageformats.git
+       initrepo = true
 [submodule "qtquick1"]
        path = qtquick1
        url = ../qtquick1.git
 [submodule "qtgraphicaleffects"]
        path = qtgraphicaleffects
        url = ../qtgraphicaleffects.git
+       initrepo = true
 [submodule "qtquickcontrols"]
        path = qtquickcontrols
        url = ../qtquickcontrols.git
+       initrepo = true
 [submodule "qtserialport"]
        path = qtserialport
        url = ../qtserialport.git
+       initrepo = true
 [submodule "qtx11extras"]
        path = qtx11extras
        url = ../qtx11extras.git
+       initrepo = true
 [submodule "qtmacextras"]
        path = qtmacextras
        url = ../qtmacextras.git
+       initrepo = true
 [submodule "qtwinextras"]
        path = qtwinextras
        url = ../qtwinextras.git
+       initrepo = true
 [submodule "qtandroidextras"]
        path = qtandroidextras
        url = ../qtandroidextras.git
+       initrepo = true
 [submodule "qtenginio"]
        path = qtenginio
        url = ../qtenginio.git
+       initrepo = true
 [submodule "qtwebsockets"]
        path = qtwebsockets
        url = ../qtwebsockets.git
+       initrepo = true
 [submodule "qtwebchannel"]
        path = qtwebchannel
        url = ../qtwebchannel.git
+       initrepo = true
 [submodule "qtwebengine"]
        path = qtwebengine
        url = ../qtwebengine.git
+       initrepo = true
index 985d042..4eaeb17 100755 (executable)
@@ -191,40 +191,6 @@ use Getopt::Long qw( GetOptionsFromArray );
 use Pod::Usage   qw( pod2usage           );
 use Cwd          qw( getcwd              );
 
-my @DEFAULT_REPOS = qw(
-    qtactiveqt
-    qtandroidextras
-    qtbase
-    qtconnectivity
-    qtdeclarative
-    qtdoc
-    qtenginio
-    qtgraphicaleffects
-    qtimageformats
-    qtmacextras
-    qtmultimedia
-    qtqa
-    qtquick1
-    qtquickcontrols
-    qtlocation
-    qtrepotools
-    qtscript
-    qtsensors
-    qtserialport
-    qtsvg
-    qttools
-    qttranslations
-    qtwayland
-    qtwebchannel
-    qtwebengine
-    qtwebsockets
-    qtwebkit
-    qtwebkit-examples
-    qtwinextras
-    qtx11extras
-    qtxmlpatterns
-);
-
 my $GERRIT_SSH_BASE
     = 'ssh://@USER@codereview.qt-project.org@PORT@/';
 
@@ -304,8 +270,7 @@ sub parse_arguments
     # Replace any double trailing slashes from end of mirror
     $self->{'mirror-url'} =~ s{//+$}{/};
 
-    $self->{'module-subset'} = [ map { $_ eq "default" ? (@DEFAULT_REPOS) : ($_) }
-                                     split(/,/, $self->{'module-subset'}) ];
+    $self->{'module-subset'} = [ split(/,/, $self->{'module-subset'}) ];
     if (!$self->{webkit}) {
         push @{$self->{'module-subset'}}, "-qtwebkit", "-qtwebkit-examples";
     }
@@ -362,6 +327,7 @@ sub git_clone_all_submodules
 
     my %subdirs = ();
     my %subbases = ();
+    my %subinits = ();
     my @submodconfig = qx(git config -l -f .gitmodules);
     foreach my $line (@submodconfig) {
         # Example line: submodule.qtqa.url=../qtqa.git
@@ -376,6 +342,8 @@ sub git_clone_all_submodules
             $subbases{$mod} = $base;
         } elsif ($2 eq "update") {
             push @subset, '-'.$1 if ($3 eq 'ignore');
+        } elsif ($2 eq "initrepo") {
+            $subinits{$1} = ($3 eq "yes" or $3 eq "true");
         }
     }
 
@@ -383,6 +351,8 @@ 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 =~ s/^-//) {
             delete $include{$mod};
         } else {