path: root/support
diff options
authorGravatar Yann E. MORIN <yann.morin.1998@free.fr>2014-08-03 19:53:35 +0200
committerGravatar Thomas Petazzoni <thomas.petazzoni@free-electrons.com>2014-08-04 20:12:24 +0200
commitc48d45e3424e8ad7a1f320a66a4bebc7c056e052 (patch)
tree6e6505558f70de34d3079276bb4d7219b6758ba5 /support
parentb5a9470bdfeccb50170d279aedc541a2c665770c (diff)
support/download: convert bzr to use the wrapper
This drastically simplifies the bzr 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> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'support')
1 files changed, 12 insertions, 30 deletions
diff --git a/support/download/bzr b/support/download/bzr
index 19d837d305..b545cb112c 100755
--- a/support/download/bzr
+++ b/support/download/bzr
@@ -1,38 +1,20 @@
-# We want to catch any command failure, and exit immediately
+# We want to catch any unexpected failure, and exit immediately
set -e
-# Download helper for bzr
-# Call it with:
-# $1: bzr repo
-# $2: bzr revision
-# $3: output file
+# Download helper for bzr, to be called from the download wrapper script
+# Expected arguments:
+# $1: output file
+# $2: bzr repo
+# $3: bzr revision
+# $4: basename
# And this environment:
# BZR : the bzr command to call
-# BUILD_DIR: path to Buildroot's build dir
-tmp_dl="$( mktemp "${BUILD_DIR}/.XXXXXX" )"
-tmp_output="$( mktemp "${output}.XXXXXX" )"
-# Play tic-tac-toe with temp files
-# - first, we download to a trashable location (the build-dir)
-# - the we move to a temp file in the final location, so it is
-# on the same filesystem as the final file
-# - finally, we atomically rename to the final file
-if ${BZR} export --format=tgz "${tmp_dl}" "${repo}" -r "${rev}"; then
- if mv "${tmp_dl}" "${tmp_output}"; then
- mv "${tmp_output}" "${output}"
- ret=0
- fi
-# Cleanup
-rm -f "${tmp_dl}" "${tmp_output}"
-exit ${ret}
+${BZR} export --root="${basename}/" --format=tgz "${output}" "${repo}" -r "${rev}"