diff options
author | Ian Lynagh <ian@well-typed.com> | 2012-11-25 18:27:40 +0000 |
---|---|---|
committer | Ian Lynagh <ian@well-typed.com> | 2012-11-25 18:27:40 +0000 |
commit | f73d60bee5154777eb2515c0df806ddc928f874f (patch) | |
tree | 91900923eaf1beb59d1674f0089a1b6f9fcbfc85 /sync-all | |
parent | 948f101d80d0a7fef3ee2bd644502c00f29865fb (diff) | |
download | haskell-f73d60bee5154777eb2515c0df806ddc928f874f.tar.gz |
Use submodules for repositories with upstreams
Diffstat (limited to 'sync-all')
-rwxr-xr-x | sync-all | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -117,6 +117,16 @@ sub parsePackages { } } +sub tryReadFile { + my $filename = shift; + my @lines; + + open (FH, $filename) or return ""; + @lines = <FH>; + close FH; + return join('', @lines); +} + sub message { if ($verbose >= 2) { print "@_\n"; @@ -751,6 +761,14 @@ sub main { } scmall ($command, @_); + + if ($command eq "get" or $command eq "pull") { + my $gitConfig = &tryReadFile(".git/config"); + if ($gitConfig !~ /submodule/) { + &scm(".", "git", "submodule", "init"); + } + &scm(".", "git", "submodule", "update"); + } } } |