From nobody Fri Nov 29 14:51:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1637847663; cv=none; d=zohomail.com; s=zohoarc; b=T0dZHJju6xmwa8YFusv481tBmq3a93QFkNDbraFIMDsjdfoGhtZqt+JUaEoaKcRB6tWMhWUBjxMwOYWGDHFSWU0x9AMPJXQYYxQ64lw8+y1jWfHu5uwW0uGHtIVa/w5EYPYGzUuVml6joUPaAYOKjZPRi0U6vVNagcFXdmMP3as= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1637847663; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=+BInPFFZRfjRDNKEGHJ7hw3GqeLiRIDFAihlg3wkhfk=; b=nPyVYmy6WlhpQUArcyGIWNX2g2lceK1VAy1ZtQdMWq7k6aSV7bITfw3AXv4VF9n2f8vVyAOKCX2RBs81XpSnb5H/V0Dab1c1YkmHEj1yf+uygmYlLKqVuAcoPYOvC6CNwpXSsGOTCRmcP4qKzYGU/YQVRFwEksDIuxhNuIThsTs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1637847663498424.1893764293035; Thu, 25 Nov 2021 05:41:03 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.231219.400030 (Exim 4.92) (envelope-from ) id 1mqEzb-00021o-6R; Thu, 25 Nov 2021 13:40:51 +0000 Received: by outflank-mailman (output) from mailman id 231219.400030; Thu, 25 Nov 2021 13:40:51 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mqEza-0001xZ-QY; Thu, 25 Nov 2021 13:40:50 +0000 Received: by outflank-mailman (input) for mailman id 231219; Thu, 25 Nov 2021 13:40:49 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mqEzZ-00076i-4Z for xen-devel@lists.xenproject.org; Thu, 25 Nov 2021 13:40:49 +0000 Received: from esa5.hc3370-68.iphmx.com (esa5.hc3370-68.iphmx.com [216.71.155.168]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 4b2ead47-4df5-11ec-a9d2-d9f7a1cc8784; Thu, 25 Nov 2021 14:40:48 +0100 (CET) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 4b2ead47-4df5-11ec-a9d2-d9f7a1cc8784 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1637847648; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=OgGxNUfTQ2JG3WE+K8Owl04Bu0uYkAMbFk7jPFHWrPo=; b=Uw0rQ7b3ilHxr7stkyJ8O8caq9dzwBHBgW7UXFAY2kml+2h6cUAuQSuU HKC01iDMZpe63j9rNsAbiPk+APSkkJDfbqlCoZ2YBbWCexJ3XcuDCId+c CrbHjrddoof8o3K2zV3gmxxs/sGX4rSxcwpYAgiTLfBXlxirJZJUEoJRe I=; Authentication-Results: esa5.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: KSNc1dI5ExpTV/1MPsgOULNRZw225xUwZIjvU9nt3iDvGnfdJ6cb15yX7fjJerBQ4V2SJ/dLz+ tLTz91lKUZxscFUCtLFZ4FbOMiUx+CmyjQt63Uf7XhlRehB65bv0pQC9Qh09mj5yQUlMMbNDCf XLQXPuhkZhaiXgbPPJwoG3DR0wAwNFW+3sxkTmiI6IfSP8CneXIwAziM4WxuZxws0A0CHOB0pU N7iP86ryqudAOXpB2ngjTVj7vOKmWQidnuhsv6IpggKhnjhaIhntSlgB7eJvCnQdRVaMWJYZJI a9sEdyHgwV+y8/gnU03ywTbJ X-SBRS: 5.1 X-MesageID: 58135422 X-Ironport-Server: esa5.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.83 X-Policy: $RELAYED IronPort-Data: A9a23:+iV6D6/LNnT5ZshksNxiDrUDfXmTJUtcMsCJ2f8bNWPcYEJGY0x3z 2YYW2/TPa2LNmWgKoojbY+1oRgHvJXcndFmQQpq/3o8E34SpcT7XtnIdU2Y0wF+jyHgoOCLy +1EN7Es+ehtFie0Si9AttENlFEkvU2ybuOU5NXsZ2YhGmeIdA970Ug6wrdj39Yy6TSEK1jlV e3a8pW31GCNg1aYAkpMg05UgEoy1BhakGpwUm0WPZinjneH/5UmJMt3yZWKB2n5WuFp8tuSH I4v+l0bElTxpH/BAvv9+lryn9ZjrrT6ZWBigVIOM0Sub4QrSoXfHc/XOdJFAXq7hQllkPha8 /Fup5PvZDt3O4DcqOI2Ykl7IXxhaPguFL/veRBTsOSWxkzCNXDt3+9vHAc9OohwFuRfWD8Us 6ZCcXZUM07F17neLLGTE4GAguwqKtXrO4UO/Glt1zjDAd4tQIzZQrWM7thdtNs1rp0eRK2DO 5BDAdZpRAzpSBNza3w2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zorLs2C33Jd+Gm7J3AdV7kq68MBC4jxhwt3klxPbPQw0MMtDE1jvzmUDnQXH w== IronPort-HdrOrdr: A9a23:pxLSV6zF6xMS5LEfwSIrKrPwKr1zdoMgy1knxilNoRw8SKOlfq eV7ZMmPH7P+U8ssR4b+OxoVJPsfZqYz+8W3WBzB8bHYOCFgguVxehZhOOIqQEIWReOk9K1vZ 0QFZSWY+efMbEVt6rHCXGDYrUd/OU= X-IronPort-AV: E=Sophos;i="5.87,263,1631592000"; d="scan'208";a="58135422" From: Anthony PERARD To: CC: Anthony PERARD , Andrew Cooper , George Dunlap , "Ian Jackson" , Jan Beulich , Julien Grall , Stefano Stabellini , Wei Liu Subject: [XEN PATCH v8 10/47] build: rework cloc recipe Date: Thu, 25 Nov 2021 13:39:29 +0000 Message-ID: <20211125134006.1076646-11-anthony.perard@citrix.com> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20211125134006.1076646-1-anthony.perard@citrix.com> References: <20211125134006.1076646-1-anthony.perard@citrix.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1637847665498100005 Content-Type: text/plain; charset="utf-8" We are going to make other modifications to the cloc recipe, so this patch prepare make those modification easier. We replace the Makefile meta programming by just a shell script which should be easier to read and is actually faster to execute. Instead of looking for files in "$(BASEDIR)", we use "." which is give the same result overall. We also avoid the need for a temporary file as cloc can read the list of files from stdin. No change intended to the output of `cloc`. Signed-off-by: Anthony PERARD Acked-by: Jan Beulich --- Notes: v8: - rework cloc patch, move it ahead of problematic changes this is only a convertion to shell script with a single other change. xen/Makefile | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/xen/Makefile b/xen/Makefile index 7bb3595d649f..6afae6ced37c 100644 --- a/xen/Makefile +++ b/xen/Makefile @@ -477,14 +477,12 @@ _MAP: =20 .PHONY: cloc cloc: - $(eval tmpfile :=3D $(shell mktemp)) - $(foreach f, $(shell find $(BASEDIR) -name *.o.d), \ - $(eval path :=3D $(dir $(f))) \ - $(eval names :=3D $(shell grep -o "[a-zA-Z0-9_/-]*\.[cS]" $(f))) \ - $(foreach sf, $(names), \ - $(shell if test -f $(path)/$(sf) ; then echo $(path)/$(sf) >> $(tmpfile= ); fi;))) - cloc --list-file=3D$(tmpfile) - rm $(tmpfile) + find . -name '*.o.d' | while read f; do \ + for sf in $$(grep -o "[a-zA-Z0-9_/-]*\.[cS]" $$f); do \ + sf=3D"$$(dirname $$f)/$$sf"; \ + test -f "$$sf" && echo "$$sf"; \ + done; \ + done | cloc --list-file=3D- =20 endif #config-build =20 --=20 Anthony PERARD