hg 602 B

123456789101112131415161718192021222324
  1. #!/usr/bin/env bash
  2. # We want to catch any unexpected failure, and exit immediately
  3. set -e
  4. # Download helper for hg, to be called from the download wrapper script
  5. # Expected arguments:
  6. # $1: output file
  7. # $2: hg repo
  8. # $3: hg cset
  9. # $4: package's basename (eg. foobar-1.2.3)
  10. # And this environment:
  11. # HG : the hg command to call
  12. output="${1}"
  13. repo="${2}"
  14. cset="${3}"
  15. basename="${4}"
  16. ${HG} clone --noupdate --rev "${cset}" "${repo}" "${basename}"
  17. ${HG} archive --repository "${basename}" --type tgz \
  18. --prefix "${basename}" --rev "${cset}" \
  19. "${output}"