File tree Expand file tree Collapse file tree 1 file changed +25
-7
lines changed
pkgs/build-support/fetchpijul Expand file tree Collapse file tree 1 file changed +25
-7
lines changed Original file line number Diff line number Diff line change 77
88lib . makeOverridable (
99 {
10+ # Remote to fetch
1011 url ,
12+ # Additional list of remotes specifying alternative download location to be
13+ # tried in order, if the prior remote failed to fetch.
14+ mirrors ? [ ] ,
1115 hash ? "" ,
1216 change ? null ,
1317 state ? null ,
@@ -36,12 +40,25 @@ lib.makeOverridable (
3640 installPhase = ''
3741 runHook preInstall
3842
39- pijul clone \
40- '' ${change:+--change "$change"} \
41- '' ${state:+--state "$state"} \
42- --channel "$channel" \
43- "$url" \
44- "$out"
43+ success=
44+ for remote in $remotes; do
45+ if
46+ pijul clone \
47+ '' ${change:+--change "$change"} \
48+ '' ${state:+--state "$state"} \
49+ --channel "$channel" \
50+ "$remote" \
51+ "$out"
52+ then
53+ success=1
54+ break
55+ fi
56+ done
57+
58+ if [ -z "$success" ]; then
59+ echo "Error: couldn’t clone remote from any mirror" 1>&2
60+ exit 1
61+ fi
4562
4663 runHook postInstall
4764 '' ;
@@ -59,12 +76,13 @@ lib.makeOverridable (
5976 outputHash = if hash != "" then hash else lib . fakeHash ;
6077
6178 inherit
62- url
6379 change
6480 state
6581 channel
6682 ;
6783
84+ remotes = [ url ] ++ mirrors ;
85+
6886 impureEnvVars = lib . fetchers . proxyImpureEnvVars ;
6987 }
7088)
You can’t perform that action at this time.
0 commit comments