diff options
author | Marius Storm-Olsen <marius.storm-olsen@nokia.com> | 2011-05-04 14:44:57 -0500 |
---|---|---|
committer | Marius Storm-Olsen <marius.storm-olsen@nokia.com> | 2011-05-05 10:38:53 -0500 |
commit | 74f6b9fc6179da1594bf55eb6d6e71b5f4c02d51 (patch) | |
tree | e038c8829f19d9cc232cd68be51880b80a361b09 /init-repository | |
parent | c2819f45a28f6ae9be91d85795062b2bd2dfb04d (diff) |
Add -alternates option
Reviewed-by: axis
Diffstat (limited to 'init-repository')
-rwxr-xr-x | init-repository | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/init-repository b/init-repository index 79ca4ac9..e23d047d 100755 --- a/init-repository +++ b/init-repository @@ -50,6 +50,7 @@ my $brisbane_mirror = 0; my $no_webkit = 0; my $no_update = 0; my $ignore_submodules = 0; +my $alternates = ""; my $protocol = ""; my %protocols = ( @@ -92,6 +93,15 @@ sub printUsage print(" servers used. (Implies -nokia-developer!)\n"); print(" -http Use HTTP protocol, for restrictive firewalls. Note that this\n"); print(" only works with the external Gitorious server.\n"); + print(" -alternates=<path to other Qt5 repo>\n"); + print(" Adds alternates for each submodule to another full qt5\n"); + print(" checkout. This makes this qt5 checkout very small, as it\n"); + print(" will use the object store of the alternates before unique\n"); + print(" objects are stored in its own object store.\n"); + print(" PS: This option does not work with -no-update!\n"); + print(" PSS:This will make this repo dependent on the alternate!\n"); + print(" The dependency can be broken by running 'git repack -a'\n"); + print(" in each submodule, where required.\n"); } while (@ARGV) { @@ -123,6 +133,8 @@ while (@ARGV) { $no_update = 1; } elsif ($arg eq "-ignore-submodules") { $ignore_submodules = 1; + } elsif ($arg =~ /-alternates=(.*)/) { + $alternates = "$1" } else { print("*** Unknown option: $arg\n"); printUsage(); @@ -176,6 +188,28 @@ foreach (@configresult) { } } +# manually clone each repo here, so we can easily use reference repos, mirrors and add all staging +# repos +if (!$no_update) { + @configresult = `git config -l`; + foreach (@configresult) { + if(/submodule\.([^.=]+)\.url=(.*)/){ + my $repo = $1; + my $url = $2; + my $ref = ""; + if ($alternates) { + if (-d "$alternates/$repo") { + $ref = "--reference $alternates/$repo"; + } else { + print(" *** $alternates/$repo not found, ignoring alternate for this submodule\n"); + } + } + system_v("git clone $ref $url $repo"); + } + } +} + + if ($nokia_developer) { if ($brisbane_mirror) { my $mirror_url = "git://bq-git.apac.nokia.com/qtsoftware/qt/"; |