diff options
author | Simon Marlow <marlowsd@gmail.com> | 2011-06-30 15:30:21 +0100 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2011-07-01 09:01:48 +0100 |
commit | 566d1300059476334cf1f4a699dc14f3b98bac99 (patch) | |
tree | a46fcf465784dc72bade9671674bd066dca8e146 /sync-all | |
parent | a9256c75141b0b5ff616da9b5194267a72ae889c (diff) | |
download | haskell-566d1300059476334cf1f4a699dc14f3b98bac99.tar.gz |
support using local mirrors (created by git clone --mirror)
Diffstat (limited to 'sync-all')
-rwxr-xr-x | sync-all | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -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"; |