From nobody Tue May 7 22:20:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1629382397; cv=none; d=zohomail.com; s=zohoarc; b=mtG4t4NPYFnsCC/uMKMqOk7OuXNI/W0HePtoj6gkTXpPRpnE8/ddNm0XHp6Kw/5ncfkMzhzSIvuL5xXpRA5yrSGOL3Fyj1Ueh9TVZMMINCIylqfCOVczrhN5IETwPR0EJKCrzyEgQNXIWGhPwcD/I4h6r7EvPDPCjVzfl0JjjLM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629382397; 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=EYqhUJ0zvusLFjtC71uUZkZGn7KHdv4B9D35/6L9oWY=; b=j3kIjNPOHd/cC2vBQAFVESrLVgW54IChYB7d4M559QkAsrVuqT17SS/YiJcwvvNUXgju0LsE0DZsT4QWSYjIPcWpkuVMyVfIJs8/50MFbMG/9WT1Bq9A5riNI8Y6X6jmboOTP26KT+8Y83KqwH5qz7mxXdQYTEPCQ5Dh3eq1xtU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1629382397554883.8706134238985; Thu, 19 Aug 2021 07:13:17 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-253-cyxBtP-rPZOttTrCjqq-AQ-1; Thu, 19 Aug 2021 10:13:13 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 689AF1009608; Thu, 19 Aug 2021 14:13:07 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D2CB11970F; Thu, 19 Aug 2021 14:13:05 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 811041819AC9; Thu, 19 Aug 2021 14:13:01 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 17JECdJX015664 for ; Thu, 19 Aug 2021 10:12:39 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1A8331970F; Thu, 19 Aug 2021 14:12:39 +0000 (UTC) Received: from hjs.redhat.com (unknown [10.43.2.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id 97AE21A26A for ; Thu, 19 Aug 2021 14:12:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1629382395; 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=EYqhUJ0zvusLFjtC71uUZkZGn7KHdv4B9D35/6L9oWY=; b=LvIkxthzv4bkx53xOsZpZB5bqKNu2yKy223u4gemSn3MheHjjk+MUU+ixLaqV0Nbn3WgLm 6/gISPX/rLgowtaTpOYZcqXSimhIRUDldQtXKvTVzbb/8LSMlHf/QrjSxErBeyurMahiUG 3jbdL533J9YNTRKgo4qtW6E/q3yxggk= X-MC-Unique: cyxBtP-rPZOttTrCjqq-AQ-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 1/5] syntax-check: assume we're using git Date: Thu, 19 Aug 2021 16:12:28 +0200 Message-Id: <8ac3603f2d778ccd0b94f7f898c8be94fbf5d7fe.1629381994.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1629382399004100001 Meson already checks whether we're using git before running syntax check. This only affects direct invocation through make. Signed-off-by: J=C3=A1n Tomko Reviewed-by: Michal Privoznik --- build-aux/syntax-check.mk | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/build-aux/syntax-check.mk b/build-aux/syntax-check.mk index cedb360bfd..e523c0bf3f 100644 --- a/build-aux/syntax-check.mk +++ b/build-aux/syntax-check.mk @@ -37,9 +37,6 @@ _sp =3D $(_empty) $(_empty) # If S1 =3D=3D S2, return S1, otherwise the empty string. _equal =3D $(and $(findstring $(1),$(2)),$(findstring $(2),$(1))) =20 -GIT =3D git -VC =3D $(GIT) - VC_LIST =3D $(top_srcdir)/build-aux/vc-list-files -C $(top_srcdir) =20 # You can override this variable in syntax-check.mk to set your own regexp @@ -85,15 +82,6 @@ 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) =20 -ifeq ($(shell $(VC_LIST) >/dev/null 2>&1; echo $$?),0) - local-checks-available +=3D $(syntax-check-rules) -else - local-checks-available +=3D no-vc-detected -no-vc-detected: - @echo "No version control files detected; skipping syntax check" -endif -.PHONY: $(local-checks-available) - # 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)) @@ -116,7 +104,7 @@ $(sc_z_rules_): %.z: % # that computes and prints elapsed time. local-check :=3D \ $(patsubst sc_%, sc_%.z, \ - $(filter-out $(local-checks-to-skip), $(local-checks-available))) + $(filter-out $(local-checks-to-skip), $(syntax-check-rules))) =20 syntax-check: $(local-check) =20 --=20 2.31.1 From nobody Tue May 7 22:20:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1629382591; cv=none; d=zohomail.com; s=zohoarc; b=huwVkJXghNxuk1pGzBX+bR+AsrtAYrF5Io261uOxP94AvvhCbN983PP+2QZcPzGuWMENP0+qwsyHDw82TkaqvPHDKGmUPld6LhGI3otX2L7YsmLz1Pc9e311B5TUaMV9HxYetsVfI/BnZ5PYot4alsyjuV8/MaHAINlAdjazqc4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629382591; 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=3L6OhHettDVug8N5PC4fPdLsH+e82tqunc5FyerGi0I=; b=U46h4c2q0jRRJdRbyAgE4HtNUrf1XPRPSrKNTF8afckZqbz3s8qrLVESN4GR2iBVIGGwTE84hHa+JAx44u2RlRI/uhmV8V/9V8eRPDOKYpqSYGX6dhv52jOP5z9H6KEJiJ/LDaR5p7fDMAF4vNWM7J+LFY9hKh1TH2xZloJm+e8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1629382591298297.56846048607815; Thu, 19 Aug 2021 07:16:31 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-31-pVTweq5gNPG5FDRpJMkTLA-1; Thu, 19 Aug 2021 10:16:28 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id ADAAB760CA; Thu, 19 Aug 2021 14:16:22 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8A3B1104F6; Thu, 19 Aug 2021 14:16:22 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 537DA181A1D3; Thu, 19 Aug 2021 14:16:22 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 17JECdXA015669 for ; Thu, 19 Aug 2021 10:12:39 -0400 Received: by smtp.corp.redhat.com (Postfix) id E5FD31A26A; Thu, 19 Aug 2021 14:12:39 +0000 (UTC) Received: from hjs.redhat.com (unknown [10.43.2.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6A4261970F for ; Thu, 19 Aug 2021 14:12:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1629382590; 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=3L6OhHettDVug8N5PC4fPdLsH+e82tqunc5FyerGi0I=; b=Q5IZ5Ea9oEG3gJ3SneB6CDPU4jCsJzq+vtuW7ckPo+g+dNo5ikfdJg7E0QbX8wL2mFZvp7 zPw35h8FgcyfQUAO5A96dsvsNRzIu7vm2YcBjkckDjpHSRMNKl/byjwrGTX6NChRSTFtXh PHBDrylm2grVVtbf69SDe3zggYu4PnI= X-MC-Unique: pVTweq5gNPG5FDRpJMkTLA-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 2/5] syntax-check: use VC_LIST_EXCEPT instead of VC_LIST Date: Thu, 19 Aug 2021 16:12:29 +0200 Message-Id: <9a3e03b729b4c92a9acfb94b19217c7d5bd76ddf.1629381994.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1629382593574100001 Three callers were using VC_LIST directly. This is not wrong, because they exclude the always-excluded files by only looking for C and/or header files. But using VC_LIST here prevents switching it to outputting relative paths. Signed-off-by: J=C3=A1n Tomko Reviewed-by: Michal Privoznik --- build-aux/syntax-check.mk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build-aux/syntax-check.mk b/build-aux/syntax-check.mk index e523c0bf3f..307255c300 100644 --- a/build-aux/syntax-check.mk +++ b/build-aux/syntax-check.mk @@ -1689,16 +1689,16 @@ sc_prohibit-duplicate-header: $(PYTHON) $(top_srcdir)/scripts/prohibit-duplicate-header.py =20 sc_spacing-check: - $(AM_V_GEN)$(VC_LIST) | $(GREP) '\.c$$' | xargs \ + $(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; } =20 sc_mock-noinline: - $(AM_V_GEN)$(VC_LIST) | $(GREP) '\.[ch]$$' | $(RUNUTF8) xargs \ + $(AM_V_GEN)$(VC_LIST_EXCEPT) | $(GREP) '\.[ch]$$' | $(RUNUTF8) xargs \ $(PYTHON) $(top_srcdir)/scripts/mock-noinline.py =20 sc_header-ifdef: - $(AM_V_GEN)$(VC_LIST) | $(GREP) '\.[h]$$' | $(RUNUTF8) xargs \ + $(AM_V_GEN)$(VC_LIST_EXCEPT) | $(GREP) '\.[h]$$' | $(RUNUTF8) xargs \ $(PYTHON) $(top_srcdir)/scripts/header-ifdef.py =20 sc_group-qemu-caps: --=20 2.31.1 From nobody Tue May 7 22:20:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1629382569; cv=none; d=zohomail.com; s=zohoarc; b=bsKVlG1VmTNBq+9+FkoEUn/v5Ipbxt59ARhTtoWRx7YIF5Do2+CUYOeda4fWvQVC9KLlQnMZTrST2LgOZPllAvwy6srLUg1uauj389k2GkWPVyHxrpnGa1aA0Hr9T93YEBTdnBJuvLat0r9bEDufsQH5lzeIf1LK7MlDZIVnw/g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629382569; 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=puheaX63FdslVqMt3hz8z0TFINaGzr1Rr+JxQICQqKw=; b=YCnVHLEOdGlsItBq7w8Cbhq2IO5IC3GYv2US3bveRpqaZ/BJQmu1VeSBf069DhJZM9enSYeF5BHcAY81HLKeziUxWsmRslafigZzR0NZy91whoU/NgfBFmZNASTjqdFO1TqGS29JBUsbCDkKLAj/1QgQ4R1Sb0tyZiMIvDboq+M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 16293825690441004.0353669024362; Thu, 19 Aug 2021 07:16:09 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-537-s4y6tf0jOTaHp633XIRabA-1; Thu, 19 Aug 2021 10:16:02 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0526A100A609; Thu, 19 Aug 2021 14:15:57 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D84D75D9D5; Thu, 19 Aug 2021 14:15:56 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id A67404A7C9; Thu, 19 Aug 2021 14:15:56 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 17JECeGT015684 for ; Thu, 19 Aug 2021 10:12:40 -0400 Received: by smtp.corp.redhat.com (Postfix) id B6AA51A26A; Thu, 19 Aug 2021 14:12:40 +0000 (UTC) Received: from hjs.redhat.com (unknown [10.43.2.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3DC8F1970F for ; Thu, 19 Aug 2021 14:12:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1629382567; 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=puheaX63FdslVqMt3hz8z0TFINaGzr1Rr+JxQICQqKw=; b=FvudBkjWYCTq9aM82FuctY5V3uxgG2f2tJPgvfZns/oO54nF3OzKwHYCgWgZC5wQ1nC/ER vavAsCpKxs7FCb/jGIUCaPqjs6gqEK3Zgebf/ZZ8B3A0VKJsfNqRdQUoG3ajyzJJZqp/FR yMn4DtWfniE0FHAB55n1oPD/jTpYy74= X-MC-Unique: s4y6tf0jOTaHp633XIRabA-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 3/5] syntax-check: replace vc-list-files Date: Thu, 19 Aug 2021 16:12:30 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1629382570719100002 Directly invoke git ls-tree instead of the wrapper file which also: * checks for other versioning systems * prepends the source directory to all output lines Since there is no srcdir prefix in the output anymore, also drop the extra 'sed' invocation that removes it. Signed-off-by: J=C3=A1n Tomko Reviewed-by: Michal Privoznik --- build-aux/syntax-check.mk | 6 +- build-aux/vc-list-files | 113 -------------------------------------- 2 files changed, 3 insertions(+), 116 deletions(-) delete mode 100755 build-aux/vc-list-files diff --git a/build-aux/syntax-check.mk b/build-aux/syntax-check.mk index 307255c300..f493d19dae 100644 --- a/build-aux/syntax-check.mk +++ b/build-aux/syntax-check.mk @@ -37,7 +37,8 @@ _sp =3D $(_empty) $(_empty) # If S1 =3D=3D S2, return S1, otherwise the empty string. _equal =3D $(and $(findstring $(1),$(2)),$(findstring $(2),$(1))) =20 -VC_LIST =3D $(top_srcdir)/build-aux/vc-list-files -C $(top_srcdir) +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. @@ -63,8 +64,7 @@ endif _sc_excl =3D \ $(or $(exclude_file_name_regexp--$@),^$$) VC_LIST_EXCEPT =3D \ - $(VC_LIST) | $(SED) 's|^$(_dot_escaped_srcdir)/||' \ - | $(GREP) -Ev -e '($(VC_LIST_ALWAYS_EXCLUDE_REGEX)|$(_sc_excl))' \ + $(VC_LIST) | $(GREP) -Ev -e '($(VC_LIST_ALWAYS_EXCLUDE_REGEX)|$(_sc_excl= ))' \ $(_prepend_srcdir_prefix) =20 # Prevent programs like 'sort' from considering distinct strings to be equ= al. diff --git a/build-aux/vc-list-files b/build-aux/vc-list-files deleted file mode 100755 index af6b1c0f8a..0000000000 --- a/build-aux/vc-list-files +++ /dev/null @@ -1,113 +0,0 @@ -#!/bin/sh -# List version-controlled file names. - -# Print a version string. -scriptversion=3D2018-03-07.03; # UTC - -# Copyright (C) 2006-2019 Free Software Foundation, Inc. - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - - -# List the specified version-controlled files. -# With no argument, list them all. With a single DIRECTORY argument, -# list the version-controlled files in that directory. - -# If there's an argument, it must be a single, "."-relative directory name. -# cvsu is part of the cvsutils package: http://www.red-bean.com/cvsutils/ - -postprocess=3D -case $1 in - --help) cat <. -EOF - exit ;; - - --version) - year=3D`echo "$scriptversion" | sed 's/[^0-9].*//'` - cat < -This is free software: you are free to change and redistribute it. -There is NO WARRANTY, to the extent permitted by law. -EOF - exit ;; - - -C) - test "$2" =3D . || postprocess=3D"| sed 's|^|$2/|'" - cd "$2" || exit 1 - shift; shift ;; -esac - -test $# =3D 0 && set . - -for dir -do - if test -d .git || test -f .git; then - test "x$dir" =3D x. \ - && dir=3D sed_esc=3D \ - || { dir=3D"$dir/"; sed_esc=3D`echo "$dir"|env sed 's,\([\\/]\),\\\\= \1,g'`; } - # Ignore git symlinks - either they point into the tree, in which case - # we don't need to visit the target twice, or they point somewhere - # else (often into a submodule), in which case the content does not - # belong to this package. - eval exec git ls-tree -r 'HEAD:"$dir"' \ - \| sed -n '"s/^100[^ ]*./$sed_esc/p"' $postprocess - elif test -d .hg; then - eval exec hg locate '"$dir/*"' $postprocess - elif test -d .bzr; then - test "$postprocess" =3D '' && postprocess=3D"| sed 's|^\./||'" - eval exec bzr ls -R --versioned '"$dir"' $postprocess - elif test -d CVS; then - test "$postprocess" =3D '' && postprocess=3D"| sed 's|^\./||'" - if test -x build-aux/cvsu; then - eval build-aux/cvsu --find --types=3DAFGM '"$dir"' $postprocess - elif (cvsu --help) >/dev/null 2>&1; then - eval cvsu --find --types=3DAFGM '"$dir"' $postprocess - else - eval awk -F/ \''{ \ - if (!$1 && $3 !~ /^-/) { \ - f=3DFILENAME; \ - if (f ~ /CVS\/Entries$/) \ - f =3D substr(f, 1, length(f)-11); \ - print f $2; \ - }}'\'' \ - `find "$dir" -name Entries -print` /dev/null' $postprocess - fi - elif test -d .svn; then - eval exec svn list -R '"$dir"' $postprocess - else - echo "$0: Failed to determine type of version control used in `pwd`" 1= >&2 - exit 1 - fi -done - -# Local variables: -# eval: (add-hook 'before-save-hook 'time-stamp) -# time-stamp-start: "scriptversion=3D" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC0" -# time-stamp-end: "; # UTC" -# End: --=20 2.31.1 From nobody Tue May 7 22:20:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1629382594; cv=none; d=zohomail.com; s=zohoarc; b=As5Gwo3IM+LoyVz/d2nq0cMdy+f4Hv/TopW/42nCom/bkGGsr2MORnSdyWM0rBitQq6ppG6cKS7Qt8o9NvRTjsRx2plp7xICPN+yM9m3Zju7S2o8G/YWHmrwqwZVB6fA9EqDwKBHaf9/n2LO3/q6wU3NIZJ3LsiTRGsOtp8xPZI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629382594; 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=KTQbvz07VEhryAuh/4msLFioc7yjixuSYN6nALDduZw=; b=hW7CCyhQePxKV8SH0HF7ds+doM0lKZhUDOHBtLs7wwzJhZWTCNhFt8BOXGijSRcg7WGXJTIR8UvwuOgVNuutycUoTiQr1k5IjRVGT8ZgPTYw77Ig2tfdA6KAm4sxk73YJfpkBI+HYLaMvnOMFFroSobZEy9LUREAhVJlJK6AhNE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1629382594143856.704758666276; Thu, 19 Aug 2021 07:16:34 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-395-XyA-fyoOM1a8pZVKiH_m-g-1; Thu, 19 Aug 2021 10:16:31 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CE4BF802923; Thu, 19 Aug 2021 14:16:25 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A58B51970F; Thu, 19 Aug 2021 14:16:25 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 6690B181A2A5; Thu, 19 Aug 2021 14:16:25 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 17JECfpS015691 for ; Thu, 19 Aug 2021 10:12:41 -0400 Received: by smtp.corp.redhat.com (Postfix) id B942538E59; Thu, 19 Aug 2021 14:12:41 +0000 (UTC) Received: from hjs.redhat.com (unknown [10.43.2.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id 17FF42ED6C for ; Thu, 19 Aug 2021 14:12:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1629382592; 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=KTQbvz07VEhryAuh/4msLFioc7yjixuSYN6nALDduZw=; b=XDktOZfTOElfOxWR8ibFR/C+N+9JhU4PzdHx0UwU5qSlBoUiUQzt7q1XX9kpM/fYvJywJt Kzwh/vifFFHfVup6Cg+x/zMhOnyW9BlyeHIo7tYxH9+2NcxgGDHfCyRPfgCi196tUZGpU2 q2hDavP+H2CRjtMIylTIEqi0yBc22n8= X-MC-Unique: XyA-fyoOM1a8pZVKiH_m-g-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 4/5] syntax-check: drop useless useless-if-before-free Date: Thu, 19 Aug 2021 16:12:31 +0200 Message-Id: <096761cf6f11db9626142c4736967212a052e25e.1629381994.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1629382596222100001 With most of new code using g_auto for cleanup, contributors are used to most of the free fucntion handling NULL gracefully. Also, despite finding some occurrences in current codebase: avoid_if_before_free ~/libvirt/src/ch/ch_monitor.c: if (mon->vm) virObjectUnref(mon->vm); ~/libvirt/src/util/virresctrl.c: if (a_type->masks[cache]) virBitmapFree(a_type->masks[cache]); the check passes succesfully, because the script's logic: Exit status: 0 one or more matches 1 no match 2 an error does not play nicely with xargs: xargs exits with the following status: 0 if it succeeds 123 if any invocation of the command exited with status 1-125 The list of functions is also out of date - e.g. qemuCapsFree has been renamed since. This also helps eliminate one more Perl script per our programming languages strategy: https://libvirt.org/programming-languages.html Signed-off-by: J=C3=A1n Tomko Reviewed-by: Michal Privoznik --- build-aux/syntax-check.mk | 190 +------------------------- build-aux/useless-if-before-free | 226 ------------------------------- 2 files changed, 2 insertions(+), 414 deletions(-) delete mode 100755 build-aux/useless-if-before-free diff --git a/build-aux/syntax-check.mk b/build-aux/syntax-check.mk index f493d19dae..b72a5b93d8 100644 --- a/build-aux/syntax-check.mk +++ b/build-aux/syntax-check.mk @@ -114,181 +114,6 @@ _test_script_regex =3D \ VC_LIST_ALWAYS_EXCLUDE_REGEX =3D \ (^(docs/(news(-[0-9]*)?\.html\.in|.*\.patch))|\.(po|fig|gif|ico|png))$$ =20 -# Functions like free() that are no-ops on NULL arguments. -useless_free_options =3D \ - --name=3DVBOX_UTF16_FREE \ - --name=3DVBOX_UTF8_FREE \ - --name=3DVBOX_COM_UNALLOC_MEM \ - --name=3DVIR_FREE \ - --name=3DqemuCapsFree \ - --name=3DqemuMigrationCookieFree \ - --name=3DqemuMigrationCookieGraphicsFree \ - --name=3Dsexpr_free \ - --name=3DusbFreeDevice \ - --name=3DvirBandwidthDefFree \ - --name=3DvirBitmapFree \ - --name=3DvirCPUDefFree \ - --name=3DvirCapabilitiesFree \ - --name=3DvirCapabilitiesFreeGuest \ - --name=3DvirCapabilitiesFreeGuestDomain \ - --name=3DvirCapabilitiesFreeGuestFeature \ - --name=3DvirCapabilitiesFreeGuestMachine \ - --name=3DvirCapabilitiesFreeHostNUMACell \ - --name=3DvirCapabilitiesFreeMachines \ - --name=3DvirCgroupFree \ - --name=3DvirCommandFree \ - --name=3DvirConfFreeList \ - --name=3DvirConfFreeValue \ - --name=3DvirDomainActualNetDefFree \ - --name=3DvirDomainChrDefFree \ - --name=3DvirDomainControllerDefFree \ - --name=3DvirDomainDefFree \ - --name=3DvirDomainDeviceDefFree \ - --name=3DvirDomainDiskDefFree \ - --name=3DvirDomainEventCallbackListFree \ - --name=3DvirObjectEventQueueFree \ - --name=3DvirDomainFSDefFree \ - --name=3DvirDomainGraphicsDefFree \ - --name=3DvirDomainHostdevDefFree \ - --name=3DvirDomainInputDefFree \ - --name=3DvirDomainNetDefFree \ - --name=3DvirDomainObjFree \ - --name=3DvirDomainSmartcardDefFree \ - --name=3DvirDomainSnapshotObjFree \ - --name=3DvirDomainSoundDefFree \ - --name=3DvirDomainVideoDefFree \ - --name=3DvirDomainWatchdogDefFree \ - --name=3DvirFileDirectFdFree \ - --name=3DvirHashFree \ - --name=3DvirInterfaceDefFree \ - --name=3DvirInterfaceIpDefFree \ - --name=3DvirInterfaceObjFree \ - --name=3DvirInterfaceProtocolDefFree \ - --name=3DvirJSONValueFree \ - --name=3DvirLastErrFreeData \ - --name=3DvirNetMessageFree \ - --name=3DvirNWFilterDefFree \ - --name=3DvirNWFilterEntryFree \ - --name=3DvirNWFilterHashTableFree \ - --name=3DvirNWFilterIPAddrLearnReqFree \ - --name=3DvirNWFilterIncludeDefFree \ - --name=3DvirNWFilterObjFree \ - --name=3DvirNWFilterRuleDefFree \ - --name=3DvirNWFilterRuleInstFree \ - --name=3DvirNetworkDefFree \ - --name=3DvirNodeDeviceDefFree \ - --name=3DvirNodeDeviceObjFree \ - --name=3DvirObjectUnref \ - --name=3DvirObjectFreeCallback \ - --name=3DvirPCIDeviceFree \ - --name=3DvirSecretDefFree \ - --name=3DvirStorageEncryptionFree \ - --name=3DvirStorageEncryptionSecretFree \ - --name=3DvirStorageFileFreeMetadata \ - --name=3DvirStoragePoolDefFree \ - --name=3DvirStoragePoolObjFree \ - --name=3DvirStoragePoolSourceFree \ - --name=3DvirStorageVolDefFree \ - --name=3DvirThreadPoolFree \ - --name=3DxmlBufferFree \ - --name=3DxmlFree \ - --name=3DxmlFreeDoc \ - --name=3DxmlFreeNode \ - --name=3DxmlXPathFreeContext \ - --name=3DxmlXPathFreeObject - -# The following template was generated by this command: -# make ID && aid free|grep '^vi'|sed 's/ .*//;s/^/# /' -# N virBufferFreeAndReset -# y virCPUDefFree -# y virCapabilitiesFree -# y virCapabilitiesFreeGuest -# y virCapabilitiesFreeGuestDomain -# y virCapabilitiesFreeGuestFeature -# y virCapabilitiesFreeGuestMachine -# y virCapabilitiesFreeHostNUMACell -# y virCapabilitiesFreeMachines -# N virCapabilitiesFreeNUMAInfo FIXME -# y virCgroupFree -# N virConfFree (diagnoses the "error") -# y virConfFreeList -# y virConfFreeValue -# y virDomainChrDefFree -# y virDomainControllerDefFree -# y virDomainDefFree -# y virDomainDeviceDefFree -# y virDomainDiskDefFree -# y virDomainEventCallbackListFree -# y virDomainEventQueueFree -# y virDomainFSDefFree -# n virDomainFree -# n virDomainFreeName (can't fix -- returns int) -# y virDomainGraphicsDefFree -# y virDomainHostdevDefFree -# y virDomainInputDefFree -# y virDomainNetDefFree -# y virDomainObjFree -# n virDomainSnapshotFree (returns int) -# n virDomainSnapshotFreeName (returns int) -# y virDomainSnapshotObjFree -# y virDomainSoundDefFree -# y virDomainVideoDefFree -# y virDomainWatchdogDefFree -# n virDrvNodeGetCellsFreeMemory (returns int) -# n virDrvNodeGetFreeMemory (returns long long) -# n virFree - dereferences param -# n virFreeError -# n virHashFree (takes 2 args) -# y virInterfaceDefFree -# n virInterfaceFree (returns int) -# n virInterfaceFreeName -# y virInterfaceIpDefFree -# y virInterfaceObjFree -# n virInterfaceObjListFree -# y virInterfaceProtocolDefFree -# y virJSONValueFree -# y virLastErrFreeData -# y virNWFilterDefFree -# y virNWFilterEntryFree -# n virNWFilterFree (returns int) -# y virNWFilterHashTableFree -# y virNWFilterIPAddrLearnReqFree -# y virNWFilterIncludeDefFree -# n virNWFilterFreeName (returns int) -# y virNWFilterObjFree -# n virNWFilterObjListFree FIXME -# y virNWFilterRuleDefFree -# n virNWFilterRuleFreeInstanceData (typedef) -# y virNWFilterRuleInstFree -# y virNetworkDefFree -# n virNetworkFree (returns int) -# n virNetworkFreeName (returns int) -# n virNodeDevCapsDefFree FIXME -# y virNodeDeviceDefFree -# n virNodeDeviceFree (returns int) -# y virNodeDeviceObjFree -# n virNodeDeviceObjListFree FIXME -# n virNodeGetCellsFreeMemory (returns int) -# n virNodeGetFreeMemory (returns non-void) -# y virSecretDefFree -# n virSecretFree (returns non-void) -# n virSecretFreeName (2 args) -# n virSecurityLabelDefFree FIXME -# n virStorageBackendDiskMakeFreeExtent (returns non-void) -# y virStorageEncryptionFree -# y virStorageEncryptionSecretFree -# n virStorageFreeType (enum) -# y virStoragePoolDefFree -# n virStoragePoolFree (returns non-void) -# n virStoragePoolFreeName (returns non-void) -# y virStoragePoolObjFree -# n virStoragePoolObjListFree FIXME -# y virStoragePoolSourceFree -# y virStorageVolDefFree -# n virStorageVolFree (returns non-void) -# n virStorageVolFreeName (returns non-void) -# n virStreamFree - # Avoid uses of write(2). Either switch to streams (fwrite), or use # the safewrite wrapper. sc_avoid_write: @@ -1250,17 +1075,6 @@ define _sc_search_regexp fi || :; endef =20 -sc_avoid_if_before_free: - @$(VC_LIST_EXCEPT) \ - | $(GREP) -v useless-if-before-free \ - | xargs \ - $(top_srcdir)/build-aux/useless-if-before-free \ - $(useless_free_options) \ - && { printf '$(ME): found useless "if"' \ - ' before "free" above\n' 1>&2; \ - exit 1; } \ - || : - sc_cast_of_argument_to_free: @prohibit=3D'\. -# -# Written by Jim Meyering - -# This is a prologue that allows to run a perl script as an executable -# on systems that are compliant to a POSIX version before POSIX:2017. -# On such systems, the usual invocation of an executable through execlp() -# or execvp() fails with ENOEXEC if it is a script that does not start -# with a #! line. The script interpreter mentioned in the #! line has -# to be /bin/sh, because on GuixSD systems that is the only program that -# has a fixed file name. The second line is essential for perl and is -# also useful for editing this file in Emacs. The next two lines below -# are valid code in both sh and perl. When executed by sh, they re-execute -# the script through the perl program found in $PATH. The '-x' option -# is essential as well; without it, perl would re-execute the script -# through /bin/sh. When executed by perl, the next two lines are a no-op. -eval 'exec perl -wSx "$0" "$@"' - if 0; - -my $VERSION =3D '2018-03-07 03:47'; # UTC -# The definition above must lie within the first 8 lines in order -# for the Emacs time-stamp write hook (at end) to update it. -# If you change this file with Emacs, please let the write hook -# do its job. Otherwise, update this string manually. - -use strict; -use warnings; -use Getopt::Long; - -(my $ME =3D $0) =3D~ s|.*/||; - -# use File::Coda; # https://meyering.net/code/Coda/ -END { - defined fileno STDOUT or return; - close STDOUT and return; - warn "$ME: failed to close standard output: $!\n"; - $? ||=3D 1; -} - -sub usage ($) -{ - my ($exit_code) =3D @_; - my $STREAM =3D ($exit_code =3D=3D 0 ? *STDOUT : *STDERR); - if ($exit_code !=3D 0) - { - print $STREAM "Try '$ME --help' for more information.\n"; - } - else - { - print $STREAM < sub { usage 0 }, - version =3D> sub { print "$ME version $VERSION\n"; exit }, - list =3D> \$list, - 'name=3Ds@' =3D> \@name, - ) or usage 1; - - # Make sure we have the right number of non-option arguments. - # Always tell the user why we fail. - @ARGV < 1 - and (warn "$ME: missing FILE argument\n"), usage EXIT_ERROR; - - my $or =3D join '|', @name; - my $regexp =3D qr/(?:$or)/; - - # Set the input record separator. - # Note: this makes it impractical to print line numbers. - $/ =3D '"'; - - my $found_match =3D 0; - FILE: - foreach my $file (@ARGV) - { - open FH, '<', $file - or (warn "$ME: can't open '$file' for reading: $!\n"), - $err =3D EXIT_ERROR, next; - while (defined (my $line =3D )) - { - # Skip non-matching lines early to save time - $line =3D~ /\bif\b/ - or next; - while ($line =3D~ - /\b(if\s*\(\s*([^)]+?)(?:\s*!=3D\s*([^)]+?))?\s*\) - # 1 2 3 - (?: \s*$regexp\s*\((?:\s*\([^)]+\))?\s*([^)]+)\)\s*;| - \s*\{\s*$regexp\s*\((?:\s*\([^)]+\))?\s*([^)]+)\)\s*;\s*\}= ))/sxg) - { - my $all =3D $1; - my ($lhs, $rhs) =3D ($2, $3); - my ($free_opnd, $braced_free_opnd) =3D ($4, $5); - my $non_NULL; - if (!defined $rhs) { $non_NULL =3D $lhs } - elsif (is_NULL $rhs) { $non_NULL =3D $lhs } - elsif (is_NULL $lhs) { $non_NULL =3D $rhs } - else { next } - - # Compare the non-NULL part of the "if" expression and the - # free'd expression, without regard to white space. - $non_NULL =3D~ tr/ \t//d; - my $e2 =3D defined $free_opnd ? $free_opnd : $braced_free_op= nd; - $e2 =3D~ tr/ \t//d; - if ($non_NULL eq $e2) - { - $found_match =3D 1; - $list - and (print "$file\0"), next FILE; - print "$file: $all\n"; - } - } - } - } - continue - { - close FH; - } - - $found_match && $err =3D=3D EXIT_NO_MATCH - and $err =3D EXIT_MATCH; - - exit $err; -} - -my $foo =3D <<'EOF'; -# The above is to *find* them. -# This adjusts them, removing the unnecessary "if (p)" part. - -# FIXME: do something like this as an option (doesn't do braces): -free=3Dxfree -git grep -l -z "$free *(" \ - | xargs -0 useless-if-before-free -l --name=3D"$free" \ - | xargs -0 perl -0x3b -pi -e \ - 's/\bif\s*\(\s*(\S+?)(?:\s*!=3D\s*(?:0|NULL))?\s*\)\s+('"$free"'\s*\((?= :\s*\([^)]+\))?\s*\1\s*\)\s*;)/$2/s' - -# Use the following to remove redundant uses of kfree inside braces. -# Note that -0777 puts perl in slurp-whole-file mode; -# but we have plenty of memory, these days... -free=3Dkfree -git grep -l -z "$free *(" \ - | xargs -0 useless-if-before-free -l --name=3D"$free" \ - | xargs -0 perl -0777 -pi -e \ - 's/\bif\s*\(\s*(\S+?)(?:\s*!=3D\s*(?:0|NULL))?\s*\)\s*\{\s*('"$free"'= \s*\((?:\s*\([^)]+\))?\s*\1\s*\);)\s*\}[^\n]*$/$2/gms' - -Be careful that the result of the above transformation is valid. -If the matched string is followed by "else", then obviously, it won't be. - -When modifying files, refuse to process anything other than a regular file. -EOF - -## Local Variables: -## mode: perl -## indent-tabs-mode: nil -## eval: (add-hook 'before-save-hook 'time-stamp) -## time-stamp-line-limit: 50 -## time-stamp-start: "my $VERSION =3D '" -## time-stamp-format: "%:y-%02m-%02d %02H:%02M" -## time-stamp-time-zone: "UTC0" -## time-stamp-end: "'; # UTC" -## End: --=20 2.31.1 From nobody Tue May 7 22:20:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1629382569; cv=none; d=zohomail.com; s=zohoarc; b=Y5HF9FSd3teEaLJs7C5Dj9dWtr6qoY9oa7/T2nPG4f4vDyT6T0xjbV8Gp+2+VDfHWzWbDlSkFJUz3LyEOCAznOo3vPEK3FL7MKA2/PJF7/8ZqA/ncyg1U5tue+yjS1tjYRa8xAo8dGgmwR6SO60YZ9aWYMMnXnuW5KKNOnluLDA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629382569; 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=FUekkF2xLqjlp/b9vqIUQOBYcq672EgD1YS9RfyKqQ0=; b=cwyN37K66MaQpWOFRKjrTZ/oChuFrg6JDVZMTjuJSKdhzSzhPa/KPWFGuPs0uq8wklXGsLjnkHJPJWqWuOKla/hHiAsw6RNV1VMKu1BUZe94jdpXlhHxYAmLRS7EW80Kl2ESp21S3cW2Lm9jR8jiCkR+AG4jJaW6u6pKWZbmI4o= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1629382569287426.5710545205053; Thu, 19 Aug 2021 07:16:09 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-233-RPuLyVLMOlqYXtyuqXvxhQ-1; Thu, 19 Aug 2021 10:16:06 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E2DD7801B3C; Thu, 19 Aug 2021 14:16:00 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C78D160657; Thu, 19 Aug 2021 14:16:00 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 8F7744A7CA; Thu, 19 Aug 2021 14:16:00 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 17JECgxQ015701 for ; Thu, 19 Aug 2021 10:12:42 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8A98F38E59; Thu, 19 Aug 2021 14:12:42 +0000 (UTC) Received: from hjs.redhat.com (unknown [10.43.2.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1398C2ED6C for ; Thu, 19 Aug 2021 14:12:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1629382568; 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=FUekkF2xLqjlp/b9vqIUQOBYcq672EgD1YS9RfyKqQ0=; b=HXXVenE8UFwXYQjc0zE+GrFVh9bmQ5PiWTlRf3ieO45juZpdSVVxGiMeec38uw5bmU88rt nx+ZuUezdFlkGSG8gpWLBTZe/VhgGq8tOVF25eTih2FULXYdgeSKLYaRMGgRHjlKz1vbR7 RC2XaooBVqntwV8hza0Uvqvm516B+lg= X-MC-Unique: RPuLyVLMOlqYXtyuqXvxhQ-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 5/5] syntax-check: remove _test_script_regex Date: Thu, 19 Aug 2021 16:12:32 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1629383473145100001 Commit abab5c47f8060eddf0212084a1d70c4b1e3d92dd incorrectly assumed we do not have any files that could be affected by sc_prohibit_reversed_compare_failure due to the conditional assignment: _test_script_regex ?=3D \ so it removed the check. Also remove the leftover assignment of test-lib.sh, since any new code attemptint to use the compare function with reversed arguments should be rejected by review for using shell instead of C or Python. Signed-off-by: J=C3=A1n Tomko Reviewed-by: Michal Privoznik --- build-aux/syntax-check.mk | 2 -- 1 file changed, 2 deletions(-) diff --git a/build-aux/syntax-check.mk b/build-aux/syntax-check.mk index b72a5b93d8..cf7a1fa4c6 100644 --- a/build-aux/syntax-check.mk +++ b/build-aux/syntax-check.mk @@ -108,8 +108,6 @@ local-check :=3D \ =20 syntax-check: $(local-check) =20 -_test_script_regex =3D \ - # 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))$$ --=20 2.31.1