From patchwork Mon Feb 6 07:14:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juerg Haefliger X-Patchwork-Id: 1738040 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=suNfgVJ0; 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 4P9HZt3sLTz23y3 for ; Mon, 6 Feb 2023 18:15:02 +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 1pOviK-0002gb-7x; Mon, 06 Feb 2023 07:14:56 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1pOviH-0002fQ-3L for kernel-team@lists.ubuntu.com; Mon, 06 Feb 2023 07:14:53 +0000 Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) (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-0.canonical.com (Postfix) with ESMTPS id 7B0F83F194 for ; Mon, 6 Feb 2023 07:14:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1675667691; bh=VtnZm2vWyAX2nMyrsMJZSfEo2ccqqxPEcl2pE3CfLvA=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=suNfgVJ0lCsdI9Z4M7TYI6PkqaAiEQvUL3m/i4RfmBLg1BIsDYeO6AV0R4MIZ+S1g J+UTVnYiscSm8JlWhJ5+WF4h8rFuQBp+qDcihLy7fR7OlcWj9qvH6FYJ4eonw+jVMJ a1mIJ8ObfPnyjnmDygGb1g+PrpcAR9lg284ax8Wm1h8Ga3/bEwJmjWwTAvOcrQ4qPj PO7vU/lK+EgX5zQZRl0K5790fFP5nYjmQuaig0/LDXPtU4cHHHR8MebQO4jMT7QT9T U2tIXD5wnzHEoNnIkK8Hi+Ci9bIA+ZFeFZJl6rUremErXLFoIq2gqX+TJ3qbEXeUw+ iRKhDIAOlxLDQ== Received: by mail-ej1-f72.google.com with SMTP id p16-20020a170906499000b0088c5a527c89so8039781eju.23 for ; Sun, 05 Feb 2023 23:14:51 -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:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VtnZm2vWyAX2nMyrsMJZSfEo2ccqqxPEcl2pE3CfLvA=; b=ne4aSG22p1vcb1BiwGbLUpQTWFEaVVP5RVt3oFUKp9WkBPrVLIwr+aXXKOzRSqXYhY KaKXflRVkfN2gxTNggFmXoO0fusuIxiUcw+lpOQt3W0Shbl/7UWbivJI7vhIeEyESTwu yejgaOHuu3ad+f0rhlrueXlqBvFN7W+0WFjJr6ulIqeHO43j7Y4ds1fpo9NuuUAEsaQP BkHxTvjzzwcef/kR1GbSS6mTlNSwhKasGZQWpjPAbUl6P4jgr8GHHzCVTKjxr+fabq2N n3HMTGeNVXh7ktxUjNqGi4tobEWhdbAZfK30riy7XpHkryp8HF3SopyzM+bRE4OHRYA8 SDaQ== X-Gm-Message-State: AO0yUKVfyQuHctCFWh2IAXC3zSrPaJ7FupKN/RCgxariKQRjCsKqE+B/ WqbKko7OSWASjIhnzZ/bRuOKtoWBRKf5DutP3djbFIHWil/cWyqMOBlPcRtIptDWr94VgxXlC9j 2LqREvVFxJHmBmtfasnvCK4+CWcrBvMGveRznzJlXqg== X-Received: by 2002:a17:907:2bc2:b0:878:7189:a457 with SMTP id gv2-20020a1709072bc200b008787189a457mr18430976ejc.51.1675667691207; Sun, 05 Feb 2023 23:14:51 -0800 (PST) X-Google-Smtp-Source: AK7set9ZekQa0du215jZAlOwqkk70dYcuC/VrpnxfaWrOD4s9pouxylLP/gM3r90D2PksDe+Uoq1Xw== X-Received: by 2002:a17:907:2bc2:b0:878:7189:a457 with SMTP id gv2-20020a1709072bc200b008787189a457mr18430965ejc.51.1675667690952; Sun, 05 Feb 2023 23:14:50 -0800 (PST) Received: from gollum.fritz.box ([194.191.244.86]) by smtp.gmail.com with ESMTPSA id l2-20020a170906a40200b0084d35ffbc20sm5084180ejz.68.2023.02.05.23.14.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Feb 2023 23:14:50 -0800 (PST) From: Juerg Haefliger To: kernel-team@lists.ubuntu.com Subject: [Unstable/Lunar][PATCH v2 2/2] UBUNTU: [Packaging] annotations: Preserve single-line annotation rules Date: Mon, 6 Feb 2023 08:14:48 +0100 Message-Id: <20230206071448.713716-3-juerg.haefliger@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230206071448.713716-1-juerg.haefliger@canonical.com> References: <20230206071448.713716-1-juerg.haefliger@canonical.com> 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" Currently, rules with notes are written out as separate lines, i. e., one line for the policy and one line for the note, followed by an empty line. The parser now supports single line rules so preserve that style when writting out the rules. Signed-off-by: Juerg Haefliger --- debian/scripts/misc/kconfig/annotations.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/debian/scripts/misc/kconfig/annotations.py b/debian/scripts/misc/kconfig/annotations.py index cb73232b01e7..dd9c05fbb8e4 100644 --- a/debian/scripts/misc/kconfig/annotations.py +++ b/debian/scripts/misc/kconfig/annotations.py @@ -82,6 +82,7 @@ class Annotation(Config): m = re.match(r'.* note<(.*?)>', line) if m: + entry['oneline'] = match match = True entry['note'] = "'" + m.group(1).replace("'", '') + "'" @@ -284,11 +285,16 @@ class Annotation(Config): if 'policy' in new_val: val = dict(sorted(new_val['policy'].items())) line = f"{conf : <47} policy<{val}>" - tmp.write(line + "\n") if 'note' in new_val: val = new_val['note'] - line = f"{conf : <47} note<{val}>" - tmp.write(line + "\n\n") + if new_val.get('oneline', False): + # Single line + line += f' note<{val}>' + else: + # Separate policy and note lines, + # followed by an empty line + line += f'\n{conf : <47} note<{val}>\n' + tmp.write(line + "\n") # Replace annotations with the updated version tmp.flush()