packages/net/haproxy/get-latest-patches.sh
Christian Lachner 7e48c36cc9 haproxy: Update HAProxy to v2.0.14
- Update haproxy download URL and hash
- Add new patches (see https://www.haproxy.org/bugs/bugs-2.0.14.html)
- This fixes CVE-2020-11100 (http://git.haproxy.org/?p=haproxy-2.0.git;a=commit;h=b9cac598021e2b0d4ae2cfecf9825a3469328093)

Signed-off-by: Christian Lachner <gladiac@gmail.com>
2020-04-03 09:32:58 +02:00

27 lines
750 B
Bash
Executable file

#!/bin/sh
CLONEURL=https://git.haproxy.org/git/haproxy-2.0.git
BASE_TAG=v2.0.14
TMP_REPODIR=tmprepo
PATCHESDIR=patches
if test -d "${TMP_REPODIR}"; then rm -rf "${TMP_REPODIR}"; fi
git clone "${CLONEURL}" "${TMP_REPODIR}"
printf "Cleaning patches\n"
find ${PATCHESDIR} -type f -name "*.patch" -exec rm -f "{}" \;
i=0
for cid in $(git -C "${TMP_REPODIR}" rev-list ${BASE_TAG}..HEAD | tac); do
filename="$(printf "%03d" $i)-$(git -C "${TMP_REPODIR}" log --format=%s -n 1 $cid | sed -e"s/[()']//g" -e's/[^_a-zA-Z0-9+-]\+/-/g' -e's/-$//').patch"
printf "Creating %s\n" "${filename}"
git -C "${TMP_REPODIR}" show "$cid" > "${PATCHESDIR}/$filename"
git add "${PATCHESDIR}/$filename"
i=$((i+1))
done
rm -rf "${TMP_REPODIR}"
printf "finished\n"