haproxy: update to v2.6.8
[feed/packages.git] / net / haproxy / get-latest-patches.sh
1 #!/bin/sh
2
3 CLONEURL=https://git.haproxy.org/git/haproxy-2.6.git
4 BASE_TAG=v2.6.8
5 TMP_REPODIR=tmprepo
6 PATCHESDIR=patches
7
8 if test -d "${TMP_REPODIR}"; then rm -rf "${TMP_REPODIR}"; fi
9
10 git clone "${CLONEURL}" "${TMP_REPODIR}"
11
12 printf "Cleaning patches\n"
13 find ${PATCHESDIR} -type f -name "*.patch" -exec rm -f "{}" \;
14
15 i=0
16 for cid in $(git -C "${TMP_REPODIR}" rev-list ${BASE_TAG}..HEAD | tac); do
17 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"
18 printf "Creating %s\n" "${filename}"
19 git -C "${TMP_REPODIR}" show "$cid" > "${PATCHESDIR}/$filename"
20 git add "${PATCHESDIR}/$filename"
21 i=$((i+1))
22 done
23
24 rm -rf "${TMP_REPODIR}"
25
26 printf "finished\n"
27