From nobody Thu Oct 31 00:18:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1722432173429353.22715690508767; Wed, 31 Jul 2024 06:22:53 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 6B8D0144A; Wed, 31 Jul 2024 09:22:52 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 718EF1408; Wed, 31 Jul 2024 09:21:54 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 1A945145A; Wed, 31 Jul 2024 09:21:50 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 5FD7F13BA for ; Wed, 31 Jul 2024 09:21:40 -0400 (EDT) Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-172-3-duPlzIOD-yApFkX_EV4A-1; Wed, 31 Jul 2024 09:21:38 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (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 mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 3267A1955F3B for ; Wed, 31 Jul 2024 13:21:37 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.45.224.70]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id E8C021955E8C for ; Wed, 31 Jul 2024 13:21:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1722432100; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=203DPc0dIH+o6jFzvrcNc1WLVDvIg53iPd1nbN63+3Q=; b=SnawKVNvwriG7j6uevrMfbCqwIuw3CFde/HN812k8zcNk3BZv2ReuoqfI5/+VG/aC7mTvS InL4d5eVf2zH1PsfAyDyNwjcSYTPu2eKZP569wIJVi05zerhr4UAl4KEX6NypeElMo9C5j L5PZBmySj4AId/g7TnWRyhRNFFJGq7k= X-MC-Unique: 3-duPlzIOD-yApFkX_EV4A-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: devel@lists.libvirt.org Subject: [libvirt PATCH 3/6] scripts: group-qemu-caps: remove unecessary regex Date: Wed, 31 Jul 2024 15:20:49 +0200 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: SMA66LHEAPT44R6MHPTBL3XGBOEEDZ6C X-Message-ID-Hash: SMA66LHEAPT44R6MHPTBL3XGBOEEDZ6C X-MailFrom: jtomko@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1722432175089116600 Content-Type: text/plain; charset="utf-8" We're only looking at a simple string match. Signed-off-by: J=C3=A1n Tomko --- scripts/group-qemu-caps.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/group-qemu-caps.py b/scripts/group-qemu-caps.py index 49b64c93fc..3581d1545a 100755 --- a/scripts/group-qemu-caps.py +++ b/scripts/group-qemu-caps.py @@ -27,7 +27,7 @@ import subprocess import sys =20 =20 -def load_caps_flags(filename, start_regex, end_regex): +def load_caps_flags(filename, start_str, end_str): capsflags =3D [] lines =3D [] start =3D 0 @@ -37,9 +37,9 @@ def load_caps_flags(filename, start_regex, end_regex): lines =3D fh.read().splitlines() =20 for idx, line in enumerate(lines): - if re.search(start_regex, line): + if start_str in line: start =3D idx - elif re.search(end_regex, line): + elif end_str in line: end =3D idx break =20 @@ -136,8 +136,8 @@ args =3D parser.parse_args() errs =3D False =20 capsflags =3D load_caps_flags(args.prefix + 'src/qemu/qemu_capabilities.h', - r'virQEMUCapsFlags grouping marker', - r'QEMU_CAPS_LAST \/\* this must') + 'virQEMUCapsFlags grouping marker', + 'QEMU_CAPS_LAST /* this must') =20 if not regroup_caps(args.check, args.prefix + 'src/qemu/qemu_capabilities.c', --=20 2.45.2