summaryrefslogtreecommitdiff
path: root/sync-all
diff options
context:
space:
mode:
authorIan Lynagh <ian@well-typed.com>2012-11-25 18:27:40 +0000
committerIan Lynagh <ian@well-typed.com>2012-11-25 18:27:40 +0000
commitf73d60bee5154777eb2515c0df806ddc928f874f (patch)
tree91900923eaf1beb59d1674f0089a1b6f9fcbfc85 /sync-all
parent948f101d80d0a7fef3ee2bd644502c00f29865fb (diff)
downloadhaskell-f73d60bee5154777eb2515c0df806ddc928f874f.tar.gz
Use submodules for repositories with upstreams
Diffstat (limited to 'sync-all')
-rwxr-xr-xsync-all18
1 files changed, 18 insertions, 0 deletions
diff --git a/sync-all b/sync-all
index fd60446d87..4f7e76700c 100755
--- a/sync-all
+++ b/sync-all
@@ -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");
+ }
}
}