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
741 B

  1. #!/bin/bash
  2. CLONEURL=http://git.haproxy.org/git/haproxy-1.8.git
  3. BASE_TAG=v1.8.19
  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 ${filename}\n"
  14. git -C "${TMP_REPODIR}" show $cid > "${PATCHESDIR}/$filename"
  15. git add "${PATCHESDIR}/$filename"
  16. let i++
  17. done
  18. rm -rf "${TMP_REPODIR}"
  19. printf "finished\n"