File tree Expand file tree Collapse file tree 2 files changed +21
-5
lines changed
pkgs/build-support/fetchdarcs Expand file tree Collapse file tree 2 files changed +21
-5
lines changed Original file line number Diff line number Diff line change @@ -14,8 +14,19 @@ elif test -n "$context"; then
1414 tagflags=" --context=$context "
1515fi
1616
17- echo " Cloning $url ${tagtext} into $out "
17+ # Repository list may contain ?. No glob expansion for that.
18+ set -o noglob
1819
19- darcs clone --lazy $tagflags " $url " " $out "
20- # remove metadata, because it can change
21- rm -rf " $out /_darcs"
20+ for repository in $repositories ; do
21+ echo " Trying to clone $repository $tagtext into $out …"
22+ if darcs clone --lazy $tagflags " $repository " " $out " ; then
23+ # remove metadata, because it can change
24+ rm -rf " $out /_darcs"
25+ exit 0
26+ fi
27+ done
28+
29+ set +o noglob
30+
31+ echo " Error: couldn’t clone repository from any mirror" 1>&2
32+ exit 1
Original file line number Diff line number Diff line change 88lib . makeOverridable (
99 lib . fetchers . withNormalizedHash { } (
1010 {
11+ # Repository to fetch
1112 url ,
13+ # Additional list of repositories specifying alternative download
14+ # location to be tried in order, if the prior repository failed to fetch.
15+ mirrors ? [ ] ,
1216 rev ? null ,
1317 context ? null ,
1418 outputHash ? lib . fakeHash ,
@@ -27,11 +31,12 @@ lib.makeOverridable (
2731 outputHashMode = "recursive" ;
2832
2933 inherit
30- url
3134 rev
3235 context
3336 name
3437 ;
38+
39+ repositories = [ url ] ++ mirrors ;
3540 }
3641 )
3742)
You can’t perform that action at this time.
0 commit comments