aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexei Starovoitov <ast@kernel.org>2020-11-10 00:23:08 +0100
committerDaniel Borkmann <daniel@iogearbox.net>2020-11-10 01:13:38 +0100
commite3b0c435d06c8a245c34a8c316374da1da38e52f (patch)
tree66bbc56c2f0abe11d7378aae61fc8b7f8cfe0abd
parente3baa29c61790ed5499258ef5e6fa774955424f6 (diff)
downloadpw-e3b0c435d06c8a245c34a8c316374da1da38e52f.tar.gz
pw-apply: fix fetching cover letter from kernel.org's patchwork
Fix detection of cover letter on kernel.org's patchwork instance as pw html emission changed slighly after update. Signed-off-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
-rwxr-xr-xpw-apply10
1 files changed, 5 insertions, 5 deletions
diff --git a/pw-apply b/pw-apply
index c3e7cad..21db5f9 100755
--- a/pw-apply
+++ b/pw-apply
@@ -68,9 +68,9 @@ cover_from_url()
{
curl -s $1 | gunzip -f -c > tmp.i
series_num=`grep "href=\"/series" tmp.i|cut -d/ -f3|head -1`
- cover_num=`grep "href=\"/cover" tmp.i|cut -d/ -f3|head -1`
- if [ ! -z "$cover_num" ]; then
- curl -s https://patchwork.kernel.org/cover/$cover_num/mbox/ | gunzip -f -c > cover.i
+ cover_url=`grep "href=\"/project/netdevbpf/cover" tmp.i|cut -d\" -f2`
+ if [ ! -z "$cover_url" ]; then
+ curl -s https://patchwork.kernel.org${cover_url}mbox/ | gunzip -f -c > cover.i
merge="1"
fi
curl -s https://patchwork.kernel.org/series/$series_num/mbox/ | gunzip -f -c > mbox.i
@@ -159,8 +159,8 @@ if [ ! -z "$merge" ]; then
git merge --stat --log --no-edit --no-ff $branch
if [ ! -z "$cover" ]; then
author=`grep 'X-Patchwork-Submitter:' cover.i|cut -f2,3 -d' '`
- branch_name=`grep 'Subject:' cover.i|cut -d']' -f2|cut -d' ' -f2-10`
- text=`grep -A300 'X-Mailing-List:' cover.i |tail --lines=+3|grep -B300 "$author"|head --lines=-2`
+ branch_name=`grep '^Subject:' cover.i|cut -d']' -f2|cut -d' ' -f2-10`
+ text=`grep -A300 'X-Mailing-List:' cover.i |tail --lines=+3|grep -B300 -E "^.*\([0-9]+\):$"|head --lines=-2`
git commit --amend --signoff -F- <<EOF
Merge branch '$branch_name'