Maintaining the download helpers in the Makefile has proved to be a bit complex, so move it to a shell script. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Reviewed-by: Samuel Martin <s.martin49@gmail.com> Tested-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com> [tested a particular scenario that used to fail, when the 'hg archive' step is interrupted, now working fine] Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
26 lines
611 B
Bash
Executable File
26 lines
611 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# We want to catch any command failure, and exit immediately
|
|
set -e
|
|
|
|
# Download helper for hg
|
|
# Call it with:
|
|
# $1: hg repo
|
|
# $2: hg cset
|
|
# $3: package's basename (eg. foobar-1.2.3)
|
|
# $4: output file
|
|
# And this environment:
|
|
# HG : the hg command to call
|
|
# BR2_DL_DIR: path to Buildroot's download dir
|
|
|
|
repo="${1}"
|
|
cset="${2}"
|
|
basename="${3}"
|
|
output="${4}"
|
|
|
|
cd "${BR2_DL_DIR}"
|
|
${HG} clone --noupdate --rev "${cset}" "${repo}" "${basename}"
|
|
${HG} archive --repository "${basename}" --type tgz --prefix "${basename}" \
|
|
--rev "${cset}" "${output}"
|
|
rm -rf "${basename}"
|