From nobody Thu May 9 22:27:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1653327545; cv=none; d=zohomail.com; s=zohoarc; b=gI4UOZRrt1rsfTcncwP2rXc2srZmZzLbZFYUm3J+RBGZtr9UZikpsXpczcadx+6lVQRnc8d2kpgwMpjrZcl7YkbRJgU2uw7u3KbEohli+Z27UhJNhXrVN8V16HGw+Mp84tf7CB0vPQ4feGe1rM4lg8QJWsV6D5ppFDwwvMljbtE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1653327545; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Db+iT+DqWWs2ONicrdfAz1DARrltCQBhK+TkX0RJI/0=; b=RTf5p26SXtx/kULTheYpqVA3VdPMqZas7SuB9F76qkvUMgOmYSEgS8UNYMlVkis2jtS0yA3DKC9Vbv6hRYzR60ei+DYs7+AqaS6lEQjL2k3HWACDJrN0DofVyUjbxN5NKNVBmmonBcSL6PjDeoxWHHcriw8hoof6fi7cy8l0Tzc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1653327545919200.35932014646517; Mon, 23 May 2022 10:39:05 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-642-7ugdNmm6P8ieTY9uBb4SyA-1; Mon, 23 May 2022 13:38:02 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 116E21801387; Mon, 23 May 2022 17:37:59 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id EF98E400E400; Mon, 23 May 2022 17:37:58 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id B13201947066; Mon, 23 May 2022 17:37:58 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 7BC161947067 for ; Mon, 23 May 2022 17:37:57 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 6F90B112131E; Mon, 23 May 2022 17:37:57 +0000 (UTC) Received: from harajuku.usersys.redhat.com.homenet.telecomitalia.it (unknown [10.40.192.104]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EF1DB112131B for ; Mon, 23 May 2022 17:37:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1653327545; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=Db+iT+DqWWs2ONicrdfAz1DARrltCQBhK+TkX0RJI/0=; b=ZQ68mNs2g7O/ZwHLq77hX6Em10OYAsJACUKSHgdIxzb/qakx/6rlmtLwencoVym7a7VIXl JJ6ZeIgLF1GXK3JdbncOJ4vUXJ5fhHARKVsYqN1CaXtupwOMOEC4el/m1QNaMfAqikHV18 nlecCjM7cRtA0PPhJy90WKaVV3cY2bg= X-MC-Unique: 7ugdNmm6P8ieTY9uBb4SyA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 01/13] syntax-check: Drop sc_bindtextdomain check Date: Mon, 23 May 2022 19:37:42 +0200 Message-Id: <20220523173754.336735-2-abologna@redhat.com> In-Reply-To: <20220523173754.336735-1-abologna@redhat.com> References: <20220523173754.336735-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1653327548005100003 Content-Type: text/plain; charset="utf-8" This is one of the standard checks that we have inherited from gnulib, but it's not applicable to libvirt because we don't want plain bindtextdomain() to be used: virGettextInitialize() is our own private API that should be used instead. The sc_gettext_init check ensures that our private API is used in all the places where it makes sense, and the sc_bindtextdomain check was disabled entirely via a blanket exception. Drop it instead of keeping dead code around. Signed-off-by: Andrea Bolognani Reviewed-by: Michal Privoznik --- build-aux/syntax-check.mk | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/build-aux/syntax-check.mk b/build-aux/syntax-check.mk index 6b54f830f1..8689d01f19 100644 --- a/build-aux/syntax-check.mk +++ b/build-aux/syntax-check.mk @@ -1297,15 +1297,6 @@ sc_prohibit_dirent_without_use: re=3D'\<($(_dirent_syms_re))\>' \ $(_sc_header_without_use) =20 -# Ensure that each .c file containing a "main" function also -# calls bindtextdomain. -sc_bindtextdomain: - @require=3D'bindtextdomain *\(' \ - in_vc_files=3D'\.c$$' \ - containing=3D'\
(p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1653327603728730.2379814270278; Mon, 23 May 2022 10:40:03 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-487-9Vkg4mXHPu6Qwig44I4jmg-1; Mon, 23 May 2022 13:38:02 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 12CB03C01D87; Mon, 23 May 2022 17:37:59 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id EFE692026D6A; Mon, 23 May 2022 17:37:58 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id AD7551947062; Mon, 23 May 2022 17:37:58 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 5CC311947059 for ; Mon, 23 May 2022 17:37:58 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 3AB0B112131B; Mon, 23 May 2022 17:37:58 +0000 (UTC) Received: from harajuku.usersys.redhat.com.homenet.telecomitalia.it (unknown [10.40.192.104]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BB347112131E for ; Mon, 23 May 2022 17:37:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1653327602; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=7eGQnlymevWj+cDnOAFucJkiBI6ZiW+pIZme2qtY2/w=; b=VCqnNu48tXMAMNgLa81yq0X9LuALeT6S0x8nQL4rTVe8VgrVecQIjyjxbh5sT8KIw9KQIG 9iV74CgwcGmitQ7YWVPZmy0eqAEpdFMpPacbD3OTXGcuiE/G7rzmYRAis/xNzB8wcHGWLk zWe7ONs3PO2vpovlDAZ2TxQj3L1mWw8= X-MC-Unique: 9Vkg4mXHPu6Qwig44I4jmg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 02/13] syntax-check: Remove sc_gettext_init exception Date: Mon, 23 May 2022 19:37:43 +0200 Message-Id: <20220523173754.336735-3-abologna@redhat.com> In-Reply-To: <20220523173754.336735-1-abologna@redhat.com> References: <20220523173754.336735-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1653327605659100001 Content-Type: text/plain; charset="utf-8" The file src/util/vireventglib.c doesn't contain a main() function and so it's not even considered by the check. Signed-off-by: Andrea Bolognani Reviewed-by: Michal Privoznik --- build-aux/syntax-check.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build-aux/syntax-check.mk b/build-aux/syntax-check.mk index 8689d01f19..0637a42e94 100644 --- a/build-aux/syntax-check.mk +++ b/build-aux/syntax-check.mk @@ -1569,7 +1569,8 @@ exclude_file_name_regexp--sc_avoid_strcase =3D ^tools= /vsh\.h$$ =20 exclude_file_name_regexp--sc_avoid_write =3D ^src/libvirt-stream\.c$$ =20 -exclude_file_name_regexp--sc_gettext_init =3D ^((tests|examples)/|tools/vi= rt-login-shell.c|src/util/vireventglib\.c) +exclude_file_name_regexp--sc_gettext_init =3D \ + ^((tests|examples)/|tools/virt-login-shell.c) =20 exclude_file_name_regexp--sc_copyright_usage =3D \ ^COPYING(|\.LESSER)|build-aux/syntax-check.mk$$ --=20 2.35.3 From nobody Thu May 9 22:27:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1653327545; cv=none; d=zohomail.com; s=zohoarc; b=kovTqEmZp/setkTimMQMmdUQNrQpBHZtoe70T23JZ4IV/9rPd4kuRmW1uZRaLM811r/ycoN7vMX8unEOrpS+ORwcrk9p3ANjNC9DJTExW/KQmvz1/6rMhSE/VeA8atzpRkoje0UhVS6PqZngIZViYqpqRdRC/9Ntz7OWGoksOsc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1653327545; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=/NLqh6mdd+UmAnDKHtilEVYSLwLXfBpz2wgemJQGQ7o=; b=Ue2vLXtRqtzf/WCT5A7rCGgbTmfOlDGWP5+FHyLVOk2BrpMIooxYTfHTzeg81UlLR9CTp6y+LE5CHMgT86HJ6J0pehtA3EYHasN1ja0cqg2n43qeF77yJuLKtfkaANmNWB8XkqlOeEToK8VFJ5iFY5e+CtNagBt5P9hFVW2YhgA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1653327545804287.56018585089896; Mon, 23 May 2022 10:39:05 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-670-R3WcsCMiOYyo3t-xQhwPkA-1; Mon, 23 May 2022 13:38:04 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7AF548038E3; Mon, 23 May 2022 17:38:02 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 664057C52; Mon, 23 May 2022 17:38:02 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 22230194705A; Mon, 23 May 2022 17:38:02 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 283941947066 for ; Mon, 23 May 2022 17:37:59 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 06271112132C; Mon, 23 May 2022 17:37:59 +0000 (UTC) Received: from harajuku.usersys.redhat.com.homenet.telecomitalia.it (unknown [10.40.192.104]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 86724112131B for ; Mon, 23 May 2022 17:37:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1653327544; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=/NLqh6mdd+UmAnDKHtilEVYSLwLXfBpz2wgemJQGQ7o=; b=J/mPHgN7m4EnYMwEQ/cyS/sIACOKUwrDlfmJRbYz2/GIgjV6lDGc14PSQR8Q9tSpjPC2+A n0rC6GHkc2kbWVKZ6YHejkPUaKKQJCS2jHfzz19Wu+UBkrPvCbQ/tHRwR7+v7xriq8UB91 o38OIMj5FqUmSI70TmGKITG9yjzjWWs= X-MC-Unique: R3WcsCMiOYyo3t-xQhwPkA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 03/13] syntax-check: Remove sc_copyright_usage exception Date: Mon, 23 May 2022 19:37:44 +0200 Message-Id: <20220523173754.336735-4-abologna@redhat.com> In-Reply-To: <20220523173754.336735-1-abologna@redhat.com> References: <20220523173754.336735-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1653327548024100004 Content-Type: text/plain; charset="utf-8" The pattern in build-aux/syntax-check.mk is written specifically so that it won't match itself, which makes having an exception for the file unnecessary. Signed-off-by: Andrea Bolognani Reviewed-by: Michal Privoznik --- build-aux/syntax-check.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-aux/syntax-check.mk b/build-aux/syntax-check.mk index 0637a42e94..8d30b0e75a 100644 --- a/build-aux/syntax-check.mk +++ b/build-aux/syntax-check.mk @@ -1573,7 +1573,7 @@ exclude_file_name_regexp--sc_gettext_init =3D \ ^((tests|examples)/|tools/virt-login-shell.c) =20 exclude_file_name_regexp--sc_copyright_usage =3D \ - ^COPYING(|\.LESSER)|build-aux/syntax-check.mk$$ + ^COPYING(|\.LESSER)$$ =20 exclude_file_name_regexp--sc_flags_usage =3D \ ^(build-aux/syntax-check\.mk|docs/|src/util/virnetdevtap\.c$$|tests/((vi= r(cgroup|pci|test|usb)|nss|qemuxml2argv|qemusecurity)mock|virfilewrapper)\.= c$$) --=20 2.35.3 From nobody Thu May 9 22:27:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1653327491; cv=none; d=zohomail.com; s=zohoarc; b=iunl8e9Ta/xN7PDLbpD6WV+Iw6GtN/16H7HsUT7KhNCle6/v7myrFq2glMWDla0M/PetldM9ArFU0HiFtUNg+pHWZkO7iFLWbRPrgV+t1j2pOj/06fnPgu8n4ozFewfKTU3GG6OGlYMx/rG1senJjqaHgMvtUSJifEkAnVnrBlw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1653327491; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=SvI8NjU9KXbhrj0tdndSw0xShc65swhNF5vaFMS14l0=; b=LQokFLPLlDkuHhuxViwUe8/oPxh+M80fNG97kkEDCAZlH7pAROrVlKlwp1FBT1DkK0mR0Vj/okUItwPLlvBxxXF6OiIYfvs2rRt5R4YBOSvXK291snc4yRzUaF2xJnkdatqQfYuWmPagS8wE88yuOh90eBESGWvB+Km1NHwtkBE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 165332749135984.86641960953568; Mon, 23 May 2022 10:38:11 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-561-5cdRW05AOGKFp3wxF9to9g-1; Mon, 23 May 2022 13:38:03 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 775D31C05EA2; Mon, 23 May 2022 17:38:01 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 64273492C3B; Mon, 23 May 2022 17:38:01 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 205BB194705A; Mon, 23 May 2022 17:38:01 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id D614E1947059 for ; Mon, 23 May 2022 17:37:59 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id C722D112131E; Mon, 23 May 2022 17:37:59 +0000 (UTC) Received: from harajuku.usersys.redhat.com.homenet.telecomitalia.it (unknown [10.40.192.104]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 52AE21121320 for ; Mon, 23 May 2022 17:37:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1653327490; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=SvI8NjU9KXbhrj0tdndSw0xShc65swhNF5vaFMS14l0=; b=bkpjx33ImAHAjIWwWkhAtcHDi5vsWohGwcbTxG3lUJzuNRfu9E2Sjxb7RswgUP7giW8/RE jbyX76cwlt9RPImtm/bzTH6ZAars1veiAdrwxR72yAhraPFtm8cxb1xt0zdU7gN/B223zK 3I0BDjopCD2oi8fOs4cY2me9nKHmQXE= X-MC-Unique: 5cdRW05AOGKFp3wxF9to9g-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 04/13] syntax-check: Improve sc_prohibit_config_h_in_headers check Date: Mon, 23 May 2022 19:37:45 +0200 Message-Id: <20220523173754.336735-5-abologna@redhat.com> In-Reply-To: <20220523173754.336735-1-abologna@redhat.com> References: <20220523173754.336735-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1653327491643100001 Content-Type: text/plain; charset="utf-8" In its current form, the check will not only catch the intended #include but also stuff like #include #include "qemu_interop_config.h" #include The last one is problematic, because it's used in config.h itself. Making the pattern more strict allows us to drop the exception. Signed-off-by: Andrea Bolognani Reviewed-by: Michal Privoznik --- build-aux/syntax-check.mk | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/build-aux/syntax-check.mk b/build-aux/syntax-check.mk index 8d30b0e75a..5244d4ee2d 100644 --- a/build-aux/syntax-check.mk +++ b/build-aux/syntax-check.mk @@ -694,7 +694,7 @@ sc_prohibit_include_public_headers_brackets: # is only needed in .c files; .h files do not need it since # .c files must include config.h before any other .h. sc_prohibit_config_h_in_headers: - @prohibit=3D'^# *include\>.*config\.h' \ + @prohibit=3D'^# *include *[<"]config\.h' \ in_vc_files=3D'\.h$$' \ halt=3D'headers should not include ' \ $(_sc_search_regexp) @@ -1707,6 +1707,3 @@ exclude_file_name_regexp--sc_prohibit_backslash_align= ment =3D \ =20 exclude_file_name_regexp--sc_prohibit_select =3D \ ^build-aux/syntax-check\.mk|src/util/vireventglibwatch\.c|tests/meson\.b= uild$$ - -exclude_file_name_regexp--sc_prohibit_config_h_in_headers =3D \ - ^config\.h$$ --=20 2.35.3 From nobody Thu May 9 22:27:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1653327549; cv=none; d=zohomail.com; s=zohoarc; b=ivB8VtegEpEA8BtIceqX9VFqVAbz1VCzt3C/4n8R6IP1ZZ3vBGnP840x6h3vu3bLIO+8sBFHTlL6SSaobGVNAww2K342wr7XijUx09PstvNz7iynVTdhDqmF156eypyT8GXGEwAcC6rtaInXbltBXCglFXLm85kKCw2aC5nUG7U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1653327549; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=zfqHasOIwOP/5vbiq8sMGE8Ht2t5LWPvXUwqTJfesJU=; b=cie+OqOIYX/RcqJkp8TBnHdtnwTzNKQWjJ7fMurFm+c62BQbCVdMPhRrtrMxj8xdGfk/CcwDvy11wZclmAwxuHg4QxEoC3D+l/cKK5fZpctg6Q7KPB+g6z7IthuZ8PXgn95X3xrmvHry/WmgIb4rNYF+4LMzpu8lu3cmxfUkNnI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1653327549327762.6984672686297; Mon, 23 May 2022 10:39:09 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-183-lEDgJNYWPNqAVtTUKuFf8g-1; Mon, 23 May 2022 13:38:11 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 057D9803D4E; Mon, 23 May 2022 17:38:07 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id E649C2166B2D; Mon, 23 May 2022 17:38:06 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id C9B5B194705E; Mon, 23 May 2022 17:38:06 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id B260C1947059 for ; Mon, 23 May 2022 17:38:00 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 923711121320; Mon, 23 May 2022 17:38:00 +0000 (UTC) Received: from harajuku.usersys.redhat.com.homenet.telecomitalia.it (unknown [10.40.192.104]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1DFFF112131B for ; Mon, 23 May 2022 17:37:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1653327547; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=zfqHasOIwOP/5vbiq8sMGE8Ht2t5LWPvXUwqTJfesJU=; b=Fg/VYoloBiBNuiLD7nICYU3pMMxDcLe/ODscditvWcDqXOfopbaqEWweC0nujYvE3lFp2+ fcPniA56MpwDFrwZul7hgXZxfqeP6QL2Nue5d8fJu3AiEDBzn3UPrgglz7NbJFF/fYSdWU yMoP/a5OSyR0lhfWG3QUM+foTNWYb60= X-MC-Unique: lEDgJNYWPNqAVtTUKuFf8g-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 05/13] syntax-check: Use VC_LIST_EXCEPT in sc_prohibit_backup_files Date: Mon, 23 May 2022 19:37:46 +0200 Message-Id: <20220523173754.336735-6-abologna@redhat.com> In-Reply-To: <20220523173754.336735-1-abologna@redhat.com> References: <20220523173754.336735-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1653327550169100001 Content-Type: text/plain; charset="utf-8" We can assume that VC_LIST_ALWAYS_EXCLUDE_REGEX will not be defined in a way that would catch backup files. Signed-off-by: Andrea Bolognani Reviewed-by: Michal Privoznik --- build-aux/syntax-check.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-aux/syntax-check.mk b/build-aux/syntax-check.mk index 5244d4ee2d..d6f2a0602d 100644 --- a/build-aux/syntax-check.mk +++ b/build-aux/syntax-check.mk @@ -1326,7 +1326,7 @@ sc_prohibit_defined_have_decl_tests: =20 # Prohibit checked in backup files. sc_prohibit_backup_files: - @$(VC_LIST) | $(GREP) '~$$' && \ + @$(VC_LIST_EXCEPT) | $(GREP) '~$$' && \ { echo '$(ME): found version controlled backup file' 1>&2; \ exit 1; } || : =20 --=20 2.35.3 From nobody Thu May 9 22:27:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1653327543; cv=none; d=zohomail.com; s=zohoarc; b=MNXcG18HGKMhO8tPYpaG9iJR20HdpSnv3kckQl/r189jMrDsRILQMEfOg0hfge2sIpLnpCknDBszNzL+ZfFk3ZQ6yrW7V77B00eipfGqU2aYUEjypfCnKN9+2X2swWkIwVKLRYfRyq/IpdY1uwPT3yVLW7iNpiix1DNY0rQ9VOE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1653327543; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=xHWsiFxtJrzp9yZ5HEiyMYIY7aLzILAHrK8qKlt/jOI=; b=HAQ634Ya/ij/bLgAeMzPQ/AyPt4eotfsw09lEZDK/ikKXwDstfxGgDAVP5d9BfnESXQsarjr62vIup4WuKnsfjqx/sb8DPJEFqaW8HQnmN3ZdnMKCmdee3UlIHc2MK923XwkingjOeis8QNZg78rnOWrjQ/tF1CvcceKS73Pflw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1653327543604120.40948400673585; Mon, 23 May 2022 10:39:03 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-657-jA42SgKmP4WNFEYQkZgglA-1; Mon, 23 May 2022 13:38:05 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1ADCF299E762; Mon, 23 May 2022 17:38:03 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id AD90040D2822; Mon, 23 May 2022 17:38:02 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 7F341194705A; Mon, 23 May 2022 17:38:02 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 6F4FF1947059 for ; Mon, 23 May 2022 17:38:01 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 5DE33112131E; Mon, 23 May 2022 17:38:01 +0000 (UTC) Received: from harajuku.usersys.redhat.com.homenet.telecomitalia.it (unknown [10.40.192.104]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DE478112131B for ; Mon, 23 May 2022 17:38:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1653327542; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=xHWsiFxtJrzp9yZ5HEiyMYIY7aLzILAHrK8qKlt/jOI=; b=XDOGAY8m2HYex9j5ut3zkQ2HSsr1AG3w9q4RF57+35GktXTwXxJPNY61R+uzc1u4TUD3yG Bmq2/cl20XXQ591F0wguXaM6FzSoq4M4AwJay1bUA0jnwPIjmvO4UtuKhoiC6cFU26x08H cOpQv98Jb1PfZBQq2qsMaufT8gYt5JM= X-MC-Unique: jA42SgKmP4WNFEYQkZgglA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 06/13] syntax-check: Simplify VC_LIST_ALWAYS_EXCLUDE_REGEX Date: Mon, 23 May 2022 19:37:47 +0200 Message-Id: <20220523173754.336735-7-abologna@redhat.com> In-Reply-To: <20220523173754.336735-1-abologna@redhat.com> References: <20220523173754.336735-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1653327543977100001 Content-Type: text/plain; charset="utf-8" Most of the pattern is no longer relevant, because the files it was intended to match have been dropped from the repository. Specifically: files commit date ------------------ ------------ ---------- *.gif 6cb131e5cbd0 2022-01-19 *.fig 9ad637c9651f 2020-07-10 docs/news*.html.in f45735786a3d 2020-06-02 docs/*.patch 6be034a8c062 2018-08-23 We can also avoid having a fallback value for the pattern: that made sense when the implementation was coming from gnulib, as they wouldn't be able to know in advance if the user would need to provide their own exclude patterns, but that scenario is no longer relevant to us. Signed-off-by: Andrea Bolognani Reviewed-by: Michal Privoznik --- build-aux/syntax-check.mk | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/build-aux/syntax-check.mk b/build-aux/syntax-check.mk index d6f2a0602d..1252cb8eb4 100644 --- a/build-aux/syntax-check.mk +++ b/build-aux/syntax-check.mk @@ -40,10 +40,6 @@ _equal =3D $(and $(findstring $(1),$(2)),$(findstring $(= 2),$(1))) VC_LIST =3D cd $(top_srcdir); git ls-tree -r 'HEAD:' | \ sed -n "s|^100[^ ]*.||p" =20 -# You can override this variable in syntax-check.mk to set your own regexp -# matching files to ignore. -VC_LIST_ALWAYS_EXCLUDE_REGEX ?=3D ^$$ - # This is to preprocess robustly the output of $(VC_LIST), so that even # when $(top_srcdir) is a pathological name like "....", the leading sed c= ommand # removes only the intended prefix. @@ -110,7 +106,7 @@ syntax-check: $(local-check) =20 # Files that should never cause syntax check failures. VC_LIST_ALWAYS_EXCLUDE_REGEX =3D \ - (^(docs/(news(-[0-9]*)?\.html\.in|.*\.patch))|\.(po|fig|gif|ico|png))$$ + \.(po|ico|png)$$ =20 # Avoid uses of write(2). Either switch to streams (fwrite), or use # the safewrite wrapper. --=20 2.35.3 From nobody Thu May 9 22:27:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1653327501; cv=none; d=zohomail.com; s=zohoarc; b=khMz4ZieCpyQfiq8c3YjnzMUS2ngNvNB9yVjOUtPDpvc1ixmNJMCYsMgZD0TOZS+cO0eSZFRO+W1xZZT4FV6F5YedUEYesECjgcp7ktpy/EV6oRxgOl4vyOtHrB6H5czGKv07/bvxrZphCTbLe58E4WlPAnTeTvc89qkt2/4TdY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1653327501; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=18PFIt0D8qsZ8cvDZiGYBOsU/75mEQct/IYlZWTF2eo=; b=lhfsdoZujyZ85ZnS0NDxuaqaQS0TbY7pNe+BC4ptTmdK7NhC20kse4NYw7NOPsxPZ1hUOwC0c9YzztQ/x33nrodrWe7sgff0mIwbdv94quvJUHS+29Cgc+6jEeOvA9XUGHLHILBYC9TKPZxLxn5WV5laotIJozxwfqytyLMJocY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1653327501116440.84255116641384; Mon, 23 May 2022 10:38:21 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-68-QRfBWxcUNL26A_AUcwYIZQ-1; Mon, 23 May 2022 13:38:13 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 170263831C43; Mon, 23 May 2022 17:38:04 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 04953C1914E; Mon, 23 May 2022 17:38:04 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id D32A3194705A; Mon, 23 May 2022 17:38:03 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 3C0461947062 for ; Mon, 23 May 2022 17:38:02 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 2A292112131B; Mon, 23 May 2022 17:38:02 +0000 (UTC) Received: from harajuku.usersys.redhat.com.homenet.telecomitalia.it (unknown [10.40.192.104]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A8E15112131E for ; Mon, 23 May 2022 17:38:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1653327500; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=18PFIt0D8qsZ8cvDZiGYBOsU/75mEQct/IYlZWTF2eo=; b=RfbJ0RRyKqqTyjG0+jiYYZLJU4GNH/SQNgPHR/GgEuaJScnm2lAYasnFeM5GtFgwfL+Ep+ kWx1Ja80GoboVsOLalEd7wt0yEVgkhrk2FFyAP1m+q4OPxopVePMS/e3ZbZuEB9pvy4PBG 8FCmndFbPUzYMG1Ul3h2cdf6dqKnizw= X-MC-Unique: QRfBWxcUNL26A_AUcwYIZQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 07/13] syntax-check: Drop unused machinery Date: Mon, 23 May 2022 19:37:48 +0200 Message-Id: <20220523173754.336735-8-abologna@redhat.com> In-Reply-To: <20220523173754.336735-1-abologna@redhat.com> References: <20220523173754.336735-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1653327501713100003 Content-Type: text/plain; charset="utf-8" _equal is not used anywhere; the rest of the code implements the syntax-check target, which takes care of figuring out the list of checks that have been defined and running them, printing the name of each check along with its execution time. This was useful when we were using autotools, but these days we have meson driving the entire build process and each of the checks is registered as a separate test, which gives us all of the features described above for free. Signed-off-by: Andrea Bolognani Reviewed-by: Michal Privoznik --- build-aux/syntax-check.mk | 38 -------------------------------------- 1 file changed, 38 deletions(-) diff --git a/build-aux/syntax-check.mk b/build-aux/syntax-check.mk index 1252cb8eb4..da0140c355 100644 --- a/build-aux/syntax-check.mk +++ b/build-aux/syntax-check.mk @@ -32,11 +32,6 @@ AWK ?=3D awk _empty =3D _sp =3D $(_empty) $(_empty) =20 -# _equal,S1,S2 -# ------------ -# If S1 =3D=3D S2, return S1, otherwise the empty string. -_equal =3D $(and $(findstring $(1),$(2)),$(findstring $(2),$(1))) - VC_LIST =3D cd $(top_srcdir); git ls-tree -r 'HEAD:' | \ sed -n "s|^100[^ ]*.||p" =20 @@ -71,39 +66,6 @@ export LC_ALL =3D C ## Sanity checks. ## ## --------------- ## =20 -_cfg_mk :=3D $(wildcard $(top_srcdir)/build-aux/syntax-check.mk) - -# Collect the names of rules starting with 'sc_'. -syntax-check-rules :=3D $(sort $(shell $(SED) -n \ - 's/^\(sc_[a-zA-Z0-9_-]*\):.*/\1/p' $(top_srcdir)/$(ME) $(_cfg_mk))) -.PHONY: $(syntax-check-rules) - -# Arrange to print the name of each syntax-checking rule just before runni= ng it. -$(syntax-check-rules): %: %.m -sc_m_rules_ =3D $(patsubst %, %.m, $(syntax-check-rules)) -.PHONY: $(sc_m_rules_) -$(sc_m_rules_): - @echo $(patsubst sc_%.m, %, $@) - @date +%s.%N > .sc-start-$(basename $@) - -# Compute and print the elapsed time for each syntax-check rule. -sc_z_rules_ =3D $(patsubst %, %.z, $(syntax-check-rules)) -.PHONY: $(sc_z_rules_) -$(sc_z_rules_): %.z: % - @end=3D$$(date +%s.%N); \ - start=3D$$(cat .sc-start-$*); \ - rm -f .sc-start-$*; \ - $(AWK) -v s=3D$$start -v e=3D$$end \ - 'END {printf "%.2f $(patsubst sc_%,%,$*)\n", e - s}' < /dev/null - -# The patsubst here is to replace each sc_% rule with its sc_%.z wrapper -# that computes and prints elapsed time. -local-check :=3D \ - $(patsubst sc_%, sc_%.z, \ - $(filter-out $(local-checks-to-skip), $(syntax-check-rules))) - -syntax-check: $(local-check) - # Files that should never cause syntax check failures. VC_LIST_ALWAYS_EXCLUDE_REGEX =3D \ \.(po|ico|png)$$ --=20 2.35.3 From nobody Thu May 9 22:27:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1653327555; cv=none; d=zohomail.com; s=zohoarc; b=LCovokZeVZPGJ2ip6mSaTKqv8/7JGto7DCiMdelsa91fbigTx3gkSUP08o7UF5nQDM4gCnTGHIgAO/B2Gs5k7AAnzxkU6wzpqTvT3rtYsMFVNU5DILB+r0A8p3TzFutSlP+LYu67IffnDOcO/t23QPpD0kHZMiWNqnMjie8uPKU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1653327555; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=b9dEsxUk34MlJrv8iciNs4jssVuiKP4JNnlfR3s3mUE=; b=RMSWpfs1Qf1bcN0hOAC88AmQ1UrBnboBvjdG5+PQCHWXylDLE8qdDy2Hoif9Z4wK/YWJOU8Gv8mK8RC+i2F7PfDmbdzff0WT2jhytt2/gEiwlSSu9eMHcPObFQewmz2LgDjl70zChTsmHjUNeeeelOnhmYnS2u8CF/mlBBGGpwc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 16533275557491016.413600403848; Mon, 23 May 2022 10:39:15 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-192-mRh_GSj9Pp6tl6ohZVL_rA-1; Mon, 23 May 2022 13:38:25 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BE3B4185A79C; Mon, 23 May 2022 17:38:04 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id A59D6492C14; Mon, 23 May 2022 17:38:04 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 6A0AE194705F; Mon, 23 May 2022 17:38:04 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 3A4291947059 for ; Mon, 23 May 2022 17:38:03 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 1B31B1121331; Mon, 23 May 2022 17:38:03 +0000 (UTC) Received: from harajuku.usersys.redhat.com.homenet.telecomitalia.it (unknown [10.40.192.104]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 755B3112131E for ; Mon, 23 May 2022 17:38:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1653327554; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=b9dEsxUk34MlJrv8iciNs4jssVuiKP4JNnlfR3s3mUE=; b=eXFTPVXa6x/1qBVfsXSQ+I+QMNF2OLd8b4NCIVYOZQn2tlonOi3M9Z/oUzvQOaDIrVc+kV hlICn2df4IwWrsj9ETGaQOCLR9CcPNBfNQSuNnTUUXuhQMtDvaeenaoXm3QAyHwy5mrCMr ZUuJnXoMS9MzJWOQpS4VILRVYIGRGsg= X-MC-Unique: mRh_GSj9Pp6tl6ohZVL_rA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 08/13] syntax-check: Drop ME variable Date: Mon, 23 May 2022 19:37:49 +0200 Message-Id: <20220523173754.336735-9-abologna@redhat.com> In-Reply-To: <20220523173754.336735-1-abologna@redhat.com> References: <20220523173754.336735-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1653327556170100002 Content-Type: text/plain; charset="utf-8" It's only used in diagnostics, and even there it's not particularly useful and can make it more difficult to spot the actual error message. Signed-off-by: Andrea Bolognani Reviewed-by: Michal Privoznik --- build-aux/syntax-check.mk | 58 ++++++++++++++++++--------------------- 1 file changed, 27 insertions(+), 31 deletions(-) diff --git a/build-aux/syntax-check.mk b/build-aux/syntax-check.mk index da0140c355..4573655074 100644 --- a/build-aux/syntax-check.mk +++ b/build-aux/syntax-check.mk @@ -19,10 +19,6 @@ # along with this program. If not, see # . =20 -# This is reported not to work with make-3.79.1 -# ME :=3D $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)) -ME :=3D build-aux/syntax-check.mk - # These variables ought to be defined through the configure.ac section # of the module description. But some packages import this file directly, # ignoring the module description. @@ -103,7 +99,7 @@ sc_flags_usage: $(top_srcdir)/include/libvirt/libvirt-lxc.h \ $(top_srcdir)/include/libvirt/libvirt-admin.h \ | $(GREP) -c '\(long\|unsigned\) flags')" !=3D 4 && \ - { echo '$(ME): new API should use "unsigned int flags"' 1>&2; \ + { echo 'new API should use "unsigned int flags"' 1>&2; \ exit 1; } || : @prohibit=3D' flags G_GNUC_UNUSED' \ exclude=3D'virSecurityDomainImageLabelFlags' \ @@ -466,7 +462,7 @@ sc_libvirt_unmarked_diagnostics: $(GREP) -A1 -nE '\<$(func_re) *\(.*,$$' /dev/null; } \ | $(SED) -E 's/_\("([^\"]|\\.)+"//;s/"%s"//' \ | $(GREP) '"' && \ - { echo '$(ME): found unmarked diagnostic(s)' 1>&2; \ + { echo 'found unmarked diagnostic(s)' 1>&2; \ exit 1; } || : =20 # Like the above, but prohibit a newline at the end of a diagnostic. @@ -480,7 +476,7 @@ sc_prohibit_newline_at_end_of_diagnostic: @$(VC_LIST_EXCEPT) | xargs $(GREP) -A2 -nE \ '\<$(func_re) *\(' /dev/null \ | $(GREP) '\\n"' \ - && { echo '$(ME): newline at end of message(s)' 1>&2; \ + && { echo 'newline at end of message(s)' 1>&2; \ exit 1; } || : =20 # Look for diagnostics that lack a % in the format string, except that we @@ -495,7 +491,7 @@ sc_prohibit_diagnostic_without_format: -e '/(vah_(error|warning))/d' \ -e '/\<$(func_re) *\([^"]*"([^%"]|"\n[^"]*")*"[,)]/p' \ | $(GREP) -vE 'VIR_ERROR' && \ - { echo '$(ME): found diagnostic without %' 1>&2; \ + { echo 'found diagnostic without %' 1>&2; \ exit 1; } || : =20 # The strings "" and "%s" should never be marked for translation. @@ -515,17 +511,17 @@ sc_require_whitespace_in_translation: @$(VC_LIST_EXCEPT) | xargs $(GREP) -n -A1 '"$$' /dev/null \ | $(SED) -ne ':l; /"$$/ {N;b l;}; s/"\n[^"]*"/""/g; s/\\n/ /g' \ -e '/_(.*[^\ ]""[^\ ]/p' | $(GREP) . && \ - { echo '$(ME): missing whitespace at line split' 1>&2; \ + { echo 'missing whitespace at line split' 1>&2; \ exit 1; } || : =20 # Enforce recommended preprocessor indentation style. sc_preprocessor_indentation: @if cppi --version >/dev/null 2>&1; then \ $(VC_LIST_EXCEPT) | $(GREP) -E '\.[ch](\.in)?$$' | xargs cppi -a -c \ - || { echo '$(ME): incorrect preprocessor indentation' 1>&2; \ + || { echo 'incorrect preprocessor indentation' 1>&2; \ exit 1; }; \ else \ - echo '$(ME): skipping test $@: cppi not installed' 1>&2; \ + echo 'skipping test $@: cppi not installed' 1>&2; \ fi =20 # Enforce similar spec file indentation style, by running cppi on a @@ -539,10 +535,10 @@ sc_spec_indentation: -e 's|^\( *[^#/ ]\)|// \1|; s|^\( */[^/]\)|// \1|' $$f \ | cppi -a -c 2>&1 | $(SED) "s|standard input|$$f|"; \ done | { if $(GREP) . >&2; then false; else :; fi; } \ - || { echo '$(ME): incorrect preprocessor indentation' 1>&2; \ + || { echo 'incorrect preprocessor indentation' 1>&2; \ exit 1; }; \ else \ - echo '$(ME): skipping test $@: cppi not installed' 1>&2; \ + echo 'skipping test $@: cppi not installed' 1>&2; \ fi =20 =20 @@ -601,7 +597,7 @@ sc_require_enum_last_marker: -e '/VIR_ENUM_IMPL[^,]*,[^,]*,[^,]*[^_,][^L,][^A,][^S,][^T,],/p' \ -e '/VIR_ENUM_IMPL[^,]*,[^,]\{0,4\},/p' \ | $(GREP) . && \ - { echo '$(ME): enum impl needs _LAST marker on second line' 1>&2; \ + { echo 'enum impl needs _LAST marker on second line' 1>&2; \ exit 1; } || : =20 # We're intentionally ignoring a few warnings @@ -623,7 +619,7 @@ sc_flake8: ALL_PY=3D$$(printf "%s\n%s" "$$DOT_PY" "$$BANG_PY" | sort -u); \ echo "$$ALL_PY" | xargs $(FLAKE8) --ignore $(FLAKE8_IGNORE) --show-sourc= e; \ else \ - echo '$(ME): skipping test $@: flake8 not installed' 1>&2; \ + echo 'skipping test $@: flake8 not installed' 1>&2; \ fi =20 # mymain() in test files should use return, not exit, for nicer output @@ -685,7 +681,7 @@ sc_prohibit_wrong_filename_in_comment: if (fail =3D=3D 1) { \ exit 1; \ } \ - }' || { echo '$(ME): The file name in comments must match the' \ + }' || { echo 'The file name in comments must match the' \ 'actual file name' 1>&2; exit 1; } =20 sc_prohibit_virConnectOpen_in_virsh: @@ -720,18 +716,18 @@ sc_curly_braces_style: @if $(VC_LIST_EXCEPT) | $(GREP) '\.[ch]$$' | xargs $(GREP) -nHP \ '^\s*(?!([a-zA-Z_]*for_?each[a-zA-Z_]*) ?\()([_a-zA-Z0-9]+( [_a-zA-Z0-9]+)= * ?\()?(\*?[_a-zA-Z0-9]+(,? \*?[_a-zA-Z0-9\[\]]+)+|void)\) ?\{' \ /dev/null; then \ - echo '$(ME): Non-K&R style used for curly braces around' \ + echo 'Non-K&R style used for curly braces around' \ 'function body' 1>&2; exit 1; \ fi; \ if $(VC_LIST_EXCEPT) | $(GREP) '\.[ch]$$' | xargs \ $(GREP) -A1 -En ' ((if|for|while|switch) \(|(else|do)\b)[^{]*$$' \ /dev/null | $(GREP) '^[^ ]*- *{'; then \ - echo '$(ME): Use hanging braces for compound statements' 1>&2; exit 1; \ + echo 'Use hanging braces for compound statements' 1>&2; exit 1; \ fi =20 sc_prohibit_windows_special_chars_in_filename: @$(VC_LIST_EXCEPT) | $(GREP) '[:*?"<>|]' && \ - { echo '$(ME): Windows special chars in filename not allowed' 1>&2; echo = exit 1; } || : + { echo 'Windows special chars in filename not allowed' 1>&2; echo exit 1;= } || : =20 sc_prohibit_mixed_case_abbreviations: @prohibit=3D'Pci|Usb|Scsi|Vpd' \ @@ -751,7 +747,7 @@ sc_prohibit_empty_first_line: FNR =3D=3D 1 { maybe_fail =3D $$0 =3D=3D ""; } \ FNR =3D=3D 2 { if (maybe_fail =3D=3D 1) { print FILENAME ":1:"; fail=3D1;= } } \ END { if (fail =3D=3D 1) { \ - print "$(ME): Prohibited empty first line" > "/dev/stderr"; \ + print "Prohibited empty first line" > "/dev/stderr"; \ } exit fail; }' =20 sc_prohibit_paren_brace: @@ -798,7 +794,7 @@ sc_prohibit_virSecurityManager: @$(VC_LIST_EXCEPT) | $(GREP) 'src/qemu/' | \ $(GREP) -v 'src/qemu/qemu_security' | \ xargs $(GREP) -Pn 'virSecurityManager\S*\(' /dev/null && \ - { echo '$(ME): prefer qemuSecurity wrappers' 1>&2; exit 1; } || : + { echo 'prefer qemuSecurity wrappers' 1>&2; exit 1; } || : =20 sc_prohibit_pthread_create: @prohibit=3D'\bpthread_create\b' \ @@ -1009,7 +1005,7 @@ _ignore_case =3D $$(test -n "$$ignore_case" && printf= %s -i || :) =20 define _sc_say_and_exit dummy=3D; : so we do not need a semicolon before each use; \ - { printf '%s\n' "$(ME): $$msg" 1>&2; exit 1; }; + { printf '%s\n' "$$msg" 1>&2; exit 1; }; endef =20 define _sc_search_regexp @@ -1120,7 +1116,7 @@ sc_error_message_warn_fatal: @$(VC_LIST_EXCEPT) \ | xargs $(GREP) -nEA2 '[^rp]error *\(' /dev/null \ | $(GREP) -E '"Warning|"Fatal|"fatal' \ - && { echo '$(ME): use FATAL, WARNING or warning' 1>&2; \ + && { echo 'use FATAL, WARNING or warning' 1>&2; \ exit 1; } \ || : =20 @@ -1129,7 +1125,7 @@ sc_error_message_period: @$(VC_LIST_EXCEPT) \ | xargs $(GREP) -nEA2 '[^rp]error *\(' /dev/null \ | $(GREP) -E '[^."]\."' \ - && { echo '$(ME): found error message ending in period' 1>&2; \ + && { echo 'found error message ending in period' 1>&2; \ exit 1; } \ || : =20 @@ -1169,7 +1165,7 @@ sc_require_config_h_first: @if $(VC_LIST_EXCEPT) | $(GREP) '\.c$$' > /dev/null; then \ files=3D$$($(VC_LIST_EXCEPT) | $(GREP) '\.c$$') && \ perl -n $(perl_config_h_first_) $$files || \ - { echo '$(ME): the above files include some other header' \ + { echo 'the above files include some other header' \ 'before ' 1>&2; exit 1; } || :; \ else :; \ fi @@ -1184,7 +1180,7 @@ define _sc_header_without_use files=3D$$($(GREP) -l '^# *include '"$$h_esc" \ $$($(VC_LIST_EXCEPT) | $(GREP) '\.c$$')) && \ $(GREP) -LE "$$re" $$files | $(GREP) . && \ - { echo "$(ME): the above files include $$h but don't use it" \ + { echo "the above files include $$h but don't use it" \ 1>&2; exit 1; } || :; \ else :; \ fi @@ -1285,7 +1281,7 @@ sc_prohibit_defined_have_decl_tests: # Prohibit checked in backup files. sc_prohibit_backup_files: @$(VC_LIST_EXCEPT) | $(GREP) '~$$' && \ - { echo '$(ME): found version controlled backup file' 1>&2; \ + { echo 'found version controlled backup file' 1>&2; \ exit 1; } || : =20 # This Perl code is slightly obfuscated. Not only is each "$" doubled @@ -1329,7 +1325,7 @@ require_exactly_one_NL_at_EOF_ =3D \ sc_prohibit_empty_lines_at_EOF: @$(VC_LIST_EXCEPT) \ | xargs perl -le '$(require_exactly_one_NL_at_EOF_)' \ - || { echo '$(ME): empty line(s) or no newline at EOF' 1>&2; \ + || { echo 'empty line(s) or no newline at EOF' 1>&2; \ exit 1; } \ || : =20 @@ -1364,7 +1360,7 @@ sc_prohibit_doubled_word: | xargs perl -n -0777 $(prohibit_doubled_word_) \ | $(GREP) -vE '$(ignore_doubled_word_match_RE_)' \ | $(GREP) . \ - && { echo '$(ME): doubled words' 1>&2; exit 1; } \ + && { echo 'doubled words' 1>&2; exit 1; } \ || : =20 # Except for shell files and for loops, double semicolon is probably a mis= take @@ -1447,7 +1443,7 @@ sc_po_check: | $(SED) 's|^$(_dot_escaped_srcdir)/||' \ | sort -u > $@-2; \ diff -u -L $(po_file) -L $(po_file) $@-1 $@-2 \ - || { printf '$(ME): '$(fix_po_file_diag) 1>&2; exit 1; }; \ + || { printf $(fix_po_file_diag) 1>&2; exit 1; }; \ rm -f $@-1 $@-2; \ fi =20 @@ -1501,7 +1497,7 @@ sc_prohibit-duplicate-header: sc_spacing-check: $(AM_V_GEN)$(VC_LIST_EXCEPT) | $(GREP) '\.c$$' | xargs \ $(PERL) $(top_srcdir)/build-aux/check-spacing.pl || \ - { echo '$(ME): incorrect formatting' 1>&2; exit 1; } + { echo 'incorrect formatting' 1>&2; exit 1; } =20 sc_mock-noinline: $(AM_V_GEN)$(VC_LIST_EXCEPT) | $(GREP) '\.[ch]$$' | $(RUNUTF8) \ --=20 2.35.3 From nobody Thu May 9 22:27:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1653327494; cv=none; d=zohomail.com; s=zohoarc; b=AtCLzHX48d275s2CLbDkZ06INJHzi0OdegBLYPsz9Jl0MXHTW6AD9arnCtC7+CT5UutVclFDXDjM/kFFmWpi8XS/K4wSkiC+bPq6YLa2sBM3ymP/1CD/WglL38ajhzRdWLsuwTK5Zm7MFUZaNPrxkoPrSSqekVcF+iLKe22LSh0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1653327494; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=wQ6XMz9q0dHpDy/FEmTc7uBzarYXjnnqJqvkHxe2nvI=; b=gX4Xh+yEi99mGv+JDQyEqz0y6QDACwIr9qKQtwD9QlWWUBENE6vVhSoiwDjLQo2dDAwrd26AfhFj/EUrklBN2WGmGFTUcw5176BsjNyEMSSC7uvj+IS4VSASCFlOOexBtpz1fzVGMWRXPRIW8jBIWTzVFbhQr/KTkS2cBJ83t/o= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1653327494670249.80968062899774; Mon, 23 May 2022 10:38:14 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-596-YMm0C_HBNWmuzHXRq1FVmA-1; Mon, 23 May 2022 13:38:12 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 98E311801389; Mon, 23 May 2022 17:38:06 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 82DC140C1257; Mon, 23 May 2022 17:38:06 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 46B6E1947062; Mon, 23 May 2022 17:38:06 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 039481947063 for ; Mon, 23 May 2022 17:38:04 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id DB10E112131E; Mon, 23 May 2022 17:38:03 +0000 (UTC) Received: from harajuku.usersys.redhat.com.homenet.telecomitalia.it (unknown [10.40.192.104]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6758E112131B for ; Mon, 23 May 2022 17:38:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1653327493; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=wQ6XMz9q0dHpDy/FEmTc7uBzarYXjnnqJqvkHxe2nvI=; b=P1yZWQcb0fTNCESIFV9RrGbzMtrrO9KIUwI049OK9YkZCYwkbyBeCdWUugsSTLpZU/B7QW 6TVYX7Bi3/IF6lzM9Z/yfEFARnrWWRFp98BG5rT5ZkURt4tcWJArvVRzeNxc33V55tE7mU GbOEr9rycADrFu6NsRtDMckeLfLeLU8= X-MC-Unique: YMm0C_HBNWmuzHXRq1FVmA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 09/13] syntax-check: Detect awk the same as all other programs Date: Mon, 23 May 2022 19:37:50 +0200 Message-Id: <20220523173754.336735-10-abologna@redhat.com> In-Reply-To: <20220523173754.336735-1-abologna@redhat.com> References: <20220523173754.336735-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1653327495675100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Andrea Bolognani Reviewed-by: Michal Privoznik --- build-aux/Makefile.in | 1 + build-aux/meson.build | 3 +++ build-aux/syntax-check.mk | 5 ----- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/build-aux/Makefile.in b/build-aux/Makefile.in index 9ccbec7b1b..7ee4680847 100644 --- a/build-aux/Makefile.in +++ b/build-aux/Makefile.in @@ -7,6 +7,7 @@ RUNUTF8 =3D @runutf8@ PYTHON =3D @PYTHON3@ GREP =3D @GREP@ SED =3D @SED@ +AWK =3D @AWK@ =20 # include syntax-check.mk file include $(top_srcdir)/build-aux/syntax-check.mk diff --git a/build-aux/meson.build b/build-aux/meson.build index bbfa27c4c6..96562a4f4a 100644 --- a/build-aux/meson.build +++ b/build-aux/meson.build @@ -26,6 +26,8 @@ else grep_prog =3D find_program('grep') endif =20 +awk_prog =3D find_program('awk') + syntax_check_conf =3D configuration_data({ 'top_srcdir': meson.source_root(), 'top_builddir': meson.build_root(), @@ -34,6 +36,7 @@ syntax_check_conf =3D configuration_data({ 'PYTHON3': python3_prog.path(), 'GREP': grep_prog.path(), 'SED': sed_prog.path(), + 'AWK': awk_prog.path(), }) =20 configure_file( diff --git a/build-aux/syntax-check.mk b/build-aux/syntax-check.mk index 4573655074..13f565d1b8 100644 --- a/build-aux/syntax-check.mk +++ b/build-aux/syntax-check.mk @@ -19,11 +19,6 @@ # along with this program. If not, see # . =20 -# These variables ought to be defined through the configure.ac section -# of the module description. But some packages import this file directly, -# ignoring the module description. -AWK ?=3D awk - # Helper variables. _empty =3D _sp =3D $(_empty) $(_empty) --=20 2.35.3 From nobody Thu May 9 22:27:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1653327544; cv=none; d=zohomail.com; s=zohoarc; b=lflO9uGa8PiPHABOlP2h8iGUv41qZqJza/BThmP2quMA8cKVK6zhjWI5V9tk7OoWav9jof0+bwX23kiVodtWn4Dn2BBXKxnhacG6+hOy3Wd3Fe6gVsZYteVd3IctiwWlGu6MPqvS1D8CHW+SSZb4fjkIQODktoSBE5AMJytevIw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1653327544; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=AJ+akFBXYWpwIiM9E2H0LXDZXlC5+q/pMKI8X6FGvRM=; b=RWNphy9HYL1h4FbcSbQDMEDqp2UlTFa5E7Gka0aOtvbjNqd9BGz0r1ogsIgFa/wT+bqmaRbSRTdOE14uLXJgnh2G4rtoIGkNwlBXlx5Jcn6MqRgZ6sp8tz7I5g9OzrdRWZUecKCKrNsfpAIZphqsFY7A031yNIjkXX6R1r/caL4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1653327544099881.9712052347786; Mon, 23 May 2022 10:39:04 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-175-BkTksZjpNSihEXbJSO1P5Q-1; Mon, 23 May 2022 13:38:14 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A4EFD1C05ED0; Mon, 23 May 2022 17:38:07 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8EC301415103; Mon, 23 May 2022 17:38:07 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 61D9B194705D; Mon, 23 May 2022 17:38:07 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id F05041947059 for ; Mon, 23 May 2022 17:38:04 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id CB7E3112131B; Mon, 23 May 2022 17:38:04 +0000 (UTC) Received: from harajuku.usersys.redhat.com.homenet.telecomitalia.it (unknown [10.40.192.104]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 32C98112131E for ; Mon, 23 May 2022 17:38:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1653327543; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=AJ+akFBXYWpwIiM9E2H0LXDZXlC5+q/pMKI8X6FGvRM=; b=Lodzi1almSxXDMKRUw87zeSuOj1G79Oh0qRBfgg7zAjIP+gmJ3YWTzpptysmmK7LV62mFG oKsBGRmIxyf+9lQO8sZ7NbM0WHEuhKKN4lDvdHDHbHhS7Eltc9Fmto8NnzXeWYAEzMGfb4 lefhML06FjHv8WEn5bq6ucR/NmlVz8w= X-MC-Unique: BkTksZjpNSihEXbJSO1P5Q-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 10/13] syntax-check: Reorganize file Date: Mon, 23 May 2022 19:37:51 +0200 Message-Id: <20220523173754.336735-11-abologna@redhat.com> In-Reply-To: <20220523173754.336735-1-abologna@redhat.com> References: <20220523173754.336735-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1653327546074100001 Content-Type: text/plain; charset="utf-8" Due to the way make works, we are not forced to follow a strict order in defining rules and variables. In fact _sc_search_regexp, which is used by all checks, is only defined halfway through the file. Shuffle things around so that the things that we need to look at the most frequently are closer to the top of the file. Signed-off-by: Andrea Bolognani Reviewed-by: Michal Privoznik --- build-aux/syntax-check.mk | 358 +++++++++++++++++++------------------- 1 file changed, 182 insertions(+), 176 deletions(-) diff --git a/build-aux/syntax-check.mk b/build-aux/syntax-check.mk index 13f565d1b8..a37e43b9f6 100644 --- a/build-aux/syntax-check.mk +++ b/build-aux/syntax-check.mk @@ -19,43 +19,10 @@ # along with this program. If not, see # . =20 -# Helper variables. -_empty =3D -_sp =3D $(_empty) $(_empty) - -VC_LIST =3D cd $(top_srcdir); git ls-tree -r 'HEAD:' | \ - sed -n "s|^100[^ ]*.||p" - -# This is to preprocess robustly the output of $(VC_LIST), so that even -# when $(top_srcdir) is a pathological name like "....", the leading sed c= ommand -# removes only the intended prefix. -_dot_escaped_srcdir =3D $(subst .,\.,$(top_srcdir)) -_dot_escaped_builddir =3D $(subst .,\.,$(top_builddir)) =20 -# Post-process $(VC_LIST) output, prepending $(top_srcdir)/, but only -# when $(top_srcdir) is not ".". -ifeq ($(top_srcdir),.) - _prepend_srcdir_prefix =3D -else - _prepend_srcdir_prefix =3D | $(SED) 's|^|$(top_srcdir)/|' -endif - -# In order to be able to consistently filter "."-relative names, -# (i.e., with no $(top_srcdir) prefix), this definition is careful to -# remove any $(top_srcdir) prefix, and to restore what it removes. -_sc_excl =3D \ - $(or $(exclude_file_name_regexp--$@),^$$) -VC_LIST_EXCEPT =3D \ - $(VC_LIST) | $(GREP) -Ev -e '($(VC_LIST_ALWAYS_EXCLUDE_REGEX)|$(_sc_excl= ))' \ - $(_prepend_srcdir_prefix) - -# Prevent programs like 'sort' from considering distinct strings to be equ= al. -# Doing it here saves us from having to set LC_ALL elsewhere in this file. -export LC_ALL =3D C - -## --------------- ## -## Sanity checks. ## -## --------------- ## +## ----- ## +## Rules ## +## ----- ## =20 # Files that should never cause syntax check failures. VC_LIST_ALWAYS_EXCLUDE_REGEX =3D \ @@ -927,143 +894,6 @@ sc_prohibit_dirent_d_type: halt=3D'do not use the d_type field in "struct dirent"' \ $(_sc_search_regexp) =20 - -# _sc_search_regexp -# -# This macro searches for a given construct in the selected files and -# then takes some action. -# -# Parameters (shell variables): -# -# prohibit | require -# -# Regular expression (ERE) denoting either a forbidden construct -# or a required construct. Those arguments are exclusive. -# -# exclude -# -# Regular expression (ERE) denoting lines to ignore that matched -# a prohibit construct. For example, this can be used to exclude -# comments that mention why the nearby code uses an alternative -# construct instead of the simpler prohibited construct. -# -# in_vc_files | in_files -# -# grep-E-style regexp selecting the files to check. For in_vc_files, -# the regexp is used to select matching files from the list of all -# version-controlled files; for in_files, it's from the names printed -# by "find $(top_srcdir)". When neither is specified, use all files t= hat -# are under version control. -# -# containing | non_containing -# -# Select the files (non) containing strings matching this regexp. -# If both arguments are specified then CONTAINING takes -# precedence. -# -# with_grep_options -# -# Extra options for grep. -# -# ignore_case -# -# Ignore case. -# -# halt -# -# Message to display before to halting execution. -# -# Finally, you may exempt files based on an ERE matching file names. -# For example, to exempt from the sc_space_tab check all files with the -# .diff suffix, set this Make variable: -# -# exclude_file_name_regexp--sc_space_tab =3D \.diff$ -# -# Note that while this functionality is mostly inherited via VC_LIST_EXCEP= T, -# when filtering by name via in_files, we explicitly filter out matching -# names here as well. - -# Initialize each, so that envvar settings cannot interfere. -export require =3D -export prohibit =3D -export exclude =3D -export in_vc_files =3D -export in_files =3D -export containing =3D -export non_containing =3D -export halt =3D -export with_grep_options =3D - -# By default, _sc_search_regexp does not ignore case. -export ignore_case =3D -_ignore_case =3D $$(test -n "$$ignore_case" && printf %s -i || :) - -define _sc_say_and_exit - dummy=3D; : so we do not need a semicolon before each use; \ - { printf '%s\n' "$$msg" 1>&2; exit 1; }; -endef - -define _sc_search_regexp - dummy=3D; : so we do not need a semicolon before each use; \ - \ - : Check arguments; \ - test -n "$$prohibit" && test -n "$$require" \ - && { msg=3D'Cannot specify both prohibit and require' \ - $(_sc_say_and_exit) } || :; \ - test -z "$$prohibit" && test -z "$$require" \ - && { msg=3D'Should specify either prohibit or require' \ - $(_sc_say_and_exit) } || :; \ - test -z "$$prohibit" && test -n "$$exclude" \ - && { msg=3D'Use of exclude requires a prohibit pattern' \ - $(_sc_say_and_exit) } || :; \ - test -n "$$in_vc_files" && test -n "$$in_files" \ - && { msg=3D'Cannot specify both in_vc_files and in_files' \ - $(_sc_say_and_exit) } || :; \ - test "x$$halt" !=3D x \ - || { msg=3D'halt not defined' $(_sc_say_and_exit) }; \ - \ - : Filter by file name; \ - if test -n "$$in_files"; then \ - files=3D$$(find $(top_srcdir) | $(GREP) -E "$$in_files" \ - | $(GREP) -Ev '$(_sc_excl)'); \ - else \ - files=3D$$($(VC_LIST_EXCEPT)); \ - if test -n "$$in_vc_files"; then \ - files=3D$$(echo "$$files" | $(GREP) -E "$$in_vc_files"); \ - fi; \ - fi; \ - \ - : Filter by content; \ - test -n "$$files" \ - && test -n "$$containing" \ - && { files=3D$$(echo "$$files" | xargs $(GREP) -l "$$containing"); } \ - || :; \ - test -n "$$files" \ - && test -n "$$non_containing" \ - && { files=3D$$(echo "$$files" | xargs $(GREP) -vl "$$non_containing"= ); } \ - || :; \ - \ - : Check for the construct; \ - if test -n "$$files"; then \ - if test -n "$$prohibit"; then \ - echo "$$files" \ - | xargs $(GREP) $$with_grep_options $(_ignore_case) -nE \ - "$$prohibit" /dev/null \ - | $(GREP) -vE "$${exclude:-^$$}" \ - && { msg=3D"$$halt" $(_sc_say_and_exit) } \ - || :; \ - else \ - echo "$$files" \ - | xargs \ - $(GREP) $$with_grep_options $(_ignore_case) -LE "$$require" \ - | $(GREP) . \ - && { msg=3D"$$halt" $(_sc_say_and_exit) } \ - || :; \ - fi \ - else :; \ - fi || :; -endef - sc_cast_of_argument_to_free: @prohibit=3D'\&2; exit 1; }; +endef + +define _sc_search_regexp + dummy=3D; : so we do not need a semicolon before each use; \ + \ + : Check arguments; \ + test -n "$$prohibit" && test -n "$$require" \ + && { msg=3D'Cannot specify both prohibit and require' \ + $(_sc_say_and_exit) } || :; \ + test -z "$$prohibit" && test -z "$$require" \ + && { msg=3D'Should specify either prohibit or require' \ + $(_sc_say_and_exit) } || :; \ + test -z "$$prohibit" && test -n "$$exclude" \ + && { msg=3D'Use of exclude requires a prohibit pattern' \ + $(_sc_say_and_exit) } || :; \ + test -n "$$in_vc_files" && test -n "$$in_files" \ + && { msg=3D'Cannot specify both in_vc_files and in_files' \ + $(_sc_say_and_exit) } || :; \ + test "x$$halt" !=3D x \ + || { msg=3D'halt not defined' $(_sc_say_and_exit) }; \ + \ + : Filter by file name; \ + if test -n "$$in_files"; then \ + files=3D$$(find $(top_srcdir) | $(GREP) -E "$$in_files" \ + | $(GREP) -Ev '$(_sc_excl)'); \ + else \ + files=3D$$($(VC_LIST_EXCEPT)); \ + if test -n "$$in_vc_files"; then \ + files=3D$$(echo "$$files" | $(GREP) -E "$$in_vc_files"); \ + fi; \ + fi; \ + \ + : Filter by content; \ + test -n "$$files" \ + && test -n "$$containing" \ + && { files=3D$$(echo "$$files" | xargs $(GREP) -l "$$containing"); } \ + || :; \ + test -n "$$files" \ + && test -n "$$non_containing" \ + && { files=3D$$(echo "$$files" | xargs $(GREP) -vl "$$non_containing"= ); } \ + || :; \ + \ + : Check for the construct; \ + if test -n "$$files"; then \ + if test -n "$$prohibit"; then \ + echo "$$files" \ + | xargs $(GREP) $$with_grep_options $(_ignore_case) -nE \ + "$$prohibit" /dev/null \ + | $(GREP) -vE "$${exclude:-^$$}" \ + && { msg=3D"$$halt" $(_sc_say_and_exit) } \ + || :; \ + else \ + echo "$$files" \ + | xargs \ + $(GREP) $$with_grep_options $(_ignore_case) -LE "$$require" \ + | $(GREP) . \ + && { msg=3D"$$halt" $(_sc_say_and_exit) } \ + || :; \ + fi \ + else :; \ + fi || :; +endef --=20 2.35.3 From nobody Thu May 9 22:27:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1653327496; cv=none; d=zohomail.com; s=zohoarc; b=ap7FZjLeS8r3ViISTdf4syjqwA5HXJNOWuHagxCntsnh5XTjwEm7zVWczFGVddUvYfoZEWKTOOqN9Swn+T5aLMLK128NxnXcKNEH+XH3AfCRx4aR6mYyF3IYu/2epr/2JueIOudjmgBS4tfQaMEgWQ8pGsPpRsqU5OKbW1odUaM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1653327496; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=M8nmSNxpRZlYroOoVa86qqVXVnHHv1VjuD02jnTZ+iM=; b=FJ6IteTFpwmr88un2RRRn5TVTiBKkvVIchP1vzCbxR8hsPoQ9rLWGN/1zTCHW81baoZUR4rBS6jQi5nV2oINu23cUF0QM03hT6cRfFsQ/ey/JESynH/ZvOjQDfbW3re7o5c38kPfmi+h3KGDbYGymaJLx5+S/hUo85QlVsha6k8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1653327496827910.669148216171; Mon, 23 May 2022 10:38:16 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-387-0koWXUrkPWaJrbsqoulnPA-1; Mon, 23 May 2022 13:38:14 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6A5DC1C05EC4; Mon, 23 May 2022 17:38:08 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5039240D2820; Mon, 23 May 2022 17:38:08 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 16718194706A; Mon, 23 May 2022 17:38:08 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id A05691947059 for ; Mon, 23 May 2022 17:38:05 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 964C3112131B; Mon, 23 May 2022 17:38:05 +0000 (UTC) Received: from harajuku.usersys.redhat.com.homenet.telecomitalia.it (unknown [10.40.192.104]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2300A112131E for ; Mon, 23 May 2022 17:38:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1653327495; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=M8nmSNxpRZlYroOoVa86qqVXVnHHv1VjuD02jnTZ+iM=; b=P1TQTvmMpqQomS+9MGKtX+5NwpbWWPdhaBvoAiP0NcfFsdozHLxQTcoGn1BYILQgDOd/4/ NRRYVaPmtyUpnV4lK1SVCA8NuMB0ZUoTXdlPXdb0+ZGo4jIQH8UoTqxQvEWQF2xt/HYF0z lZX6oByWhvBYMzXt+UX/VKJVYG7lCKk= X-MC-Unique: 0koWXUrkPWaJrbsqoulnPA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 11/13] syntax-check: Add all target Date: Mon, 23 May 2022 19:37:52 +0200 Message-Id: <20220523173754.336735-12-abologna@redhat.com> In-Reply-To: <20220523173754.336735-1-abologna@redhat.com> References: <20220523173754.336735-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1653327497693100003 Content-Type: text/plain; charset="utf-8" The makefile is an implementation detail, so point users towards the proper way of running syntax-check if they happen to call it directly. Signed-off-by: Andrea Bolognani Reviewed-by: Michal Privoznik --- build-aux/syntax-check.mk | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/build-aux/syntax-check.mk b/build-aux/syntax-check.mk index a37e43b9f6..b770e89efa 100644 --- a/build-aux/syntax-check.mk +++ b/build-aux/syntax-check.mk @@ -20,6 +20,11 @@ # . =20 =20 +all: + @echo "Do not call this file directly, use 'meson test' instead" >&2; \ + exit 1 + + ## ----- ## ## Rules ## ## ----- ## --=20 2.35.3 From nobody Thu May 9 22:27:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1653327554; cv=none; d=zohomail.com; s=zohoarc; b=ZvyspJiy5KV4ruuyxE4CpDdStKgxWdinbMwlAEpIECw+PTHo/NwMkhfWTbPaYm8ahTYYJpYJ++SHIgcF8zFerjw3GWnvHGPMXC1yy4p+uKOnPoAQPA9M7CYq2256sjW4uJTH4BteLH6WOrYNJ809ZTPRVz+K55QELxUdCaZPzYg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1653327554; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=l6b4j/SEBejS9458NJAsvCfEsz+kvyj927K2eXbiE4E=; b=OHrD8f8CW/r/3p6J1tViwvpEddqzrScEmMqisgOVIkJvB9Xn9jtIA95FrWSaEKS6FeZzAE+v4q3jn6tUL11vbUUtYVMGAhX19emAl0/sbwhnQevZHhrUX/5m8b23ohI+54k7kKv6Cc6Q7wRGWnzkhUeveFvSsLsWvVMI2tN3+Os= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1653327554815872.011990111103; Mon, 23 May 2022 10:39:14 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-479-1yKWuZm7Ptamzk_0QpPv-g-1; Mon, 23 May 2022 13:38:15 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3CACE85828B; Mon, 23 May 2022 17:38:12 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 26B562024CAE; Mon, 23 May 2022 17:38:12 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 02C7C194705D; Mon, 23 May 2022 17:38:12 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 7F533194706D for ; Mon, 23 May 2022 17:38:06 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 60AD21121320; Mon, 23 May 2022 17:38:06 +0000 (UTC) Received: from harajuku.usersys.redhat.com.homenet.telecomitalia.it (unknown [10.40.192.104]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E1654112131E for ; Mon, 23 May 2022 17:38:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1653327553; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=l6b4j/SEBejS9458NJAsvCfEsz+kvyj927K2eXbiE4E=; b=C2lpKt5Jrz7FKF5GNf61/iynVW1FLJPHHyUt6Tv5ts4grRm1c6iPIWbvIdG9hc8Jbb/TsN JJPc5icultOktteFrDRR2k1MrIu9OAcfGdI8Lw1yTZ680BfSRPaGCKVitc5PG/Z3/ViSCs MB7oUauUtx+W5h7h9nD+QARoBENOdpQ= X-MC-Unique: 1yKWuZm7Ptamzk_0QpPv-g-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 12/13] syntax-check: Drop sc_ prefix when adding checks to meson Date: Mon, 23 May 2022 19:37:53 +0200 Message-Id: <20220523173754.336735-13-abologna@redhat.com> In-Reply-To: <20220523173754.336735-1-abologna@redhat.com> References: <20220523173754.336735-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1653327556142100001 Content-Type: text/plain; charset="utf-8" All checks are added to the syntax-check suite, and this name is displayed prominently in the output of 'meson test', so there really is no need to include the sc_ prefix too. Signed-off-by: Andrea Bolognani Reviewed-by: Michal Privoznik --- build-aux/meson.build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build-aux/meson.build b/build-aux/meson.build index 96562a4f4a..fcd231a386 100644 --- a/build-aux/meson.build +++ b/build-aux/meson.build @@ -47,7 +47,7 @@ configure_file( =20 rc =3D run_command( 'sed', '-n', - 's/^\\(sc_[a-zA-Z0-9_-]*\\):.*/\\1/p', + 's/^sc_\\([a-zA-Z0-9_-]*\\):.*/\\1/p', meson.current_source_dir() / 'syntax-check.mk', check: true, ) @@ -62,7 +62,7 @@ if git test( target, make_prog, - args: [ '-C', meson.current_build_dir(), target ], + args: [ '-C', meson.current_build_dir(), 'sc_@0@'.format(target) ], depends: [ potfiles_dep, ], --=20 2.35.3 From nobody Thu May 9 22:27:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1653327497; cv=none; d=zohomail.com; s=zohoarc; b=GvYmQHSlM5YoE5L9YIabqAwfybZqJbkzph8Jap0WHV8bDSdJlUavjq/lC+KNfFzkRKbyDqlbpL1UBUjuUhnZ4Wfvh9TUH/v1D0uBCpBycZcA2tU9S1YaZdPxlEjwqt50DPY4DluaKRsXny0zdoAJuYeafhAmDxD9ublKA9eZ9wg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1653327497; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=u4eYRDZ0lU6tiF88S9cLaJzQKO8uoh8KfU7Gyi2/m5E=; b=GQxMKAznONoxDYvCEq8rcfvqesEJff4DGq+oRWL/7omj2zFyc7g6ux05gIQchM110ZQCnTYY1o8YbnR6n2zHpPhdDAWoQoC5n2KlymmytGju9oFveo/X1EZiJFvlo5vZcl/C5moBu+gDIcykxM9F+6aju25l0IKwTSQM7n9y2CM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1653327497641833.105982968025; Mon, 23 May 2022 10:38:17 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-364-ev1n9vMINt-6-SSHdePR9w-1; Mon, 23 May 2022 13:38:14 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A1D2F802A5B; Mon, 23 May 2022 17:38:11 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 87D7D2166B25; Mon, 23 May 2022 17:38:11 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 4D032194705A; Mon, 23 May 2022 17:38:11 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 66A7F194706A for ; Mon, 23 May 2022 17:38:07 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 52320111F3B6; Mon, 23 May 2022 17:38:07 +0000 (UTC) Received: from harajuku.usersys.redhat.com.homenet.telecomitalia.it (unknown [10.40.192.104]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AC94B112131E for ; Mon, 23 May 2022 17:38:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1653327496; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=u4eYRDZ0lU6tiF88S9cLaJzQKO8uoh8KfU7Gyi2/m5E=; b=T73x6teKpPvACKzGIshiKgbJ+3E/C8wfdr9sHpBsRFva+VhGyOl3R+Cn8vpjBz0WPOIV6Q +L0hGYvpfS5YgAxkqeOYGBi1uHzGjoUK/YpUFUow773p0pLdWCpU93cftZtVjazDrJT97/ tLcqy25lFiYOLS4VnVR1eDNbZgewQaw= X-MC-Unique: ev1n9vMINt-6-SSHdePR9w-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 13/13] syntax-check: Enforce sc_prohibit_backslash_alignment everywhere Date: Mon, 23 May 2022 19:37:54 +0200 Message-Id: <20220523173754.336735-14-abologna@redhat.com> In-Reply-To: <20220523173754.336735-1-abologna@redhat.com> References: <20220523173754.336735-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1653327499794100001 Content-Type: text/plain; charset="utf-8" Basically all files in the repository are already passing the check, except for syntax-check.mk itself. Fix that, and stop limiting the files on which the test is performed. These changes have been generated by running $ sed -Ei 's/[ '$'\t'']+\\$/ \\/g' $(git grep -El '[ '$'\t'']+\\$') Signed-off-by: Andrea Bolognani Reviewed-by: Michal Privoznik --- build-aux/syntax-check.mk | 416 +++++++++++++++++++------------------- ci/Makefile | 2 +- 2 files changed, 207 insertions(+), 211 deletions(-) diff --git a/build-aux/syntax-check.mk b/build-aux/syntax-check.mk index b770e89efa..0b832706ba 100644 --- a/build-aux/syntax-check.mk +++ b/build-aux/syntax-check.mk @@ -863,7 +863,6 @@ sc_prohibit_author: # or tabs (at least one of them) right before the trailing backslash sc_prohibit_backslash_alignment: @prohibit=3D'( | )\\$$' \ - in_vc_files=3D'*\.([chx]|am|mk)$$' \ halt=3D'Do not attempt to right-align backslashes' \ $(_sc_search_regexp) =20 @@ -900,28 +899,28 @@ sc_prohibit_dirent_d_type: $(_sc_search_regexp) =20 sc_cast_of_argument_to_free: - @prohibit=3D'\' \ - halt=3D"don't cast x*alloc return value" \ + @prohibit=3D'\*\) *x(m|c|re)alloc\>' \ + halt=3D"don't cast x*alloc return value" \ $(_sc_search_regexp) =20 # Use STREQ rather than comparing strcmp =3D=3D 0, or !=3D 0. sp_ =3D strcmp *\(.+\) sc_prohibit_strcmp: - @prohibit=3D'! *strcmp *\(|\<$(sp_) *[!=3D]=3D|[!=3D]=3D *$(sp_)' \ - exclude=3D'# *define STRN?EQ\(' \ - halt=3D'replace strcmp calls above with STREQ/STRNEQ' \ + @prohibit=3D'! *strcmp *\(|\<$(sp_) *[!=3D]=3D|[!=3D]=3D *$(sp_)' \ + exclude=3D'# *define STRN?EQ\(' \ + halt=3D'replace strcmp calls above with STREQ/STRNEQ' \ $(_sc_search_regexp) =20 # Really. You don't want to use this function. # It may fail to NUL-terminate the destination, # and always NUL-pads out to the specified length. sc_prohibit_strncpy: - @prohibit=3D'\&2; \ - exit 1; } \ + @$(VC_LIST_EXCEPT) \ + | xargs $(GREP) -nEA2 '[^rp]error *\(' /dev/null \ + | $(GREP) -E '"Warning|"Fatal|"fatal' \ + && { echo 'use FATAL, WARNING or warning' 1>&2; \ + exit 1; } \ || : =20 # Error messages should not end with a period sc_error_message_period: - @$(VC_LIST_EXCEPT) \ - | xargs $(GREP) -nEA2 '[^rp]error *\(' /dev/null \ - | $(GREP) -E '[^."]\."' \ - && { echo 'found error message ending in period' 1>&2; \ - exit 1; } \ + @$(VC_LIST_EXCEPT) \ + | xargs $(GREP) -nEA2 '[^rp]error *\(' /dev/null \ + | $(GREP) -E '[^."]\."' \ + && { echo 'found error message ending in period' 1>&2; \ + exit 1; } \ || : =20 # Don't use cpp tests of this symbol. All code assumes config.h is includ= ed. sc_prohibit_have_config_h: - @prohibit=3D'^# *if.*HAVE''_CONFIG_H' \ - halt=3D'found use of HAVE''_CONFIG_H; remove' \ + @prohibit=3D'^# *if.*HAVE''_CONFIG_H' \ + halt=3D'found use of HAVE''_CONFIG_H; remove' \ $(_sc_search_regexp) =20 # Nearly all .c files must include . However, we also permit th= is @@ -970,49 +969,49 @@ sc_prohibit_have_config_h: # config_h_header must be suitable for grep -E. config_h_header ?=3D sc_require_config_h: - @require=3D'^# *include $(config_h_header)' \ - in_vc_files=3D'\.c$$' \ - halt=3D'the above files do not include ' \ + @require=3D'^# *include $(config_h_header)' \ + in_vc_files=3D'\.c$$' \ + halt=3D'the above files do not include ' \ $(_sc_search_regexp) =20 # Print each file name for which the first #include does not match # $(config_h_header). Like grep -m 1, this only looks at the first match. -perl_config_h_first_ =3D \ - -e 'BEGIN {$$ret =3D 0}' \ - -e 'if (/^\# *include\b/) {' \ - -e ' if (not m{^\# *include $(config_h_header)}) {' \ - -e ' print "$$ARGV\n";' \ - -e ' $$ret =3D 1;' \ - -e ' }' \ - -e ' \# Move on to next file after first include' \ - -e ' close ARGV;' \ - -e '}' \ +perl_config_h_first_ =3D \ + -e 'BEGIN {$$ret =3D 0}' \ + -e 'if (/^\# *include\b/) {' \ + -e ' if (not m{^\# *include $(config_h_header)}) {' \ + -e ' print "$$ARGV\n";' \ + -e ' $$ret =3D 1;' \ + -e ' }' \ + -e ' \# Move on to next file after first include' \ + -e ' close ARGV;' \ + -e '}' \ -e 'END {exit $$ret}' =20 # You must include before including any other header file. # This can possibly be via a package-specific header, if given by syntax-c= heck.mk. sc_require_config_h_first: - @if $(VC_LIST_EXCEPT) | $(GREP) '\.c$$' > /dev/null; then \ - files=3D$$($(VC_LIST_EXCEPT) | $(GREP) '\.c$$') && \ - perl -n $(perl_config_h_first_) $$files || \ - { echo 'the above files include some other header' \ - 'before ' 1>&2; exit 1; } || :; \ - else :; \ + @if $(VC_LIST_EXCEPT) | $(GREP) '\.c$$' > /dev/null; then \ + files=3D$$($(VC_LIST_EXCEPT) | $(GREP) '\.c$$') && \ + perl -n $(perl_config_h_first_) $$files || \ + { echo 'the above files include some other header' \ + 'before ' 1>&2; exit 1; } || :; \ + else :; \ fi =20 # To use this "command" macro, you must first define two shell variables: # h: the header name, with no enclosing <> or "" # re: a regular expression that matches IFF something provided by $h is us= ed. define _sc_header_without_use - dummy=3D; : so we do not need a semicolon before each use; \ - h_esc=3D`echo '[<"]'"$$h"'[">]'|$(SED) 's/\./\\\\./g'`; \ - if $(VC_LIST_EXCEPT) | $(GREP) '\.c$$' > /dev/null; then \ - files=3D$$($(GREP) -l '^# *include '"$$h_esc" \ - $$($(VC_LIST_EXCEPT) | $(GREP) '\.c$$')) && \ - $(GREP) -LE "$$re" $$files | $(GREP) . && \ - { echo "the above files include $$h but don't use it" \ - 1>&2; exit 1; } || :; \ - else :; \ + dummy=3D; : so we do not need a semicolon before each use; \ + h_esc=3D`echo '[<"]'"$$h"'[">]'|$(SED) 's/\./\\\\./g'`; \ + if $(VC_LIST_EXCEPT) | $(GREP) '\.c$$' > /dev/null; then \ + files=3D$$($(GREP) -l '^# *include '"$$h_esc" \ + $$($(VC_LIST_EXCEPT) | $(GREP) '\.c$$')) && \ + $(GREP) -LE "$$re" $$files | $(GREP) . && \ + { echo "the above files include $$h but don't use it" \ + 1>&2; exit 1; } || :; \ + else :; \ fi endef =20 @@ -1034,41 +1033,41 @@ _sig_functions =3D \ sigrelse sigset sigsuspend sigtimedwait sigwait sigwaitinfo _sig_function_re =3D $(subst $(_sp),|,$(strip $(_sig_functions))) # The following were extracted from "man signal.h" manually. -_sig_types_and_consts =3D \ - MINSIGSTKSZ SA_NOCLDSTOP SA_NOCLDWAIT SA_NODEFER SA_ONSTACK \ - SA_RESETHAND SA_RESTART SA_SIGINFO SIGEV_NONE SIGEV_SIGNAL \ - SIGEV_THREAD SIGSTKSZ SIG_BLOCK SIG_SETMASK SIG_UNBLOCK SS_DISABLE \ - SS_ONSTACK mcontext_t pid_t sig_atomic_t sigevent siginfo_t sigset_t \ +_sig_types_and_consts =3D \ + MINSIGSTKSZ SA_NOCLDSTOP SA_NOCLDWAIT SA_NODEFER SA_ONSTACK \ + SA_RESETHAND SA_RESTART SA_SIGINFO SIGEV_NONE SIGEV_SIGNAL \ + SIGEV_THREAD SIGSTKSZ SIG_BLOCK SIG_SETMASK SIG_UNBLOCK SS_DISABLE \ + SS_ONSTACK mcontext_t pid_t sig_atomic_t sigevent siginfo_t sigset_t \ sigstack sigval stack_t ucontext_t # generated via this: # perl -lne '/^#ifdef (SIG\w+)/ and print $1' lib/sig2str.c|sort -u|fmt -70 -_sig_names =3D \ - SIGABRT SIGALRM SIGALRM1 SIGBUS SIGCANCEL SIGCHLD SIGCLD SIGCONT \ - SIGDANGER SIGDIL SIGEMT SIGFPE SIGFREEZE SIGGRANT SIGHUP SIGILL \ - SIGINFO SIGINT SIGIO SIGIOT SIGKAP SIGKILL SIGKILLTHR SIGLOST SIGLWP \ - SIGMIGRATE SIGMSG SIGPHONE SIGPIPE SIGPOLL SIGPRE SIGPROF SIGPWR \ - SIGQUIT SIGRETRACT SIGSAK SIGSEGV SIGSOUND SIGSTKFLT SIGSTOP SIGSYS \ - SIGTERM SIGTHAW SIGTRAP SIGTSTP SIGTTIN SIGTTOU SIGURG SIGUSR1 \ - SIGUSR2 SIGVIRT SIGVTALRM SIGWAITING SIGWINCH SIGWIND SIGWINDOW \ +_sig_names =3D \ + SIGABRT SIGALRM SIGALRM1 SIGBUS SIGCANCEL SIGCHLD SIGCLD SIGCONT \ + SIGDANGER SIGDIL SIGEMT SIGFPE SIGFREEZE SIGGRANT SIGHUP SIGILL \ + SIGINFO SIGINT SIGIO SIGIOT SIGKAP SIGKILL SIGKILLTHR SIGLOST SIGLWP \ + SIGMIGRATE SIGMSG SIGPHONE SIGPIPE SIGPOLL SIGPRE SIGPROF SIGPWR \ + SIGQUIT SIGRETRACT SIGSAK SIGSEGV SIGSOUND SIGSTKFLT SIGSTOP SIGSYS \ + SIGTERM SIGTHAW SIGTRAP SIGTSTP SIGTTIN SIGTTOU SIGURG SIGUSR1 \ + SIGUSR2 SIGVIRT SIGVTALRM SIGWAITING SIGWINCH SIGWIND SIGWINDOW \ SIGXCPU SIGXFSZ _sig_syms_re =3D $(subst $(_sp),|,$(strip $(_sig_names) $(_sig_types_and_c= onsts))) =20 # Prohibit the inclusion of signal.h without an actual use. sc_prohibit_signal_without_use: - @h=3D'signal.h' \ - re=3D'\<($(_sig_function_re)) *\(|\<($(_sig_syms_re))\>' \ + @h=3D'signal.h' \ + re=3D'\<($(_sig_function_re)) *\(|\<($(_sig_syms_re))\>' \ $(_sc_header_without_use) =20 # Don't include stdio--.h unless you use one of its functions. sc_prohibit_stdio--_without_use: - @h=3D'stdio--.h' re=3D'\<((f(re)?|p)open|tmpfile) *\(' \ + @h=3D'stdio--.h' re=3D'\<((f(re)?|p)open|tmpfile) *\(' \ $(_sc_header_without_use) =20 _stddef_syms_re =3D NULL|offsetof|ptrdiff_t|size_t|wchar_t # Prohibit the inclusion of stddef.h without an actual use. sc_prohibit_stddef_without_use: - @h=3D'stddef.h' \ - re=3D'\<($(_stddef_syms_re))\>' \ + @h=3D'stddef.h' \ + re=3D'\<($(_stddef_syms_re))\>' \ $(_sc_header_without_use) =20 _de1 =3D dirfd|(close|(fd)?open|read|rewind|seek|tell)dir(64)?(_r)? @@ -1077,14 +1076,14 @@ _de3 =3D MAXNAMLEN|DIR|ino_t|d_ino|d_fileno|d_namlen _dirent_syms_re =3D $(_de1)|$(_de2)|$(_de3) # Prohibit the inclusion of dirent.h without an actual use. sc_prohibit_dirent_without_use: - @h=3D'dirent.h' \ - re=3D'\<($(_dirent_syms_re))\>' \ + @h=3D'dirent.h' \ + re=3D'\<($(_dirent_syms_re))\>' \ $(_sc_header_without_use) =20 sc_trailing_blank: - @prohibit=3D'[ ]$$' \ - halt=3D'found trailing blank(s)' \ - exclude=3D'^Binary file .* matches$$' \ + @prohibit=3D'[ ]$$' \ + halt=3D'found trailing blank(s)' \ + exclude=3D'^Binary file .* matches$$' \ $(_sc_search_regexp) =20 =20 @@ -1096,20 +1095,20 @@ _gl_translatable_diag_func_re ?=3D error # This won't find any for which error's format string is on a separate lin= e. sc_unmarked_diagnostics: @prohibit=3D'\<$(_gl_translatable_diag_func_re) *\([^"]*"[^"]*[a-z]{3}' \ - exclude=3D'(_|ngettext ?)\(' \ - halt=3D'found unmarked diagnostic(s)' \ + exclude=3D'(_|ngettext ?)\(' \ + halt=3D'found unmarked diagnostic(s)' \ $(_sc_search_regexp) =20 =20 sc_prohibit_defined_have_decl_tests: - @prohibit=3D'(#[ ]*ifn?def|\[ (]+WITH_DECL_' \ - halt=3D'WITH_DECL macros are always defined' \ + @prohibit=3D'(#[ ]*ifn?def|\[ (]+WITH_DECL_' \ + halt=3D'WITH_DECL macros are always defined' \ $(_sc_search_regexp) =20 # Prohibit checked in backup files. sc_prohibit_backup_files: @$(VC_LIST_EXCEPT) | $(GREP) '~$$' && \ - { echo 'found version controlled backup file' 1>&2; \ + { echo 'found version controlled backup file' 1>&2; \ exit 1; } || : =20 # This Perl code is slightly obfuscated. Not only is each "$" doubled @@ -1135,36 +1134,36 @@ sc_prohibit_backup_files: # Use this if you want to remove trailing empty lines from selected files: # perl -pi -0777 -e 's/\n\n+$/\n/' files... # -require_exactly_one_NL_at_EOF_ =3D \ - foreach my $$f (@ARGV) \ - { \ - open F, "<", $$f or (warn "failed to open $$f: $$!\n"), next; \ - my $$p =3D sysseek (F, -2, 2); \ +require_exactly_one_NL_at_EOF_ =3D \ + foreach my $$f (@ARGV) \ + { \ + open F, "<", $$f or (warn "failed to open $$f: $$!\n"), next; \ + my $$p =3D sysseek (F, -2, 2); \ my $$c =3D "seek failure probably means file has < 2 bytes; ignore";= \ - my $$last_two_bytes; \ - defined $$p and $$p =3D sysread F, $$last_two_bytes, 2; \ - close F; \ - $$c =3D "ignore read failure"; \ - $$p && ($$last_two_bytes eq "\n\n" \ - || substr ($$last_two_bytes,1) ne "\n") \ - and (print $$f), $$fail=3D1; \ - } \ + my $$last_two_bytes; \ + defined $$p and $$p =3D sysread F, $$last_two_bytes, 2; \ + close F; \ + $$c =3D "ignore read failure"; \ + $$p && ($$last_two_bytes eq "\n\n" \ + || substr ($$last_two_bytes,1) ne "\n") \ + and (print $$f), $$fail=3D1; \ + } \ END { exit defined $$fail } sc_prohibit_empty_lines_at_EOF: - @$(VC_LIST_EXCEPT) \ - | xargs perl -le '$(require_exactly_one_NL_at_EOF_)' \ - || { echo 'empty line(s) or no newline at EOF' 1>&2; \ - exit 1; } \ + @$(VC_LIST_EXCEPT) \ + | xargs perl -le '$(require_exactly_one_NL_at_EOF_)' \ + || { echo 'empty line(s) or no newline at EOF' 1>&2; \ + exit 1; } \ || : =20 =20 # Perl block to convert a match to FILE_NAME:LINENO:TEST, # that is shared by two definitions below. -perl_filename_lineno_text_ =3D \ - -e ' {' \ - -e ' $$n =3D ($$` =3D~ tr/\n/\n/ + 1);' \ - -e ' ($$v =3D $$&) =3D~ s/\n/\\n/g;' \ - -e ' print "$$ARGV:$$n:$$v\n";' \ +perl_filename_lineno_text_ =3D \ + -e ' {' \ + -e ' $$n =3D ($$` =3D~ tr/\n/\n/ + 1);' \ + -e ' ($$v =3D $$&) =3D~ s/\n/\\n/g;' \ + -e ' print "$$ARGV:$$n:$$v\n";' \ -e ' }' =20 prohibit_doubled_words_ =3D \ @@ -1174,8 +1173,8 @@ prohibit_doubled_word_expanded_ =3D \ $(join $(prohibit_doubled_words_),$(addprefix \s+,$(prohibit_doubled_w= ords_))) prohibit_doubled_word_RE_ ?=3D \ /\b(?:$(subst $(_sp),|,$(prohibit_doubled_word_expanded_)))\b/gims -prohibit_doubled_word_ =3D \ - -e 'while ($(prohibit_doubled_word_RE_))' \ +prohibit_doubled_word_ =3D \ + -e 'while ($(prohibit_doubled_word_RE_))' \ $(perl_filename_lineno_text_) =20 # Define this to a regular expression that matches @@ -1184,19 +1183,19 @@ prohibit_doubled_word_ =3D \ ignore_doubled_word_match_RE_ ?=3D ^$$ =20 sc_prohibit_doubled_word: - @$(VC_LIST_EXCEPT) \ - | xargs perl -n -0777 $(prohibit_doubled_word_) \ - | $(GREP) -vE '$(ignore_doubled_word_match_RE_)' \ - | $(GREP) . \ - && { echo 'doubled words' 1>&2; exit 1; } \ + @$(VC_LIST_EXCEPT) \ + | xargs perl -n -0777 $(prohibit_doubled_word_) \ + | $(GREP) -vE '$(ignore_doubled_word_match_RE_)' \ + | $(GREP) . \ + && { echo 'doubled words' 1>&2; exit 1; } \ || : =20 # Except for shell files and for loops, double semicolon is probably a mis= take sc_prohibit_double_semicolon: - @prohibit=3D'; *;[ {} \]*(/[/*]|$$)' \ - in_vc_files=3D'\.[chly]$$' \ - exclude=3D'\bfor *\(.*\)' \ - halt=3D"Double semicolon detected" \ + @prohibit=3D'; *;[ {} \]*(/[/*]|$$)' \ + in_vc_files=3D'\.[chly]$$' \ + exclude=3D'\bfor *\(.*\)' \ + halt=3D"Double semicolon detected" \ $(_sc_search_regexp) =20 _ptm1 =3D use "test C1 && test C2", not "test C1 -''a C2" @@ -1204,29 +1203,29 @@ _ptm2 =3D use "test C1 || test C2", not "test C1 -'= 'o C2" # Using test's -a and -o operators is not portable. # We prefer test over [, since the latter is spelled [[ in configure.ac. sc_prohibit_test_minus_ao: - @prohibit=3D'(\ $@-1; \ - { $(VC_LIST_EXCEPT); echo $(generated_files); } \ - | xargs perl $(perl_translatable_files_list_) \ - | xargs $(GREP) -E -l '$(_gl_translatable_string_re)' \ + { $(VC_LIST_EXCEPT); echo $(generated_files); } \ + | xargs perl $(perl_translatable_files_list_) \ + | xargs $(GREP) -E -l '$(_gl_translatable_string_re)' \ | $(SED) 's|^$(_dot_escaped_builddir)/||' \ | $(SED) 's|^$(_dot_escaped_srcdir)/||' \ - | sort -u > $@-2; \ - diff -u -L $(po_file) -L $(po_file) $@-1 $@-2 \ - || { printf $(fix_po_file_diag) 1>&2; exit 1; }; \ - rm -f $@-1 $@-2; \ + | sort -u > $@-2; \ + diff -u -L $(po_file) -L $(po_file) $@-1 $@-2 \ + || { printf $(fix_po_file_diag) 1>&2; exit 1; }; \ + rm -f $@-1 $@-2; \ fi =20 linguas_file =3D $(top_srcdir)/po/LINGUAS @@ -1288,17 +1287,17 @@ sc_linguas_sorting: # tests many undefined macros, and so we can't enable that option. # So at least preclude common boolean strings as macro values. sc_Wundef_boolean: - @prohibit=3D'^#define.*(yes|no|true|false)$$' \ - in_files=3D'$(CONFIG_INCLUDE)' \ - halt=3D'Use 0 or 1 for macro values' \ + @prohibit=3D'^#define.*(yes|no|true|false)$$' \ + in_files=3D'$(CONFIG_INCLUDE)' \ + halt=3D'Use 0 or 1 for macro values' \ $(_sc_search_regexp) =20 # Even if you use pathmax.h to guarantee that PATH_MAX is defined, it might # not be constant, or might overflow a stack. In general, use PATH_MAX as # a limit, not an array or alloca size. sc_prohibit_path_max_allocation: - @prohibit=3D'(\balloca *\([^)]*|\[[^]]*)\bPATH_MAX' \ - halt=3D'Avoid stack allocations of size PATH_MAX' \ + @prohibit=3D'(\balloca *\([^)]*|\[[^]]*)\bPATH_MAX' \ + halt=3D'Avoid stack allocations of size PATH_MAX' \ $(_sc_search_regexp) =20 ifneq ($(_gl-Makefile),) @@ -1340,9 +1339,9 @@ sc_group-qemu-caps: --check --prefix $(top_srcdir)/ =20 sc_prohibit_enum_impl_with_vir_prefix_in_virsh: - @prohibit=3D'VIR_ENUM_(IMPL|DECL)\(vir[^s]' \ - in_vc_files=3D'tools/virsh.*\.[ch]$$' \ - halt=3D'avoid "vir" prefix for enums in virsh' \ + @prohibit=3D'VIR_ENUM_(IMPL|DECL)\(vir[^s]' \ + in_vc_files=3D'tools/virsh.*\.[ch]$$' \ + halt=3D'avoid "vir" prefix for enums in virsh' \ $(_sc_search_regexp) =20 =20 @@ -1487,9 +1486,6 @@ exclude_file_name_regexp--sc_prohibit_dirent_d_type = =3D \ exclude_file_name_regexp--sc_prohibit_strcmp =3D \ ^(tools/nss/libvirt_nss.*\.c|tools/virt-login-shell\.c) =20 -exclude_file_name_regexp--sc_prohibit_backslash_alignment =3D \ - ^build-aux/syntax-check\.mk$$ - exclude_file_name_regexp--sc_prohibit_select =3D \ ^build-aux/syntax-check\.mk|src/util/vireventglibwatch\.c|tests/meson\.b= uild$$ =20 @@ -1603,67 +1599,67 @@ export ignore_case =3D _ignore_case =3D $$(test -n "$$ignore_case" && printf %s -i || :) =20 define _sc_say_and_exit - dummy=3D; : so we do not need a semicolon before each use; \ + dummy=3D; : so we do not need a semicolon before each use; \ { printf '%s\n' "$$msg" 1>&2; exit 1; }; endef =20 define _sc_search_regexp - dummy=3D; : so we do not need a semicolon before each use; \ - \ - : Check arguments; \ - test -n "$$prohibit" && test -n "$$require" \ - && { msg=3D'Cannot specify both prohibit and require' \ - $(_sc_say_and_exit) } || :; \ - test -z "$$prohibit" && test -z "$$require" \ - && { msg=3D'Should specify either prohibit or require' \ - $(_sc_say_and_exit) } || :; \ - test -z "$$prohibit" && test -n "$$exclude" \ - && { msg=3D'Use of exclude requires a prohibit pattern' \ - $(_sc_say_and_exit) } || :; \ - test -n "$$in_vc_files" && test -n "$$in_files" \ - && { msg=3D'Cannot specify both in_vc_files and in_files' \ - $(_sc_say_and_exit) } || :; \ - test "x$$halt" !=3D x \ - || { msg=3D'halt not defined' $(_sc_say_and_exit) }; \ - \ - : Filter by file name; \ - if test -n "$$in_files"; then \ - files=3D$$(find $(top_srcdir) | $(GREP) -E "$$in_files" \ - | $(GREP) -Ev '$(_sc_excl)'); \ - else \ - files=3D$$($(VC_LIST_EXCEPT)); \ - if test -n "$$in_vc_files"; then \ - files=3D$$(echo "$$files" | $(GREP) -E "$$in_vc_files"); \ - fi; \ - fi; \ - \ - : Filter by content; \ - test -n "$$files" \ - && test -n "$$containing" \ - && { files=3D$$(echo "$$files" | xargs $(GREP) -l "$$containing"); } \ - || :; \ - test -n "$$files" \ - && test -n "$$non_containing" \ + dummy=3D; : so we do not need a semicolon before each use; \ + \ + : Check arguments; \ + test -n "$$prohibit" && test -n "$$require" \ + && { msg=3D'Cannot specify both prohibit and require' \ + $(_sc_say_and_exit) } || :; \ + test -z "$$prohibit" && test -z "$$require" \ + && { msg=3D'Should specify either prohibit or require' \ + $(_sc_say_and_exit) } || :; \ + test -z "$$prohibit" && test -n "$$exclude" \ + && { msg=3D'Use of exclude requires a prohibit pattern' \ + $(_sc_say_and_exit) } || :; \ + test -n "$$in_vc_files" && test -n "$$in_files" \ + && { msg=3D'Cannot specify both in_vc_files and in_files' \ + $(_sc_say_and_exit) } || :; \ + test "x$$halt" !=3D x \ + || { msg=3D'halt not defined' $(_sc_say_and_exit) }; \ + \ + : Filter by file name; \ + if test -n "$$in_files"; then \ + files=3D$$(find $(top_srcdir) | $(GREP) -E "$$in_files" \ + | $(GREP) -Ev '$(_sc_excl)'); \ + else \ + files=3D$$($(VC_LIST_EXCEPT)); \ + if test -n "$$in_vc_files"; then \ + files=3D$$(echo "$$files" | $(GREP) -E "$$in_vc_files"); \ + fi; \ + fi; \ + \ + : Filter by content; \ + test -n "$$files" \ + && test -n "$$containing" \ + && { files=3D$$(echo "$$files" | xargs $(GREP) -l "$$containing"); } \ + || :; \ + test -n "$$files" \ + && test -n "$$non_containing" \ && { files=3D$$(echo "$$files" | xargs $(GREP) -vl "$$non_containing"= ); } \ - || :; \ - \ - : Check for the construct; \ - if test -n "$$files"; then \ - if test -n "$$prohibit"; then \ - echo "$$files" \ - | xargs $(GREP) $$with_grep_options $(_ignore_case) -nE \ - "$$prohibit" /dev/null \ - | $(GREP) -vE "$${exclude:-^$$}" \ - && { msg=3D"$$halt" $(_sc_say_and_exit) } \ - || :; \ - else \ - echo "$$files" \ - | xargs \ + || :; \ + \ + : Check for the construct; \ + if test -n "$$files"; then \ + if test -n "$$prohibit"; then \ + echo "$$files" \ + | xargs $(GREP) $$with_grep_options $(_ignore_case) -nE \ + "$$prohibit" /dev/null \ + | $(GREP) -vE "$${exclude:-^$$}" \ + && { msg=3D"$$halt" $(_sc_say_and_exit) } \ + || :; \ + else \ + echo "$$files" \ + | xargs \ $(GREP) $$with_grep_options $(_ignore_case) -LE "$$require" \ - | $(GREP) . \ - && { msg=3D"$$halt" $(_sc_say_and_exit) } \ - || :; \ - fi \ - else :; \ + | $(GREP) . \ + && { msg=3D"$$halt" $(_sc_say_and_exit) } \ + || :; \ + fi \ + else :; \ fi || :; endef diff --git a/ci/Makefile b/ci/Makefile index 02ce0df7ee..81f08d4f88 100644 --- a/ci/Makefile +++ b/ci/Makefile @@ -140,7 +140,7 @@ endif CI_GIT_ARGS =3D \ -c advice.detachedHead=3Dfalse \ -q \ - --local \ + --local \ $(NULL) =20 # Args to use when running the container --=20 2.35.3