From patchwork Thu Feb 2 16:14:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juerg Haefliger X-Patchwork-Id: 1736530 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=Mbqm6RZI; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4P73l41rR2z23gY for ; Fri, 3 Feb 2023 03:14:23 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1pNcE2-0002ro-Fi; Thu, 02 Feb 2023 16:14:14 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1pNcE1-0002rh-DA for kernel-team@lists.ubuntu.com; Thu, 02 Feb 2023 16:14:13 +0000 Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 3D8A53F18C for ; Thu, 2 Feb 2023 16:14:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1675354453; bh=XK1dEq590zDccC6S1sIxRrMLp0h7y4W1aKFMfiD4SH0=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=Mbqm6RZIMzcJpXd3n5sfhmcJAjtBJ+p4bcWq+NkVMa2mzyZNu5sX2Go1DvYvUjwBt OnEjVohnAIFVU4/ciVAi6dYtmsrUYtD4JQOX8bHESL+FQO3GcJVYvHG+6i+PRlvree l3nfyZwBH1eEzMGs9cbKqV1x1Oyuc4mF8J3hzMGSpJORCSV/Eokb24nv0rVuo4TKBj u3SspU7YiyukbRMR1ra+KckE/7HZ7Jg877xr0odQQtwtUc6DOhpSQjHElgwYR/S0YL NyFA4tJC5ZiHVEvq341sSgNOucBHPvP5z/0lyStcj6sAmRaWjdx62T2mC1No+JXrmJ vkK2WCDe8vu+A== Received: by mail-ed1-f70.google.com with SMTP id g19-20020a056402115300b004a26cc7f6cbso1780874edw.4 for ; Thu, 02 Feb 2023 08:14:13 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=XK1dEq590zDccC6S1sIxRrMLp0h7y4W1aKFMfiD4SH0=; b=5PYya/Bn4BAxY+lpw8abivQTdGYP6j50JlNgpBsl3oIC6B24B4V/7UFYtoewcSHNaE n32eKFFKGGhU96yPOOnRGFbTl0v/4MliVWX9MxfQuC7/r4dVnfcYpOXb1JcfId8sdooM VuXedBmEZbZJZejjgwwDcf+BM84chzaNRSJzE0EHU/ilarJP4lg2iyl93vFRgGv39TFe 7DyOtxqj4E2NqNGXijlXHQ0ln0pvdsMq5FtRm+NVqbAVfrJPWdNSQSCIyFvzEyHTflYa eFn60t7TuqIQpni3qi6lMLDlDkFhxzKRgdXhxzICTcwLKi/6qVZwTCy4koKNf8rZUlKN m63Q== X-Gm-Message-State: AO0yUKXW8i52XHs6FUH22rf2UEG2pwZPNgCPiYTX6GjWPaCeMhktCkJV 3zeYiH6b0WzTEHhA+h9T7RofmNdr/XhGj5SgSv+w419g4nhGWcLQwjEsqx4yiMWsPh3XynNYvjz GZ2lZt8CXLt8bW1nocf/AACP7dWwAfksVqjq+9ZPJ3w== X-Received: by 2002:a17:906:d8b6:b0:885:a62c:5a5c with SMTP id qc22-20020a170906d8b600b00885a62c5a5cmr7145247ejb.46.1675354452991; Thu, 02 Feb 2023 08:14:12 -0800 (PST) X-Google-Smtp-Source: AK7set+yLO7pVEO4QGFm8A+rxDRJEBBF4LppoqDv4cBMxMmyjHTVOVU2oO+7vU74eXWVTkFNFW3LRQ== X-Received: by 2002:a17:906:d8b6:b0:885:a62c:5a5c with SMTP id qc22-20020a170906d8b600b00885a62c5a5cmr7145239ejb.46.1675354452868; Thu, 02 Feb 2023 08:14:12 -0800 (PST) Received: from gollum.fritz.box ([194.191.244.86]) by smtp.gmail.com with ESMTPSA id f19-20020a170906391300b0088452ca0666sm8290676eje.196.2023.02.02.08.14.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Feb 2023 08:14:12 -0800 (PST) From: Juerg Haefliger To: kernel-team@lists.ubuntu.com Subject: [Unstable/Lunar][PATCH] UBUNTU: [Packaging] annotations: Use non-greedy policy match Date: Thu, 2 Feb 2023 17:14:11 +0100 Message-Id: <20230202161411.442006-1-juerg.haefliger@canonical.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" A single line can contain both policy and note sections, so use non-greedy matches for all sections. Otherwise, a line like: CONFIG_FOO policy<{'arm64': 'm'}> note results in: Traceback (most recent call last): File "debian/scripts/misc/kconfig/annotations.py", line 80, in _parse_body entry['policy'] |= literal_eval(m.group(1)) File "/usr/lib/python3.10/ast.py", line 64, in literal_eval node_or_string = parse(node_or_string.lstrip(" \t"), mode='eval') File "/usr/lib/python3.10/ast.py", line 50, in parse return compile(source, filename, mode, flags, File "", line 1 {'arm64': 'm'}> note --- debian/scripts/misc/kconfig/annotations.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/scripts/misc/kconfig/annotations.py b/debian/scripts/misc/kconfig/annotations.py index 84dd4d26e6af..af963b76355b 100644 --- a/debian/scripts/misc/kconfig/annotations.py +++ b/debian/scripts/misc/kconfig/annotations.py @@ -74,7 +74,7 @@ class Annotation(Config): entry = self.config[conf] else: entry = {'policy': {}} - m = re.match(r'.*policy<(.*)>', line) + m = re.match(r'.*policy<(.*?)>', line) if m: entry['policy'] |= literal_eval(m.group(1)) else: