diff options
| author | Yann E. MORIN <yann.morin.1998@free.fr> | 2014-07-02 23:11:22 +0200 |
|---|---|---|
| committer | Peter Korsgaard <peter@korsgaard.com> | 2014-07-02 23:59:10 +0200 |
| commit | 2fd4b959bd8b8e9d8657de9f458215ecd3b9d072 (patch) | |
| tree | 3d5c998d23e67e055fa60bef25835aeb00de5626 /support | |
| parent | f4526c053f700cad5783476e009173827e803f56 (diff) | |
| download | buildroot-2fd4b959bd8b8e9d8657de9f458215ecd3b9d072.tar.gz buildroot-2fd4b959bd8b8e9d8657de9f458215ecd3b9d072.zip | |
pkg-infra: move the hg download helper to a script
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>
Diffstat (limited to 'support')
| -rwxr-xr-x | support/download/hg | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/support/download/hg b/support/download/hg new file mode 100755 index 0000000000..d2e69c35ff --- /dev/null +++ b/support/download/hg @@ -0,0 +1,25 @@ +#!/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}" |

