libressl: update to 2.6.3
[openadk.git] / scripts / update-patches-git
blob8337fa8470e3a2f6c60588f98d9363bf72f12ac5
1 #!/usr/bin/env bash
3 # Update patches using git-format-patch from a source tree prepared by
4 # patch_git.sh.
6 # (c) 2016 Phil Sutter <phil@nwl.cc>
8 wrkdist=$1
9 wd=$(pwd)
11 cd "$wrkdist"
12 top=""
13 top_series=""
14 git log --grep="^OpenADK patch marker:" --oneline | while read hash subject; do
15 [ -n "$top" ] || {
16 top=$hash
17 top_series="${subject#OpenADK patch marker: }"
18 continue
20 bottom=$hash
21 bottom_series="${subject#OpenADK patch marker: }"
23 patchdir=$(<.git/patch_tmp/${top_series}/__patchdir__)
24 while read patchfile; do
25 rm ${patchdir}/$patchfile
26 done < .git/patch_tmp/${top_series}/__patchfiles__
27 git format-patch -N -o "$patchdir" ${bottom}..${top}
29 top=$bottom
30 top_series=$bottom_series
31 done