{"id":806455,"url":"http://patchwork.ozlabs.org/api/1.0/patches/806455/?format=json","project":{"id":18,"url":"http://patchwork.ozlabs.org/api/1.0/projects/18/?format=json","name":"U-Boot","link_name":"uboot","list_id":"u-boot.lists.denx.de","list_email":"u-boot@lists.denx.de","web_url":null,"scm_url":null,"webscm_url":null},"msgid":"<20170828093026.20610-1-judge.packham@gmail.com>","date":"2017-08-28T09:30:26","name":"[U-Boot] patman: add support for omitting bouncing addresses","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"f4451c1d1f8f94f1317603cddbb95f7bda2d1e4d","submitter":{"id":6125,"url":"http://patchwork.ozlabs.org/api/1.0/people/6125/?format=json","name":"Chris Packham","email":"judge.packham@gmail.com"},"delegate":{"id":3184,"url":"http://patchwork.ozlabs.org/api/1.0/users/3184/?format=json","username":"sjg","first_name":"Simon","last_name":"Glass","email":"sjg@chromium.org"},"mbox":"http://patchwork.ozlabs.org/project/uboot/patch/20170828093026.20610-1-judge.packham@gmail.com/mbox/","series":[{"id":117,"url":"http://patchwork.ozlabs.org/api/1.0/series/117/?format=json","date":"2017-08-28T09:30:26","name":"[U-Boot] patman: add support for omitting bouncing addresses","version":1,"mbox":"http://patchwork.ozlabs.org/series/117/mbox/"}],"check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/806455/checks/","tags":{},"headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"CreRZoUK\"; dkim-atps=neutral"],"Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xgmjS491Pz9s7h\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon, 28 Aug 2017 19:31:07 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid CCB76C224A2; Mon, 28 Aug 2017 09:30:41 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id D071EC224A3;\n\tMon, 28 Aug 2017 09:30:38 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 3E042C22476; Mon, 28 Aug 2017 09:30:37 +0000 (UTC)","from mail-pg0-f67.google.com (mail-pg0-f67.google.com\n\t[74.125.83.67])\n\tby lists.denx.de (Postfix) with ESMTPS id 536F3C22434\n\tfor <u-boot@lists.denx.de>; Mon, 28 Aug 2017 09:30:36 +0000 (UTC)","by mail-pg0-f67.google.com with SMTP id 83so5921513pgb.3\n\tfor <u-boot@lists.denx.de>; Mon, 28 Aug 2017 02:30:36 -0700 (PDT)","from chrisp-dl.ws.atlnz.lc\n\t(2-163-36-202-static.alliedtelesis.co.nz. [202.36.163.2])\n\tby smtp.gmail.com with ESMTPSA id\n\tt125sm21932111pgc.49.2017.08.28.02.30.31\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\n\tMon, 28 Aug 2017 02:30:33 -0700 (PDT)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-0.0 required=5.0 tests=FREEMAIL_FROM,\n\tRCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,\n\tT_DKIM_INVALID\n\tautolearn=unavailable autolearn_force=no version=3.4.0","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=IcpDWip6JJyViOZ23V4g7YKfUtkoZQFkzQw5D4jkxvE=;\n\tb=CreRZoUKyrLwTvMdz46fgxacBZnVdlBjXjOrQ2b7bxc5/gqIZ5ob9iar9P9QaxGcg3\n\tSn4d5pknekyJyHdR9EwUldbGqj+CDJBirxKTvrRGGcXrf64A7C53oMheV60DdpX5BmMY\n\tUkYunNPP1+t4nRiz6/RocnsuNsEtdiADT29+CUQoLAhgeNhIkAY5RpBmX1Jvl2GNOdee\n\tpZvV8tvq3PsYY5q+0KJ2HIbfePVtL0vdZxBvS8SF5YqEcv5T/Q8E0LmNC/z61r2NNf3q\n\t3nZi/P/Ajc3VwCva+r8PV6DSZpXDcwFThkXO53aPFJRxrb5BIvhZ3VDRcHRu2EBI/t7g\n\tYSzw==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=IcpDWip6JJyViOZ23V4g7YKfUtkoZQFkzQw5D4jkxvE=;\n\tb=YsQadA7B0+YxJ/TzElpvQeoZahuiw05ObHr3N6Se6vDzDzRtH8WGnE6aqW1Pk2IBj3\n\t845Iqn+IJXZYWQnDxy6GpMRlqixX44nT+c7MMMA4YVnpt96ZAWTVoDuOL48VBcyi/UD2\n\tyLAybHjj51fWdqs5DdyamLCUt6Mc8SZLk57O9EP/UboNqAVpTlS0hCYSkNkSXzP7/JbW\n\tlU6cR9Qu9WRsvUWN4Yuyfv8i5pU45SwSdd7SswKBD6MrIaHDTKLG/Toh3uuFGkV6lEUo\n\tpF7hqz9llt2ygox0LJah6OPaxt1X9L91wXeHBM+x24XGrZbRO2cMVJfrX9i3P6t0tj46\n\twOnw==","X-Gm-Message-State":"AHYfb5g/AuKFoZWdISnX21ds9Ov+z3Dp/XE3eE8byJqJsLbwU4Xb/CWb\n\tIcozUpRuobVjZO2jVbfDfA==","X-Received":"by 10.84.196.164 with SMTP id l33mr3014921pld.120.1503912634557; \n\tMon, 28 Aug 2017 02:30:34 -0700 (PDT)","From":"Chris Packham <judge.packham@gmail.com>","To":"u-boot@lists.denx.de","Date":"Mon, 28 Aug 2017 21:30:26 +1200","Message-Id":"<20170828093026.20610-1-judge.packham@gmail.com>","X-Mailer":"git-send-email 2.14.1","In-Reply-To":"<CAPnjgZ0mR_gN6syt4Hmj=YYQ9xNmV4E_rPPCXcuG0iC0RD9AZw@mail.gmail.com>","References":"<CAPnjgZ0mR_gN6syt4Hmj=YYQ9xNmV4E_rPPCXcuG0iC0RD9AZw@mail.gmail.com>","Cc":"Chris Packham <judge.packham@gmail.com>","Subject":"[U-Boot] [PATCH] patman: add support for omitting bouncing addresses","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","MIME-Version":"1.0","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"},"content":"Add a --bounce-file option which can be used to omit addresses that are\nknown to bounce. The option specifies a file which lists addresses (one\nper line) that are stripped from the Cc list.\n\nSigned-off-by: Chris Packham <judge.packham@gmail.com>\n---\nHere's a quick proof of concept. Right now the .bounces file has to\nmatch exactly the addresses that are extracted by patman. This makes it\neasy to do set(a) - set(b) to remove all the bounces in one hit.\n\n tools/patman/patman.py | 6 +++++-\n tools/patman/series.py | 5 ++++-\n tools/patman/tools.py  | 8 ++++++++\n 3 files changed, 17 insertions(+), 2 deletions(-)","diff":"diff --git a/tools/patman/patman.py b/tools/patman/patman.py\nindex 4b3bc787453e..567226a4d3ce 100755\n--- a/tools/patman/patman.py\n+++ b/tools/patman/patman.py\n@@ -56,6 +56,9 @@ parser.add_option('-v', '--verbose', action='store_true', dest='verbose',\n        default=False, help='Verbose output of errors and warnings')\n parser.add_option('--cc-cmd', dest='cc_cmd', type='string', action='store',\n        default=None, help='Output cc list for patch file (used by git)')\n+parser.add_option('--bounce-file', dest='bounce_fname', type='string',\n+                  default='.bounces',\n+                  help='File containing addresses to skip [default: %default]')\n parser.add_option('--no-check', action='store_false', dest='check_patch',\n                   default=True,\n                   help=\"Don't check for patch compliance\")\n@@ -158,7 +161,8 @@ else:\n \n     cc_file = series.MakeCcFile(options.process_tags, cover_fname,\n                                 not options.ignore_bad_tags,\n-                                options.add_maintainers)\n+                                options.add_maintainers,\n+                                options.bounce_fname)\n \n     # Email the patches out (giving the user time to check / cancel)\n     cmd = ''\ndiff --git a/tools/patman/series.py b/tools/patman/series.py\nindex d3947a7c2ac5..b6533ab5ee58 100644\n--- a/tools/patman/series.py\n+++ b/tools/patman/series.py\n@@ -11,6 +11,7 @@ import os\n import get_maintainer\n import gitutil\n import terminal\n+from tools import FindBounces\n \n # Series-xxx tags that we understand\n valid_series = ['to', 'cc', 'version', 'changes', 'prefix', 'notes', 'name',\n@@ -202,7 +203,7 @@ class Series(dict):\n             print(col.Color(col.RED, str))\n \n     def MakeCcFile(self, process_tags, cover_fname, raise_on_error,\n-                   add_maintainers):\n+                   add_maintainers, bounce_fname):\n         \"\"\"Make a cc file for us to use for per-commit Cc automation\n \n         Also stores in self._generated_cc to make ShowActions() faster.\n@@ -222,6 +223,7 @@ class Series(dict):\n         fname = '/tmp/patman.%d' % os.getpid()\n         fd = open(fname, 'w')\n         all_ccs = []\n+        bounces = FindBounces(bounce_fname)\n         for commit in self.commits:\n             cc = []\n             if process_tags:\n@@ -234,6 +236,7 @@ class Series(dict):\n             elif add_maintainers:\n                 cc += get_maintainer.GetMaintainer(commit.patch)\n             cc = [m.encode('utf-8') if type(m) != str else m for m in cc]\n+            cc = set(cc) - set(bounces)\n             all_ccs += cc\n             print(commit.patch, ', '.join(set(cc)), file=fd)\n             self._generated_cc[commit.patch] = cc\ndiff --git a/tools/patman/tools.py b/tools/patman/tools.py\nindex ba2485303037..9d206a390b02 100644\n--- a/tools/patman/tools.py\n+++ b/tools/patman/tools.py\n@@ -118,3 +118,11 @@ def Align(pos, align):\n \n def NotPowerOfTwo(num):\n     return num and (num & (num - 1))\n+\n+def FindBounces(bounce_fname):\n+    \"\"\"generate a list of bouncing addresses from a file\"\"\"\n+    try:\n+        with open(bounce_fname) as fd:\n+            return [line.strip() for line in fd]\n+    except IOError:\n+        return []\n","prefixes":["U-Boot"]}