fetchdarcs: add {pre,post}Fetch hooks (#469215)
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
runHook preFetch
|
||||
|
||||
tagtext=""
|
||||
tagflags=""
|
||||
# Darcs hashes are sha1 (120 bits, 40-character hex)
|
||||
@@ -15,16 +17,22 @@ fi
|
||||
# Repository list may contain ?. No glob expansion for that.
|
||||
set -o noglob
|
||||
|
||||
success=
|
||||
for repository in $repositories; do
|
||||
echo "Trying to clone $repository $tagtext into $out …"
|
||||
if darcs clone --lazy $tagflags "$repository" "$out"; then
|
||||
# remove metadata, because it can change
|
||||
rm -rf "$out/_darcs"
|
||||
exit 0
|
||||
success=1
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
set +o noglob
|
||||
|
||||
echo "Error: couldn’t clone repository from any mirror" 1>&2
|
||||
exit 1
|
||||
if [ -z "$success" ]; then
|
||||
echo "Error: couldn’t clone repository from any mirror" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
runHook postFetch
|
||||
|
||||
Reference in New Issue
Block a user