2019-07-25 10:07:31 +08:00
|
|
|
#!/bin/sh
|
2018-04-29 16:00:22 +08:00
|
|
|
|
2024-05-29 22:11:20 +08:00
|
|
|
CLONEURL=https://git.haproxy.org/git/haproxy-3.0.git
|
2025-04-22 21:18:39 +08:00
|
|
|
BASE_TAG=v3.0.10
|
2018-04-29 16:00:22 +08:00
|
|
|
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
|
2020-10-02 15:06:26 +08:00
|
|
|
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"
|
2019-07-25 10:07:31 +08:00
|
|
|
printf "Creating %s\n" "${filename}"
|
|
|
|
git -C "${TMP_REPODIR}" show "$cid" > "${PATCHESDIR}/$filename"
|
2018-04-29 16:00:22 +08:00
|
|
|
git add "${PATCHESDIR}/$filename"
|
2019-07-25 10:07:31 +08:00
|
|
|
i=$((i+1))
|
2018-04-29 16:00:22 +08:00
|
|
|
done
|
|
|
|
|
|
|
|
rm -rf "${TMP_REPODIR}"
|
|
|
|
|
|
|
|
printf "finished\n"
|
|
|
|
|