1
0
Fork 0

Feature/download syncer centosix (#3381)

The ancient curl on centos 6 doesn't know howto download files directly by following 30x, add a wrapper shellscipt that can do this with several curl calls to work around this.
This commit is contained in:
Wilfried Goesgens 2017-10-06 10:18:43 +02:00 committed by Max Neunhöffer
parent d86f27bd19
commit a8ddaf56f6
2 changed files with 11 additions and 1 deletions

View File

@ -715,7 +715,8 @@ if test -n "${DOWNLOAD_SYNCER_USER}"; then
fi
if ! test -f "${BUILD_DIR}/${FN}-${SYNCER_REV}"; then
rm -f "${FN}"
curl -LJO# -H 'Accept: application/octet-stream' "${SYNCER_URL}?access_token=${OAUTH_TOKEN}"
curl -LJO# -H 'Accept: application/octet-stream' "${SYNCER_URL}?access_token=${OAUTH_TOKEN}" || \
${SRC}/Installation/Jenkins/curl_time_machine.sh "${SYNCER_URL}?access_token=${OAUTH_TOKEN}" "${FN}"
mv "${FN}" "${BUILD_DIR}/${TN}"
${MD5} < "${BUILD_DIR}/${TN}" | ${SED} "s; .*;;" > "${BUILD_DIR}/${FN}-${SYNCER_REV}"
OLD_MD5=$(cat "${BUILD_DIR}/${FN}-${SYNCER_REV}")

View File

@ -0,0 +1,9 @@
#!/bin/bash
# Work around stoneage curl versions that can't follow redirects
curl -D /tmp/headers -H 'Accept: application/octet-stream' "$1"
for URL in $(grep location: /tmp/headers |sed -e "s;\r;;" -e "s;.*: ;;"); do
curl $URL > $2
done