From patchwork Thu Apr 30 09:52:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 1280106 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=bootlin.com Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49CW0b2cMdz9sSd for ; Thu, 30 Apr 2020 19:53:18 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 9BD44235AE; Thu, 30 Apr 2020 09:53:15 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 38Yci2sqPc+O; Thu, 30 Apr 2020 09:53:14 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id ED9A9204E4; Thu, 30 Apr 2020 09:53:13 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 797B81BF86C for ; Thu, 30 Apr 2020 09:53:06 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 6D680204FA for ; Thu, 30 Apr 2020 09:53:06 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JkwsBVtogfuu for ; Thu, 30 Apr 2020 09:53:04 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) by silver.osuosl.org (Postfix) with ESMTPS id 44091204D3 for ; Thu, 30 Apr 2020 09:53:04 +0000 (UTC) X-Originating-IP: 86.210.146.109 Received: from localhost (lfbn-tou-1-915-109.w86-210.abo.wanadoo.fr [86.210.146.109]) (Authenticated sender: thomas.petazzoni@bootlin.com) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id 8933A240009; Thu, 30 Apr 2020 09:53:02 +0000 (UTC) From: Thomas Petazzoni To: Buildroot List Date: Thu, 30 Apr 2020 11:52:43 +0200 Message-Id: <20200430095249.782597-7-thomas.petazzoni@bootlin.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20200430095249.782597-1-thomas.petazzoni@bootlin.com> References: <20200430095249.782597-1-thomas.petazzoni@bootlin.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH 06/11] package/pkg-generic.mk: exclude the staging sub-directory X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Korsgaard , "Yann E. MORIN" , Thomas Petazzoni Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Now that we are checking the host directory changes throughout all installation steps and not just during the "host installation step", it means that changes done within the staging directory (which is a subdir of the host directory) are also visible in the .files-list-host.txt file. Note that this problem already potentially occurs if a host package is installing files in the staging directory: they would be listed in .files-list-host.txt even without the changes in this series. To fix this up, we simply exclude files that are beneath the $(STAGING_SUBDIR). Note that we do that in all cases, so when searching $(HOST_DIR), $(HOST_DIR)/$(STAGING_SUBDIR) is excluded, but when searching $(TARGET_DIR), $(TARGET_DIR)/$(STAGING_SUBDIR) is excluded, and when search $(STAGING_DIR), $(STAGING_DIR)/$(STAGING_SUBDIR) is excluded. This is not a problem in practice since $(TARGET_DIR)/$(STAGING_SUBDIR) and $(STAGING_DIR)/$(STAGING_SUBDIR) don't exist, but it's not very nice. However, it allows to keep the code simple. Signed-off-by: Thomas Petazzoni --- package/pkg-generic.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk index 3fb1e5f8c3..2ae269bb3d 100644 --- a/package/pkg-generic.mk +++ b/package/pkg-generic.mk @@ -61,7 +61,7 @@ GLOBAL_INSTRUMENTATION_HOOKS += step_time # $(2): suffix of file (optional) define pkg_size_before cd $(1); \ - LC_ALL=C find . \( -type f -o -type l \) -printf '%T@:%i:%#m:%y:%s,%p\n' \ + LC_ALL=C find . -not -path './$(STAGING_SUBDIR)/*' \( -type f -o -type l \) -printf '%T@:%i:%#m:%y:%s,%p\n' \ | LC_ALL=C sort > $($(PKG)_DIR)/.files-list$(2).before endef @@ -69,7 +69,7 @@ endef # $(2): suffix of file (optional) define pkg_size_after cd $(1); \ - LC_ALL=C find . \( -type f -o -type l \) -printf '%T@:%i:%#m:%y:%s,%p\n' \ + LC_ALL=C find . -not -path './$(STAGING_SUBDIR)/*' \( -type f -o -type l \) -printf '%T@:%i:%#m:%y:%s,%p\n' \ | LC_ALL=C sort > $($(PKG)_DIR)/.files-list$(2).after LC_ALL=C comm -13 \ $($(PKG)_DIR)/.files-list$(2).before \