buildrootschalter/support/download/hg
Yann E. MORIN 93e678b767 support/download: convert Hg to use the wrapper
This drastically simplifies the hg helper, as it no longer has to deal
with atomically saving the downloaded archive.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Tested-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
(Tested by running 'make vim-source')
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-08-04 20:12:24 +02:00

25 lines
594 B
Bash
Executable File

#!/bin/bash
# We want to catch any unexpected failure, and exit immediately
set -e
# Download helper for hg, to be called from the download wrapper script
# Expected arguments:
# $1: output file
# $2: hg repo
# $3: hg cset
# $4: package's basename (eg. foobar-1.2.3)
# And this environment:
# HG : the hg command to call
output="${1}"
repo="${2}"
cset="${3}"
basename="${4}"
${HG} clone --noupdate --rev "${cset}" "${repo}" "${basename}"
${HG} archive --repository "${basename}" --type tgz \
--prefix "${basename}" --rev "${cset}" \
"${output}"