[commit: ghc] ghc-7.2: support using local mirrors (created by git clone --mirror) (b6a276d)
Ian Lynagh
igloo at earth.li
Tue Jul 5 17:28:01 CEST 2011
Repository : ssh://darcs.haskell.org//srv/darcs/ghc
On branch : ghc-7.2
http://hackage.haskell.org/trac/ghc/changeset/b6a276df7e1293cf46eadf421b210a2f15e54466
>---------------------------------------------------------------
commit b6a276df7e1293cf46eadf421b210a2f15e54466
Author: Simon Marlow <marlowsd at gmail.com>
Date: Thu Jun 30 15:30:21 2011 +0100
support using local mirrors (created by git clone --mirror)
>---------------------------------------------------------------
sync-all | 13 +++++++++++--
1 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/sync-all b/sync-all
index dba59be..cfa475d 100755
--- a/sync-all
+++ b/sync-all
@@ -118,9 +118,18 @@ sub getrepo {
}
elsif ($repo =~ /^\/|\.\.\/|.:(\/|\\)/) {
# Local filesystem, either absolute or relative path
- # (assumes a checked-out tree):
$repo_base = $repo;
- $checked_out_tree = 1;
+ if (-f "$repo/HEAD") {
+ # assume a local mirror:
+ $checked_out_tree = 0;
+ $repo_base =~ s#/[^/]+/?$##;
+ } elsif (-d "$repo/ghc.git") {
+ # assume a local mirror:
+ $checked_out_tree = 0;
+ } else {
+ # assume a checked-out tree:
+ $checked_out_tree = 1;
+ }
}
else {
die "Couldn't work out repo";
More information about the Cvs-ghc
mailing list