You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
751 B

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