diff options
author | Michael Olbrich <m.olbrich@pengutronix.de> | 2015-06-16 14:58:14 +0200 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2015-06-16 15:16:55 +0200 |
commit | d62b0593fa11c0d9c772e1d27ef4a1c1cbf08159 (patch) | |
tree | a6afd6fa54e2488675996ea7545d65b5725eee48 /scripts/lib | |
parent | b6ca4a967c4a5553df1fa1ecbe749eebf1c3fe55 (diff) | |
download | ptxdist-d62b0593fa11c0d9c772e1d27ef4a1c1cbf08159.tar.gz ptxdist-d62b0593fa11c0d9c772e1d27ef4a1c1cbf08159.tar.xz |
ptxd_make_get: improve serialization
- add serialization for git and svn
- don't call ptxd_bailout while holding a token
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'scripts/lib')
-rw-r--r-- | scripts/lib/ptxd_make_get.sh | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/scripts/lib/ptxd_make_get.sh b/scripts/lib/ptxd_make_get.sh index fe2613f11..24d0cc75a 100644 --- a/scripts/lib/ptxd_make_get.sh +++ b/scripts/lib/ptxd_make_get.sh @@ -51,8 +51,8 @@ ptxd_make_get_http() { # remove any pending or half downloaded files rm -f -- "${path}."* - ptxd_make_serialize_take local temp_file="$(mktemp "${path}.XXXXXXXXXX")" || ptxd_bailout "failed to create tempfile" + ptxd_make_serialize_take wget \ --passive-ftp \ --progress=bar:force \ @@ -126,6 +126,7 @@ ptxd_make_get_git() { ptxd_bailout "git url '${url}' has no 'tag' option" fi + ptxd_make_serialize_take echo "${PROMPT}git: fetching '${url} into '${mirror}'..." if [ ! -d "${mirror}" ]; then git init --bare --shared "${mirror}" @@ -142,10 +143,12 @@ ptxd_make_get_git() { chmod g+w "${mirror}/FETCH_HEAD" if ! git --git-dir="${mirror}" rev-parse --verify -q "${tag}" > /dev/null; then + ptxd_make_serialize_put ptxd_bailout "git: tag '${tag}' not found in '${url}'" fi && git --git-dir="${mirror}" archive --prefix="${prefix}" -o "${path}" "${tag}" + ptxd_make_serialize_put } export -f ptxd_make_get_git @@ -204,6 +207,7 @@ ptxd_make_get_svn() { ptxd_bailout "svn url '${url}' has no 'rev' option" fi + ptxd_make_serialize_take echo "${PROMPT}svn: fetching '${url} into '${mirror}'..." if [ ! -d "${mirror}" ]; then svn checkout -r ${rev} "${url}" "${mirror}" @@ -216,6 +220,7 @@ ptxd_make_get_svn() { tar --exclude-vcs --show-stored-names ${tarcomp} \ --mtime="${lmtime}" --transform "s|^\.|${prefix}|g" \ --create --file "${path}" -C "${mirror}" . + ptxd_make_serialize_put } export -f ptxd_make_get_svn |