Message ID | 20231204025246.14779-1-zhoumin@loongson.cn (mailing list archive) |
---|---|
State | New |
Headers |
Return-Path: <ci-bounces@dpdk.org> X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id AAA2A43666; Mon, 4 Dec 2023 03:53:27 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8B7BA402AE; Mon, 4 Dec 2023 03:53:27 +0100 (CET) Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by mails.dpdk.org (Postfix) with ESMTP id 39E384026C for <ci@dpdk.org>; Mon, 4 Dec 2023 03:53:26 +0100 (CET) Received: from loongson.cn (unknown [10.20.42.74]) by gateway (Coremail) with SMTP id _____8Cx5_EjP21l_qM+AA--.59243S3; Mon, 04 Dec 2023 10:53:24 +0800 (CST) Received: from zm-pc.loongson.cn (unknown [10.20.42.74]) by localhost.localdomain (Coremail) with SMTP id AQAAf8CxvdwSP21lb9FTAA--.54677S2; Mon, 04 Dec 2023 10:53:20 +0800 (CST) From: Min Zhou <zhoumin@loongson.cn> To: ci@dpdk.org Cc: msantana@redhat.com, aconole@redhat.com, dmarchan@redhat.com, thomas@monjalon.net, probb@iol.unh.edu, dceara@redhat.com, zhoumin@loongson.cn Subject: [PATCH v1] tools: fix parsing message-id in the headers of email Date: Mon, 4 Dec 2023 02:52:46 +0000 Message-Id: <20231204025246.14779-1-zhoumin@loongson.cn> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: AQAAf8CxvdwSP21lb9FTAA--.54677S2 X-CM-SenderInfo: 52kr3ztlq6z05rqj20fqof0/1tbiAQAPAWVr5awCawBDsi X-Coremail-Antispam: 1Uk129KBj9xXoWrtr13JFy8Cr17KFW8uF18Xrc_yoWfJwcEk3 93Ar1SqF4DurW2kr1kA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EXa7IU8zyIUUUUUU== X-BeenThere: ci@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK CI discussions <ci.dpdk.org> List-Unsubscribe: <https://mails.dpdk.org/options/ci>, <mailto:ci-request@dpdk.org?subject=unsubscribe> List-Archive: <http://mails.dpdk.org/archives/ci/> List-Post: <mailto:ci@dpdk.org> List-Help: <mailto:ci-request@dpdk.org?subject=help> List-Subscribe: <https://mails.dpdk.org/listinfo/ci>, <mailto:ci-request@dpdk.org?subject=subscribe> Errors-To: ci-bounces@dpdk.org |
Series |
[v1] tools: fix parsing message-id in the headers of email
|
|
Commit Message
Min Zhou
Dec. 4, 2023, 2:52 a.m. UTC
Some email has the message-id header named "Message-id", like this:
https://patches.dpdk.org/project/dpdk/patch/20230930010024.34377-1-rdna@apple.com/.
So add the parsing for this kind of email.
Signed-off-by: Min Zhou <zhoumin@loongson.cn>
---
tools/parse-email.sh | 1 +
1 file changed, 1 insertion(+)
Comments
Min Zhou <zhoumin@loongson.cn> writes: > Some email has the message-id header named "Message-id", like this: > https://patches.dpdk.org/project/dpdk/patch/20230930010024.34377-1-rdna@apple.com/. > So add the parsing for this kind of email. > > Signed-off-by: Min Zhou <zhoumin@loongson.cn> > --- Hi Min, I wonder - we will keep having this issue of these header fields being incorrectly matched based on case issues. Maybe we should make getheader have the ability to ignore case, or pass something like Message-[iI][dD] as the header argument. WDYT? > tools/parse-email.sh | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/tools/parse-email.sh b/tools/parse-email.sh > index 9cb9583..fbe038a 100755 > --- a/tools/parse-email.sh > +++ b/tools/parse-email.sh > @@ -35,6 +35,7 @@ subject=$(getheader Subject "$1") > from=$(getheader From "$1") > msgid=$(getheader Message-Id "$1") > [ -n "$msgid" ] || msgid=$(getheader Message-ID "$1") > +[ -n "$msgid" ] || msgid=$(getheader Message-id "$1") > pwid=$(getheader X-Patchwork-Id "$1") > listid=$(getheader List-Id "$1") > reply=$(getheader In-Reply-To "$1")
Hi Aaron, Thanks for your reply. On Thur, Dec 7, 2023 7:07PM, Aaron Conole wrote: > Min Zhou <zhoumin@loongson.cn> writes: > >> Some email has the message-id header named "Message-id", like this: >> https://patches.dpdk.org/project/dpdk/patch/20230930010024.34377-1-rdna@apple.com/. >> So add the parsing for this kind of email. >> >> Signed-off-by: Min Zhou <zhoumin@loongson.cn> >> --- > Hi Min, > > I wonder - we will keep having this issue of these header fields being > incorrectly matched based on case issues. > > Maybe we should make getheader have the ability to ignore case, or pass > something like Message-[iI][dD] as the header argument. > > WDYT? Yes, making getheader have the ability to ignore case is simple and does work for this case as following: diff --git a/tools/parse-email.sh b/tools/parse-email.sh index 9ab627b..1e3008a 100755 --- a/tools/parse-email.sh +++ b/tools/parse-email.sh @@ -29,7 +29,7 @@ fi getheader () # <header_name> <email_file> { - sed "/^$1: */!d;s///;N;s,\n[[:space:]]\+, ,;s,\n.*,,;q" "$2" | + sed "/^$1: */I!d;s///;N;s,\n[[:space:]]\+, ,;s,\n.*,,;q" "$2" | sed 's,",\\",g' } But, I think we might get a false-positive when matching header field by this way. Because we are handling the whole patch file which could have same words in somewhere if we ignore the case. Passing Message-[iI][dD] also works for this case and I tend to use this method. What do you think? If you agree with this method I will send the V2 patch. Best regards, Min >> tools/parse-email.sh | 1 + >> 1 file changed, 1 insertion(+) >> >> diff --git a/tools/parse-email.sh b/tools/parse-email.sh >> index 9cb9583..fbe038a 100755 >> --- a/tools/parse-email.sh >> +++ b/tools/parse-email.sh >> @@ -35,6 +35,7 @@ subject=$(getheader Subject "$1") >> from=$(getheader From "$1") >> msgid=$(getheader Message-Id "$1") >> [ -n "$msgid" ] || msgid=$(getheader Message-ID "$1") >> +[ -n "$msgid" ] || msgid=$(getheader Message-id "$1") >> pwid=$(getheader X-Patchwork-Id "$1") >> listid=$(getheader List-Id "$1") >> reply=$(getheader In-Reply-To "$1")
zhoumin <zhoumin@loongson.cn> writes: > Hi Aaron, > > Thanks for your reply. > > On Thur, Dec 7, 2023 7:07PM, Aaron Conole wrote: >> Min Zhou <zhoumin@loongson.cn> writes: >> >>> Some email has the message-id header named "Message-id", like this: >>> https://patches.dpdk.org/project/dpdk/patch/20230930010024.34377-1-rdna@apple.com/. >>> So add the parsing for this kind of email. >>> >>> Signed-off-by: Min Zhou <zhoumin@loongson.cn> >>> --- >> Hi Min, >> >> I wonder - we will keep having this issue of these header fields being >> incorrectly matched based on case issues. >> >> Maybe we should make getheader have the ability to ignore case, or pass >> something like Message-[iI][dD] as the header argument. >> >> WDYT? > > Yes, making getheader have the ability to ignore case is simple and > does work for this case as following: > > diff --git a/tools/parse-email.sh b/tools/parse-email.sh > index 9ab627b..1e3008a 100755 > --- a/tools/parse-email.sh > +++ b/tools/parse-email.sh > @@ -29,7 +29,7 @@ fi > > getheader () # <header_name> <email_file> > { > - sed "/^$1: */!d;s///;N;s,\n[[:space:]]\+, ,;s,\n.*,,;q" "$2" | > + sed "/^$1: */I!d;s///;N;s,\n[[:space:]]\+, ,;s,\n.*,,;q" "$2" | > sed 's,",\\",g' > > } > > But, I think we might get a false-positive when matching header field > by this way. Because we are handling the whole patch file which could > have same words in somewhere if we ignore the case. > > Passing Message-[iI][dD] also works for this case and I tend to use > this method. What do you think? If you agree with this method I will > send the V2 patch. ACK by me - sounds good. That means we can just modify the existing getheader check for message id. > Best regards, > > Min > > >>> tools/parse-email.sh | 1 + >>> 1 file changed, 1 insertion(+) >>> >>> diff --git a/tools/parse-email.sh b/tools/parse-email.sh >>> index 9cb9583..fbe038a 100755 >>> --- a/tools/parse-email.sh >>> +++ b/tools/parse-email.sh >>> @@ -35,6 +35,7 @@ subject=$(getheader Subject "$1") >>> from=$(getheader From "$1") >>> msgid=$(getheader Message-Id "$1") >>> [ -n "$msgid" ] || msgid=$(getheader Message-ID "$1") >>> +[ -n "$msgid" ] || msgid=$(getheader Message-id "$1") >>> pwid=$(getheader X-Patchwork-Id "$1") >>> listid=$(getheader List-Id "$1") >>> reply=$(getheader In-Reply-To "$1")
On Wed, Dec 13, 2023 at 12:53PM, Aaron Conole wrote: > zhoumin <zhoumin@loongson.cn> writes: > >> Hi Aaron, >> >> Thanks for your reply. >> >> On Thur, Dec 7, 2023 7:07PM, Aaron Conole wrote: >>> Min Zhou <zhoumin@loongson.cn> writes: >>> >>>> Some email has the message-id header named "Message-id", like this: >>>> https://patches.dpdk.org/project/dpdk/patch/20230930010024.34377-1-rdna@apple.com/. >>>> So add the parsing for this kind of email. >>>> >>>> Signed-off-by: Min Zhou <zhoumin@loongson.cn> >>>> --- >>> Hi Min, >>> >>> I wonder - we will keep having this issue of these header fields being >>> incorrectly matched based on case issues. >>> >>> Maybe we should make getheader have the ability to ignore case, or pass >>> something like Message-[iI][dD] as the header argument. >>> >>> WDYT? >> Yes, making getheader have the ability to ignore case is simple and >> does work for this case as following: >> >> diff --git a/tools/parse-email.sh b/tools/parse-email.sh >> index 9ab627b..1e3008a 100755 >> --- a/tools/parse-email.sh >> +++ b/tools/parse-email.sh >> @@ -29,7 +29,7 @@ fi >> >> getheader () # <header_name> <email_file> >> { >> - sed "/^$1: */!d;s///;N;s,\n[[:space:]]\+, ,;s,\n.*,,;q" "$2" | >> + sed "/^$1: */I!d;s///;N;s,\n[[:space:]]\+, ,;s,\n.*,,;q" "$2" | >> sed 's,",\\",g' >> >> } >> >> But, I think we might get a false-positive when matching header field >> by this way. Because we are handling the whole patch file which could >> have same words in somewhere if we ignore the case. >> >> Passing Message-[iI][dD] also works for this case and I tend to use >> this method. What do you think? If you agree with this method I will >> send the V2 patch. > ACK by me - sounds good. That means we can just modify the existing > getheader check for message id. Yes, thanks! I will send the V2 patch. Best regards, Min >> Best regards, >> >> Min >> >> >>>> tools/parse-email.sh | 1 + >>>> 1 file changed, 1 insertion(+) >>>> >>>> diff --git a/tools/parse-email.sh b/tools/parse-email.sh >>>> index 9cb9583..fbe038a 100755 >>>> --- a/tools/parse-email.sh >>>> +++ b/tools/parse-email.sh >>>> @@ -35,6 +35,7 @@ subject=$(getheader Subject "$1") >>>> from=$(getheader From "$1") >>>> msgid=$(getheader Message-Id "$1") >>>> [ -n "$msgid" ] || msgid=$(getheader Message-ID "$1") >>>> +[ -n "$msgid" ] || msgid=$(getheader Message-id "$1") >>>> pwid=$(getheader X-Patchwork-Id "$1") >>>> listid=$(getheader List-Id "$1") >>>> reply=$(getheader In-Reply-To "$1")
diff --git a/tools/parse-email.sh b/tools/parse-email.sh index 9cb9583..fbe038a 100755 --- a/tools/parse-email.sh +++ b/tools/parse-email.sh @@ -35,6 +35,7 @@ subject=$(getheader Subject "$1") from=$(getheader From "$1") msgid=$(getheader Message-Id "$1") [ -n "$msgid" ] || msgid=$(getheader Message-ID "$1") +[ -n "$msgid" ] || msgid=$(getheader Message-id "$1") pwid=$(getheader X-Patchwork-Id "$1") listid=$(getheader List-Id "$1") reply=$(getheader In-Reply-To "$1")