Merge branch 'ticket-5028'
authorIan Lynagh <igloo@earth.li>
Fri, 1 Apr 2011 14:30:33 +0000 (15:30 +0100)
committerIan Lynagh <igloo@earth.li>
Fri, 1 Apr 2011 14:30:33 +0000 (15:30 +0100)
.gitignore
bindisttest/ghc.mk
packages
sync-all [changed mode: 0644->0755]
validate [changed mode: 0644->0755]

index 44a3b95..37885b1 100644 (file)
@@ -48,6 +48,7 @@ configure
 /libraries/haskeline/
 /libraries/haskell2010/
 /libraries/haskell98/
+/libraries/hoopl/
 /libraries/hpc/
 /libraries/integer-gmp/
 /libraries/integer-simple/
index a3e97b0..e051be0 100644 (file)
@@ -19,7 +19,7 @@ endif
 .PHONY: test_bindist
 test_bindist:
        "$(RM)" $(RM_OPTS_REC) bindisttest/$(BIN_DIST_INST_SUBDIR)
-       "$(RM)" $(RM_OPTS_REC) bindisttest/a/b/c/*
+       "$(RM)" $(RM_OPTS_REC) bindisttest/a
        "$(RM)" $(RM_OPTS) bindisttest/HelloWorld
        "$(RM)" $(RM_OPTS) bindisttest/HelloWorld.o
        "$(RM)" $(RM_OPTS) bindisttest/HelloWorld.hi
@@ -30,6 +30,9 @@ test_bindist:
 # NB. tar has funny interpretation of filenames sometimes (thinking
 # c:/foo is a remote file), so it's safer to bzip and then pipe into
 # tar rather than using tar -xjf:
+       mkdir bindisttest/a
+       mkdir bindisttest/a/b
+       mkdir bindisttest/a/b/c
        cd bindisttest/a/b/c/ && $(BZIP2_CMD) -cd ../../../../$(BIN_DIST_TEST_TAR_BZ2) | $(TAR_CMD) -xf -
        $(SHELL) bindisttest/checkBinaries.sh $(ProjectVersion)
 ifeq "$(Windows)" "YES"
index 95ecff1..9720329 100644 (file)
--- a/packages
+++ b/packages
 #     "-" if there is no upstream.
 #
 # Lines that start with a '#' are comments.
-.                               -           ghc                             git     -
-ghc-tarballs                    -           ghc-tarballs                    darcs   -
-utils/hsc2hs                    -           hsc2hs                          darcs   -
+.                               -           ghc.git                             git   -
+ghc-tarballs                    -           ghc-tarballs.git                    git   -
+utils/hsc2hs                    -           hsc2hs.git                          git   -
 # haddock does have an upstream:
 #   http://code.haskell.org/haddock/
 # but it stays buildable with the last stable release rather than tracking HEAD,
 # and is resynced with the GHC HEAD branch by David Waern when appropriate
-utils/haddock                   -           haddock2                        darcs   -
-libraries/array                 -           packages/array                  darcs   -
-libraries/base                  -           packages/base                   darcs   -
-libraries/binary                -           packages/binary                 darcs   http://code.haskell.org/binary/
-libraries/bytestring            -           packages/bytestring             darcs   http://darcs.haskell.org/bytestring/
-libraries/Cabal                 -           packages/Cabal                  darcs   http://darcs.haskell.org/cabal/
-libraries/containers            -           packages/containers             darcs   -
-libraries/directory             -           packages/directory              darcs   -
-libraries/extensible-exceptions -           packages/extensible-exceptions  darcs   -
-libraries/filepath              -           packages/filepath               darcs   -
-libraries/ghc-prim              -           packages/ghc-prim               darcs   -
-libraries/haskeline             -           packages/haskeline              darcs   http://code.haskell.org/haskeline/
-libraries/haskell98             -           packages/haskell98              darcs   -
-libraries/haskell2010           -           packages/haskell2010            darcs   -
-libraries/hoopl                 -           packages/hoopl                  darcs   -
-libraries/hpc                   -           packages/hpc                    darcs   -
-libraries/integer-gmp           -           packages/integer-gmp            darcs   -
-libraries/integer-simple        -           packages/integer-simple         darcs   -
-libraries/mtl                   -           packages/mtl                    darcs   -
-libraries/old-locale            -           packages/old-locale             darcs   -
-libraries/old-time              -           packages/old-time               darcs   -
-libraries/pretty                -           packages/pretty                 darcs   -
-libraries/process               -           packages/process                darcs   -
-libraries/random                -           packages/random                 darcs   -
-libraries/template-haskell      -           packages/template-haskell       darcs   -
-libraries/terminfo              -           packages/terminfo               darcs   http://code.haskell.org/terminfo/
-libraries/unix                  -           packages/unix                   darcs   -
-libraries/utf8-string           -           packages/utf8-string            darcs   http://code.haskell.org/utf8-string/
-libraries/Win32                 -           packages/Win32                  darcs   -
-libraries/xhtml                 -           packages/xhtml                  darcs   -
-testsuite                       testsuite   testsuite                       darcs   -
-nofib                           nofib       nofib                           darcs   -
-libraries/deepseq               extra       packages/deepseq                darcs   -
-libraries/parallel              extra       packages/parallel               darcs   -
-libraries/stm                   extra       packages/stm                    darcs   -
-libraries/primitive             dph         packages/primitive              darcs   http://code.haskell.org/primitive
-libraries/vector                dph         packages/vector                 darcs   http://code.haskell.org/vector
-libraries/dph                   dph         packages/dph                    darcs   -
+utils/haddock                   -           haddock2.git                        git   -
+libraries/array                 -           packages/array.git                  git   -
+libraries/base                  -           packages/base.git                   git   -
+libraries/binary                -           packages/binary.git                 git   http://code.haskell.org/binary/
+libraries/bytestring            -           packages/bytestring.git             git   http://darcs.haskell.org/bytestring/
+libraries/Cabal                 -           packages/Cabal.git                  git   http://darcs.haskell.org/cabal/
+libraries/containers            -           packages/containers.git             git   -
+libraries/directory             -           packages/directory.git              git   -
+libraries/extensible-exceptions -           packages/extensible-exceptions.git  git   -
+libraries/filepath              -           packages/filepath.git               git   -
+libraries/ghc-prim              -           packages/ghc-prim.git               git   -
+libraries/haskeline             -           packages/haskeline.git              git   http://code.haskell.org/haskeline/
+libraries/haskell98             -           packages/haskell98.git              git   -
+libraries/haskell2010           -           packages/haskell2010.git            git   -
+libraries/hoopl                 -           packages/hoopl.git                  git   -
+libraries/hpc                   -           packages/hpc.git                    git   -
+libraries/integer-gmp           -           packages/integer-gmp.git            git   -
+libraries/integer-simple        -           packages/integer-simple.git         git   -
+libraries/mtl                   -           packages/mtl.git                    git   -
+libraries/old-locale            -           packages/old-locale.git             git   -
+libraries/old-time              -           packages/old-time.git               git   -
+libraries/pretty                -           packages/pretty.git                 git   -
+libraries/process               -           packages/process.git                git   -
+libraries/random                -           packages/random.git                 git   -
+libraries/template-haskell      -           packages/template-haskell.git       git   -
+libraries/terminfo              -           packages/terminfo.git               git   http://code.haskell.org/terminfo/
+libraries/unix                  -           packages/unix.git                   git   -
+libraries/utf8-string           -           packages/utf8-string.git            git   http://code.haskell.org/utf8-string/
+libraries/Win32                 -           packages/Win32.git                  git   -
+libraries/xhtml                 -           packages/xhtml.git                  git   -
+testsuite                       testsuite   testsuite.git                       git   -
+nofib                           nofib       nofib.git                           git   -
+libraries/deepseq               extra       packages/deepseq.git                git   -
+libraries/parallel              extra       packages/parallel.git               git   -
+libraries/stm                   extra       packages/stm.git                    git   -
+libraries/primitive             dph         packages/primitive.git              git   http://code.haskell.org/primitive
+libraries/vector                dph         packages/vector.git                 git   http://code.haskell.org/vector
+libraries/dph                   dph         packages/dph.git                    git   -
old mode 100644 (file)
new mode 100755 (executable)
index cfc44ea..7bb8016
--- a/sync-all
+++ b/sync-all
@@ -79,7 +79,7 @@ sub parsePackages {
     my @repos;
     my $lineNum;
 
-    open IN, "< packages.git" or die "Can't open packages file";
+    open IN, "< packages" or die "Can't open packages file";
     @repos = <IN>;
     close IN;
 
@@ -116,12 +116,25 @@ sub warning {
 }
 
 sub scm {
+    my $dir = shift;
     my $scm = shift;
-    
-    message "== running $scm @_";
+    my $pwd;
+
+    if ($dir eq '.') {
+        message "== running $scm @_";
+    } else {
+        message "== $dir: running $scm @_";
+        $pwd = getcwd();
+        chdir($dir);
+    }
+
     system ($scm, @_) == 0
         or $ignore_failure
         or die "$scm failed: $?";
+
+    if ($dir ne '.') {
+        chdir($pwd);
+    }
 }
 
 sub repoexists {
@@ -150,6 +163,8 @@ sub scmall {
 
     my @scm_args;
 
+    my $pwd;
+
     my ($repo_base, $checked_out_tree) = getrepo();
 
     parsePackages;
@@ -223,6 +238,9 @@ sub scmall {
                           or ($scm eq "git" and "send-email"));
                 $want_remote_repo = 1;
             }
+            elsif ($command =~ /^set-origin$/) {
+                @scm_args = ("remote", "set-url", "origin", $path);
+            }
             else {
                 die "Unknown command: $command";
             }
@@ -231,19 +249,20 @@ sub scmall {
             if (repoexists ($scm, $localpath)) {
                 if ($want_remote_repo) {
                     if ($scm eq "darcs") {
-                        scm ($scm, @scm_args, @_, "--repodir=$localpath", $path);
+                        scm (".", $scm, @scm_args, @_, "--repodir=$localpath", $path);
                     } else {
                         # git pull doesn't like to be used with --work-dir
-                        scm ($scm, "--git-dir=$localpath/.git", @scm_args, @_, $path, "master");
+                        # I couldn't find an alternative to chdir() here
+                        scm ($localpath, $scm, @scm_args, @_, $path, "master");
                     }
                 } else {
                     # git status *must* be used with --work-dir, if we don't chdir() to the dir
-                    scm ($scm, "--git-dir=$localpath/.git", "--work-tree=$localpath", @scm_args, @_);
+                    scm ($localpath, $scm, @scm_args, @_);
                 }
             }
             elsif ($local_repo_unnecessary) {
                 # Don't bother to change directory in this case
-                scm ($scm, @scm_args, @_);
+                scm (".", $scm, @scm_args, @_);
             }
             elsif ($tag eq "") {
                 message "== Required repo $localpath is missing! Skipping";
@@ -315,6 +334,7 @@ Supported commands:
   * --complete
   * --partial
  * send
+ * set-origin
 
 Available package-tags are:
 END
old mode 100644 (file)
new mode 100755 (executable)