summaryrefslogtreecommitdiff
path: root/sync-all
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2011-06-30 15:30:21 +0100
committerSimon Marlow <marlowsd@gmail.com>2011-07-01 09:01:48 +0100
commit566d1300059476334cf1f4a699dc14f3b98bac99 (patch)
treea46fcf465784dc72bade9671674bd066dca8e146 /sync-all
parenta9256c75141b0b5ff616da9b5194267a72ae889c (diff)
downloadhaskell-566d1300059476334cf1f4a699dc14f3b98bac99.tar.gz
support using local mirrors (created by git clone --mirror)
Diffstat (limited to 'sync-all')
-rwxr-xr-xsync-all13
1 files changed, 11 insertions, 2 deletions
diff --git a/sync-all b/sync-all
index 44da3d75ed..d0fac97594 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";