From patchwork Thu Feb 20 21:29:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eneas U de Queiroz X-Patchwork-Id: 1241692 X-Patchwork-Delegate: ynezz@true.cz Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20170209 header.b=e27zpXhG; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=HL3lXFRm; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48Nnmc2MfTz9sRG for ; Fri, 21 Feb 2020 08:29:52 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:MIME-Version:References: In-Reply-To:Message-Id:Date:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=1sOrMPpl6EgpnVa35w//S2KOsmoU/vNrzx6NRIMX2QY=; b=e27zpXhGh2QBDX FAPJtQIv7WE0+1MR7dV/PvfVGIyu7kbrlJZ3GbjGoq3fcjkuE0qhYvXfwgT/eqAdtOtB/kjUJcnLx Tpf+zPH5/wfG1rmmkW5z/zK7SlgZYNYWfrgVe9S6KEmUt3c1xedZP9+gKg4KcK+Louefoz2oxy4uA ZtpFAa3hvQqwmfywgONru+n9G4SdgYRFSZux7DFbibe0DIe6LZ3eSk/m46xC/5geGiTz4nhlcKvAT Oa9sZbI8n3dOxDp+M+DqhbRPESrbSelwmf/er0RtxjevR8EHPdv84HPgvnRUVQcGgnqTV4JaMpgLn HbIF3GovGPdwdAVBZEgA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1j4tOG-0001j6-EJ; Thu, 20 Feb 2020 21:29:48 +0000 Received: from mail-qk1-x741.google.com ([2607:f8b0:4864:20::741]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1j4tO6-0001Yz-Ge for openwrt-devel@lists.openwrt.org; Thu, 20 Feb 2020 21:29:39 +0000 Received: by mail-qk1-x741.google.com with SMTP id j8so5005656qka.11 for ; Thu, 20 Feb 2020 13:29:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=v1sZu9H9StmkxpqxGcg0UR60XSIX+dER1UKw53PXxHE=; b=HL3lXFRmNXxSdoviE6xtjyjdiA2Tk5r1PI5HRyXaAxEwDMAyKFc1n/DI1Xde43wjO3 idy2UrnUmuu7QlrOztIFuC1honY2bp6pICLK6hRjtB4iPz3nl+yBgnptKF969hQ8Mydc gfuLA1t3yE0BPl63dwQAVEV+LE9+IMyaz7VDmHqvpdIL/jXbJW+rntR3dSI/CKaFaE7b 6vKM+Jls856CbO+NlN7pa9tMs9KHe4z5nKDXplShJeCffyRuEc96AAqxYGTd6lFhKsbB Z/XmbhINx3R4AoXyHhSrnn4fygIMNboSgDisOUEZqq9bzRLy9jchw1vYEvkudMCSGb6+ BBWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=v1sZu9H9StmkxpqxGcg0UR60XSIX+dER1UKw53PXxHE=; b=I8j13SlIPUegn6l2PBvGe50QAhOpHQgh68BvrCuSp+RpQY5Gen91PjJjpS1vzgh0KJ Vy2o6dM43ywqViOXn0MA/pUcI+xpdhd50oWo24QadqBj19AsfWJo5j1xMFFr1JOcwE1g FzLvpRaOru90BaL/Efw/dJcDbkeKtmt5qN6ssllM1KRSZ66mgHFjy5Ms6B61lG5SHB3c /vUaxQYkbgpLGqUO3ZKVfF7WsV1kvrB2MSGLhuk+bkkTkNWgM64mLa/uxOQKxG4a6bHC 20Dtr9KdwyrKCpLNd5XBfKvTEY6KzjXFtRzoQvj2bpmTRx0lFhOCcY48XCGtuCP0m9qz a2Sg== X-Gm-Message-State: APjAAAXlbqMMhOoCuuw41rrwTg2zh2CpKBb7mzmTpRgGmoWdvOyDGkaY +JS8qZZorIXcnZU+gdzzAeoPWiTK X-Google-Smtp-Source: APXvYqzlm47iedfH/Z55B1rpA0EKmOOJ1XClxcsVtmbPKwSt7imXa4YmxrYh5dy95rPv9T0y9Br5Pw== X-Received: by 2002:ae9:dcc1:: with SMTP id q184mr29516969qkf.480.1582234176968; Thu, 20 Feb 2020 13:29:36 -0800 (PST) Received: from gateway.troianet.com.br (ipv6.troianet.com.br. [2804:688:21:4::2]) by smtp.gmail.com with ESMTPSA id t23sm412480qtp.82.2020.02.20.13.29.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Feb 2020 13:29:36 -0800 (PST) From: Eneas U de Queiroz To: openwrt-devel@lists.openwrt.org Date: Thu, 20 Feb 2020 18:29:02 -0300 Message-Id: <20200220212904.2444-2-cotequeiroz@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20200220212904.2444-1-cotequeiroz@gmail.com> References: <20200220212904.2444-1-cotequeiroz@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200220_132938_549960_595B1B0D X-CRM114-Status: UNSURE ( 6.09 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:741 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [cotequeiroz[at]gmail.com] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Subject: [OpenWrt-Devel] [PATCH v2 1/3] build: package-ipkg: avoid calling wildcard twice X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eneas U de Queiroz Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Instead of calling $(wildcard) to check if the removal list is empty, then calling it again to actually remove the files, define a function so that the arguments are expanded only once when it gets called. Signed-off-by: Eneas U de Queiroz diff --git a/include/package-ipkg.mk b/include/package-ipkg.mk index c4c8f4a36f..cd052698e2 100644 --- a/include/package-ipkg.mk +++ b/include/package-ipkg.mk @@ -18,6 +18,12 @@ IPKG_REMOVE:= \ IPKG_STATE_DIR:=$(TARGET_DIR)/usr/lib/opkg +# 1: package name +# 2: candidate ipk files +define remove_ipkg_files + $(if $(strip $(2)),$(IPKG_REMOVE) $(1) $(2)) +endef + # 1: package name # 2: variable name # 3: variable suffix @@ -184,7 +190,7 @@ $(_endef) $$(IPKG_$(1)) : export DESCRIPTION=$$(Package/$(1)/description) $$(IPKG_$(1)) : export PATH=$$(TARGET_PATH_PKG) $(PKG_INFO_DIR)/$(1).provides $$(IPKG_$(1)): $(STAMP_BUILT) $(INCLUDE_DIR)/package-ipkg.mk - @rm -rf $$(IDIR_$(1)) $$(if $$(call opkg_package_files,$(1)*),; $$(IPKG_REMOVE) $(1) $$(call opkg_package_files,$(1)*)) + @rm -rf $$(IDIR_$(1)); $$(call remove_ipkg_files,$(1),$$(call opkg_package_files,$(1)*)) mkdir -p $(PACKAGE_DIR) $$(IDIR_$(1))/CONTROL $(PKG_INFO_DIR) $(call Package/$(1)/install,$$(IDIR_$(1))) $(if $(Package/$(1)/install-overlay),mkdir -p $(PACKAGE_DIR) $$(IDIR_$(1))/rootfs-overlay) @@ -252,7 +258,7 @@ $(_endef) @[ -f $$(IPKG_$(1)) ] $(1)-clean: - $$(if $$(call opkg_package_files,$(1)*),$$(IPKG_REMOVE) $(1) $$(call opkg_package_files,$(1)*)) + $$(call remove_ipkg_files,$(1),$$(call opkg_package_files,$(1)*)) clean: $(1)-clean From patchwork Thu Feb 20 21:29:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eneas U de Queiroz X-Patchwork-Id: 1241693 X-Patchwork-Delegate: ynezz@true.cz Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20170209 header.b=DLeg2rYz; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=SKW/LJDE; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48Nnms6jZSz9sRk for ; Fri, 21 Feb 2020 08:30:05 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:MIME-Version:References: In-Reply-To:Message-Id:Date:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=z4rCtnw6aj5fv198EbrFF40WMpYjvbgKOKfRUr9V9Tk=; b=DLeg2rYzdsZPse B7nq4obvlCaqqYLv1Ocxq9DteSyHqtg1xyu0C2QYaZkP8ehqpFOVxCNcZC0Vs6QUMiOwZIkjCzmbv lgP5zk8oJ/klwl8DDaA/60Ucm50SrfVUQdMufN27XShvOyDEDAvpXq72y42hyD7X4F5HFt7AzApFC ewGEGpDG1lqDtaM15MPiX6chjfhBB7/PHWcqHeYemVEqHxpAVlPyy2w8Mvi9FUvCI92rGb8gWhOyA 8pnqsrnHzrfZsFkVGhaCGr4VK/lKwCToxtZ1zg1jtsllgRETuskJZf01Kxnj4m3autjJL6fS6j5VV XzRczgLcVGEd9xJ7fgOA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1j4tOS-0001zv-FG; Thu, 20 Feb 2020 21:30:00 +0000 Received: from mail-qt1-x843.google.com ([2607:f8b0:4864:20::843]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1j4tO7-0001ZV-Us for openwrt-devel@lists.openwrt.org; Thu, 20 Feb 2020 21:29:41 +0000 Received: by mail-qt1-x843.google.com with SMTP id j23so3988998qtr.11 for ; Thu, 20 Feb 2020 13:29:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Grk3tsnF92Je6Jh3WcFsp47QfKD3/H9iQLEBvEUg240=; b=SKW/LJDEzsygWSxdcDsxJLGkedrnpCUgNjZsgi696bmFtrwcFRIP7QiDEU0zMF8OAr pruoU9Ll4Bj7mfF0+XBHhoTYMtULX47bP8JelGmcToFn8uH+Y02rsyVe09Sew49CSMoW cImBDc/2jeIGmRT2vOCk0Lz/J+jTlOD/CsWseFsLyGMom+9KTCBHjZq9ZMhthI+l8xw+ c7B+mzw3zmKgG/AFdKP0WI6IMni3IZnBMALq56LjA9jWbZrrhw4JQDSJGBCPud0ji204 r6QAFjfItsncGEs7l2Jcm1Aa7BQB/C7/YEYhRT7gqa1L+1MMgAqYLceshw5pvL7rp7Q+ TbIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Grk3tsnF92Je6Jh3WcFsp47QfKD3/H9iQLEBvEUg240=; b=q8bv6NM3iFvhwA368NF3ZYWMgLTjFd5QZAprQnlWIUwLbI6CKJK4G84FUlR2NACyQu GpvgcnPEd/A9Wrti8tUKdso9Tm4DlU8G/f6Xmqo7mkREv26fKH42ahmG1t400KOLY2jM Y/NvTOFgUrv+aho1wL1C8ueimfAbx0VOQEFhLM/YEd4/W+A/HRqNiUqW4LHL7uyV9C4u z10Jk1FfPsWYbwrMhWCGhVaxRZrkuppQ4xCANnyKh47QD07Qg0n/okvPz81wnR6xO92t XWXRZoQyHpR44dKn6nQGJ0miHOzvfeE763vWbQ8PRrs/JgB/i0vlCv2ZUeVVhXEOyEw+ CoDg== X-Gm-Message-State: APjAAAUELVF17JPNu4DXLG/eQztt0NLVDRNdcE83rRGflmqeBOWchUHl UHVcgYYjCg0H2dTWbY7JC1v9tPUG X-Google-Smtp-Source: APXvYqwPlSnrWbspKQ2KeklKChx/JqL/d67j1gLfJS4FL31vZVftBrfKxe+Fh/w2gtuq3GOGRDCTzg== X-Received: by 2002:aed:24b2:: with SMTP id t47mr28047331qtc.337.1582234178417; Thu, 20 Feb 2020 13:29:38 -0800 (PST) Received: from gateway.troianet.com.br (ipv6.troianet.com.br. [2804:688:21:4::2]) by smtp.gmail.com with ESMTPSA id t23sm412480qtp.82.2020.02.20.13.29.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Feb 2020 13:29:38 -0800 (PST) From: Eneas U de Queiroz To: openwrt-devel@lists.openwrt.org Date: Thu, 20 Feb 2020 18:29:03 -0300 Message-Id: <20200220212904.2444-3-cotequeiroz@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20200220212904.2444-1-cotequeiroz@gmail.com> References: <20200220212904.2444-1-cotequeiroz@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200220_132939_994033_60939C1B X-CRM114-Status: UNSURE ( 6.53 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:843 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [cotequeiroz[at]gmail.com] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Subject: [OpenWrt-Devel] [PATCH v2 2/3] build: call ipkg-remove using xargs if #args>=512 X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eneas U de Queiroz Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org The wildcard call to clean up luci package (luci*) can pick up over 2,300 files when the full tree is built. Running make package/luci/clean or a second run of make package/luci/compile would fail with an 'Argument list too long' error. To avoid that, a maybe_use_xargs function was created that runs the command straight as usual if the number of arguments is < 512, or saves the list in a temporary file and feeds it to xargs otherwise. Signed-off-by: Eneas U de Queiroz diff --git a/include/package-ipkg.mk b/include/package-ipkg.mk index cd052698e2..351cf25394 100644 --- a/include/package-ipkg.mk +++ b/include/package-ipkg.mk @@ -18,10 +18,20 @@ IPKG_REMOVE:= \ IPKG_STATE_DIR:=$(TARGET_DIR)/usr/lib/opkg +# 1: command and initial arguments +# 2: arguments list +# 3: tmp filename +define maybe_use_xargs + $(if $(word 512,$(2)), \ + $(file >$(3),$(2)) $(XARGS) $(1) < "$(3)"; rm "$(3)", \ + $(1) $(2)) +endef + # 1: package name # 2: candidate ipk files define remove_ipkg_files - $(if $(strip $(2)),$(IPKG_REMOVE) $(1) $(2)) + $(if $(strip $(2)), \ + $(call maybe_use_xargs,$(IPKG_REMOVE) $(1),$(2),$(TMP_DIR)/$(1).in)) endef # 1: package name From patchwork Thu Feb 20 21:29:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eneas U de Queiroz X-Patchwork-Id: 1241695 X-Patchwork-Delegate: ynezz@true.cz Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20170209 header.b=NhEYf02I; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=YJtxoaK4; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48NnnF6X3lz9sRf for ; Fri, 21 Feb 2020 08:30:25 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:MIME-Version:References: In-Reply-To:Message-Id:Date:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=NWhR6XHc96LpuuMisWz7+MsuDI/vTlZ8e7kBAtcblso=; b=NhEYf02I8ojN+5 pIn9XmCWpdTwfdDeL+kS2nJze25t/XygyKjF6/S2TqCHDgVmNwXHris34o9iOE7jKJU7x+oBnQUVA ixLTw+U4g+mCoPSvwpfEbpLsyCKoVezNadPkLv/BSnmTcHtO22pn5+r0itBlRnq8oFAsDMN9lgPkw 3L3FdV7Uv1xO8b2Ej2tFAZt7O/gyk4KVceelFl5haaePRxJI/R0o/DJkTJJLstPFC03LD0grjvGAb Of6IHlIDRJh1P/lr41Lq/l/Yt6DCzj3aG/kULycB/Gon01bUda5pysROQY1suHsQ/CEOR9/ZOgB5x QaQL5xaEmpnjTqbYPHtw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1j4tOo-0003UK-MK; Thu, 20 Feb 2020 21:30:22 +0000 Received: from mail-qk1-x743.google.com ([2607:f8b0:4864:20::743]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1j4tO9-0001Zv-FG for openwrt-devel@lists.openwrt.org; Thu, 20 Feb 2020 21:29:42 +0000 Received: by mail-qk1-x743.google.com with SMTP id o28so5018764qkj.9 for ; Thu, 20 Feb 2020 13:29:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gGeLYYDf4rTDRKaXnuvkVdhU7gNXptPx3oKBnLol/+w=; b=YJtxoaK4ImjySOT/zpEHFeDZPc4e1qLYN47kzrj6hui75+ISB4lESvQ/IJB0VO9ICW Ndm0J0g+0fEwNv8B6Kheot78q07yV8zDLsYspYDxk99bbVCyw40tLxwWr4yTfJMgHPBH F329TSANCBpxo6miYamzASBMDuX2IPjrpReZcmUcUyMpd4dHA4FxAPar4d9o+bhHcp2l QoZaCzuzbfd/I4HvH9mokGpDTJrjWF0hcvFlh7FY01qFevfpdHhYeC6HiQ2dlpIS5hvw Zm5jF00MvdCgAoxI3ra2plSxq0I21DuhFZyBJmnoHjrOIwiOY1RPiMcWkocItP8+aaLU QZrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gGeLYYDf4rTDRKaXnuvkVdhU7gNXptPx3oKBnLol/+w=; b=F3yu7TYU7YC1m3KsKsH2/f4jS3uiVTnMKhPx0msRxrhitAT5elLEDNjB7H55srrhSb aI9bAFMFzrhaVpdIC74mcFQhOVCIuelFW47pLNkRk7bOlD/fTPXoHMuCRHjH+XBljp7x bZRqBeI5HUSnzZkHMFa9yloVfbU1F/HgYy4XdJFNiW4kZmrar1B56kdn/VvbR/lxOPvS NAzrUpfeAerzdZpOnF1GvU2aQ4orf8p6Cw9KXEhntsvpGBDR1cGGU8lRMoDYm+rUsNMn IjQF0ljAvgQhOaLIjpfyn3Teg+Pg2kpkB/WQINIPr8gg6xDIUA1HpiPJoCHA5OU9UoMU 7NiA== X-Gm-Message-State: APjAAAVsnbW3kPWI3ncKB39pGRoOIMOms+LSvRkkojCLHQtweg/d9ETY CLyVCzmrvazOdvycBz2bg3Mfn/6i X-Google-Smtp-Source: APXvYqzalNJ9S+Ng2WO5NffbV8DjLgmgn53ehZ0Sy9jMAs3/HpltCeAIlTv2cwWoGj82Lx8c/iXjWQ== X-Received: by 2002:a37:9d4b:: with SMTP id g72mr28954061qke.195.1582234179826; Thu, 20 Feb 2020 13:29:39 -0800 (PST) Received: from gateway.troianet.com.br (ipv6.troianet.com.br. [2804:688:21:4::2]) by smtp.gmail.com with ESMTPSA id t23sm412480qtp.82.2020.02.20.13.29.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Feb 2020 13:29:39 -0800 (PST) From: Eneas U de Queiroz To: openwrt-devel@lists.openwrt.org Date: Thu, 20 Feb 2020 18:29:04 -0300 Message-Id: <20200220212904.2444-4-cotequeiroz@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20200220212904.2444-1-cotequeiroz@gmail.com> References: <20200220212904.2444-1-cotequeiroz@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200220_132941_520139_D065B07E X-CRM114-Status: UNSURE ( 8.46 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:743 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [cotequeiroz[at]gmail.com] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Subject: [OpenWrt-Devel] [PATCH v2 3/3] build: reduce number of files passed to ipk-remove X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eneas U de Queiroz Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Instead of using xargs to pass a huge number of files to script/ipkg-remove, which will usually pick only one, use a more restrictive wildcard so that, currently, at the most 325 files are examined, instead of up to over 2,300. The 325-file package is python, which is picking up python3* ipks. It is about to be removed. Runner-up is ddns-scripts with 7 files. This makes a second run of make package/luci/compile go from real 16.40s; user 17.42s; sys 2.73s to real 10.71s; user 9.51s; sys 1.27s There is a caveat though: if one were to remove the ABI_VERSION of a package that ends in a digit [0-9], then the old package ipk will not be removed from the bin directory by make package/abc2/clean. Signed-off-by: Eneas U de Queiroz diff --git a/include/package-ipkg.mk b/include/package-ipkg.mk index 351cf25394..5b0143d56d 100644 --- a/include/package-ipkg.mk +++ b/include/package-ipkg.mk @@ -18,20 +18,16 @@ IPKG_REMOVE:= \ IPKG_STATE_DIR:=$(TARGET_DIR)/usr/lib/opkg -# 1: command and initial arguments -# 2: arguments list -# 3: tmp filename -define maybe_use_xargs - $(if $(word 512,$(2)), \ - $(file >$(3),$(2)) $(XARGS) $(1) < "$(3)"; rm "$(3)", \ - $(1) $(2)) +# Generates a make statement to return a wildcard for candidate ipkg files +# 1: package name +define gen_ipkg_wildcard + $(1)$$(if $$(filter -%,$$(ABIV_$(1))),,[^a-z-])* endef # 1: package name # 2: candidate ipk files define remove_ipkg_files - $(if $(strip $(2)), \ - $(call maybe_use_xargs,$(IPKG_REMOVE) $(1),$(2),$(TMP_DIR)/$(1).in)) + $(if $(strip $(2)),$(IPKG_REMOVE) $(1) $(2)) endef # 1: package name @@ -200,7 +196,8 @@ $(_endef) $$(IPKG_$(1)) : export DESCRIPTION=$$(Package/$(1)/description) $$(IPKG_$(1)) : export PATH=$$(TARGET_PATH_PKG) $(PKG_INFO_DIR)/$(1).provides $$(IPKG_$(1)): $(STAMP_BUILT) $(INCLUDE_DIR)/package-ipkg.mk - @rm -rf $$(IDIR_$(1)); $$(call remove_ipkg_files,$(1),$$(call opkg_package_files,$(1)*)) + @rm -rf $$(IDIR_$(1)); \ + $$(call remove_ipkg_files,$(1),$$(call opkg_package_files,$(call gen_ipkg_wildcard,$(1)))) mkdir -p $(PACKAGE_DIR) $$(IDIR_$(1))/CONTROL $(PKG_INFO_DIR) $(call Package/$(1)/install,$$(IDIR_$(1))) $(if $(Package/$(1)/install-overlay),mkdir -p $(PACKAGE_DIR) $$(IDIR_$(1))/rootfs-overlay) @@ -268,7 +265,7 @@ $(_endef) @[ -f $$(IPKG_$(1)) ] $(1)-clean: - $$(call remove_ipkg_files,$(1),$$(call opkg_package_files,$(1)*)) + $$(call remove_ipkg_files,$(1),$$(call opkg_package_files,$(call gen_ipkg_wildcard,$(1)))) clean: $(1)-clean