Use submodules for repositories with upstreams
authorIan Lynagh <ian@well-typed.com>
Sun, 25 Nov 2012 18:27:40 +0000 (18:27 +0000)
committerIan Lynagh <ian@well-typed.com>
Sun, 25 Nov 2012 18:27:40 +0000 (18:27 +0000)
15 files changed:
.gitignore
.gitmodules [new file with mode: 0644]
libraries/Cabal [new submodule]
libraries/Win32 [new submodule]
libraries/binary [new submodule]
libraries/bytestring [new submodule]
libraries/containers [new submodule]
libraries/haskeline [new submodule]
libraries/pretty [new submodule]
libraries/primitive [new submodule]
libraries/terminfo [new submodule]
libraries/transformers [new submodule]
libraries/vector [new submodule]
libraries/xhtml [new submodule]
sync-all

index baf85fa..913e2d1 100644 (file)
@@ -43,20 +43,14 @@ _darcs/
 # sub-repositories
 
 /ghc-tarballs/
-/libraries/Cabal/
-/libraries/Win32/
 /libraries/array/
 /libraries/base/
-/libraries/binary/
-/libraries/bytestring/
-/libraries/containers/
 /libraries/deepseq/
 /libraries/directory/
 /libraries/dph/
 /libraries/extensible-exceptions/
 /libraries/filepath/
 /libraries/ghc-prim/
-/libraries/haskeline/
 /libraries/haskell2010/
 /libraries/haskell98/
 /libraries/hoopl/
@@ -67,18 +61,12 @@ _darcs/
 /libraries/old-locale/
 /libraries/old-time/
 /libraries/parallel/
-/libraries/pretty/
-/libraries/primitive/
 /libraries/process/
 /libraries/random/
 /libraries/stm/
 /libraries/template-haskell/
-/libraries/terminfo/
-/libraries/transformers
 /libraries/unix/
 /libraries/utf8-string/
-/libraries/vector/
-/libraries/xhtml/
 /nofib/
 /testsuite/
 /utils/haddock/
diff --git a/.gitmodules b/.gitmodules
new file mode 100644 (file)
index 0000000..d73487a
--- /dev/null
@@ -0,0 +1,36 @@
+[submodule "libraries/binary"]
+       path = libraries/binary
+       url = http://darcs.haskell.org/libraries/binary.git/
+[submodule "libraries/bytestring"]
+       path = libraries/bytestring
+       url = http://darcs.haskell.org/libraries/bytestring.git/
+[submodule "libraries/Cabal"]
+       path = libraries/Cabal
+       url = http://darcs.haskell.org/libraries/Cabal.git/
+[submodule "libraries/containers"]
+       path = libraries/containers
+       url = http://darcs.haskell.org/libraries/containers.git/
+[submodule "libraries/haskeline"]
+       path = libraries/haskeline
+       url = http://darcs.haskell.org/libraries/haskeline.git/
+[submodule "libraries/pretty"]
+       path = libraries/pretty
+       url = http://darcs.haskell.org/libraries/pretty.git/
+[submodule "libraries/terminfo"]
+       path = libraries/terminfo
+       url = http://darcs.haskell.org/libraries/terminfo.git/
+[submodule "libraries/transformers"]
+       path = libraries/transformers
+       url = http://darcs.haskell.org/libraries/transformers.git/
+[submodule "libraries/xhtml"]
+       path = libraries/xhtml
+       url = http://darcs.haskell.org/libraries/xhtml.git/
+[submodule "libraries/Win32"]
+       path = libraries/Win32
+       url = http://darcs.haskell.org/libraries/Win32.git/
+[submodule "libraries/primitive"]
+       path = libraries/primitive
+       url = http://darcs.haskell.org/libraries/primitive.git/
+[submodule "libraries/vector"]
+       path = libraries/vector
+       url = http://darcs.haskell.org/libraries/vector.git/
diff --git a/libraries/Cabal b/libraries/Cabal
new file mode 160000 (submodule)
index 0000000..532e349
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit 532e349ec6ee33fc3477137b44f108d3658d0528
diff --git a/libraries/Win32 b/libraries/Win32
new file mode 160000 (submodule)
index 0000000..21335a3
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit 21335a30161c099da79ae9619c9782e5e32e4644
diff --git a/libraries/binary b/libraries/binary
new file mode 160000 (submodule)
index 0000000..2d31cea
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit 2d31cea238d0d08885c457475fc354dbf2b88976
diff --git a/libraries/bytestring b/libraries/bytestring
new file mode 160000 (submodule)
index 0000000..6bd69fe
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit 6bd69fe27af33e878e38f4c579983f6a23120a87
diff --git a/libraries/containers b/libraries/containers
new file mode 160000 (submodule)
index 0000000..a9b7224
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit a9b7224068ae60f73baacd5f76d2c27624d90120
diff --git a/libraries/haskeline b/libraries/haskeline
new file mode 160000 (submodule)
index 0000000..9ad0092
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit 9ad00926f832f4e5f5d38c8fe84bfc85f4e8f728
diff --git a/libraries/pretty b/libraries/pretty
new file mode 160000 (submodule)
index 0000000..ab7e8d9
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit ab7e8d91470bb94c9e184dffbec89d0aae116f9b
diff --git a/libraries/primitive b/libraries/primitive
new file mode 160000 (submodule)
index 0000000..75c3379
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit 75c3379b6d76e914cc3c7ffd290b6b1cad7ea3e6
diff --git a/libraries/terminfo b/libraries/terminfo
new file mode 160000 (submodule)
index 0000000..579d2c3
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit 579d2c324e69856ff8d1ea8b5036e30c920e1973
diff --git a/libraries/transformers b/libraries/transformers
new file mode 160000 (submodule)
index 0000000..a59fb93
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit a59fb93860f84ccd44178dcbbb82cfea7e02cd07
diff --git a/libraries/vector b/libraries/vector
new file mode 160000 (submodule)
index 0000000..c4c5a74
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit c4c5a740ec977a4300449bc85f4707ec641be923
diff --git a/libraries/xhtml b/libraries/xhtml
new file mode 160000 (submodule)
index 0000000..fb9e0bb
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit fb9e0bbb69e15873682a9f25d39652099a3ccac1
index fd60446..4f7e767 100755 (executable)
--- 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");
+        }
     }
 }