All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 02/11] package/pkg-generic.mk: drop useless $(1) argument in step_pkg_size_{before, after}
Date: Thu, 30 Apr 2020 11:52:39 +0200	[thread overview]
Message-ID: <20200430095249.782597-3-thomas.petazzoni@bootlin.com> (raw)
In-Reply-To: <20200430095249.782597-1-thomas.petazzoni@bootlin.com>

The $(1) argument passed to step_pkg_size_{before,after}, which
contains the package name, is no longer used. We simply use $(PKG) to
get the upper-case version of the package name.

So, let's drop this first argument that isn't needed.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
 package/pkg-generic.mk | 40 +++++++++++++++++++---------------------
 1 file changed, 19 insertions(+), 21 deletions(-)

diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
index d8df34ed14..fc43807bb0 100644
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
@@ -57,45 +57,43 @@ GLOBAL_INSTRUMENTATION_HOOKS += step_time
 
 # Hooks to collect statistics about installed files
 
-# $(1): package name
-# $(2): base directory to search in
-# $(3): suffix of file (optional)
+# $(1): base directory to search in
+# $(2): suffix of file (optional)
 define step_pkg_size_before
-	cd $(2); \
+	cd $(1); \
 	LC_ALL=C find . \( -type f -o -type l \) -printf '%T@:%i:%#m:%y:%s,%p\n' \
-		| LC_ALL=C sort > $($(PKG)_DIR)/.files-list$(3).before
+		| LC_ALL=C sort > $($(PKG)_DIR)/.files-list$(2).before
 endef
 
-# $(1): package name
-# $(2): base directory to search in
-# $(3): suffix of file (optional)
+# $(1): base directory to search in
+# $(2): suffix of file (optional)
 define step_pkg_size_after
-	cd $(2); \
+	cd $(1); \
 	LC_ALL=C find . \( -type f -o -type l \) -printf '%T@:%i:%#m:%y:%s,%p\n' \
-		| LC_ALL=C sort > $($(PKG)_DIR)/.files-list$(3).after
+		| LC_ALL=C sort > $($(PKG)_DIR)/.files-list$(2).after
 	LC_ALL=C comm -13 \
-		$($(PKG)_DIR)/.files-list$(3).before \
-		$($(PKG)_DIR)/.files-list$(3).after \
+		$($(PKG)_DIR)/.files-list$(2).before \
+		$($(PKG)_DIR)/.files-list$(2).after \
 		| sed -r -e 's/^[^,]+/$($(PKG)_NAME)/' \
-		> $($(PKG)_DIR)/.files-list$(3).txt
-	rm -f $($(PKG)_DIR)/.files-list$(3).before
-	rm -f $($(PKG)_DIR)/.files-list$(3).after
+		> $($(PKG)_DIR)/.files-list$(2).txt
+	rm -f $($(PKG)_DIR)/.files-list$(2).before
+	rm -f $($(PKG)_DIR)/.files-list$(2).after
 endef
 
 define step_pkg_size
 	$(if $(filter start-install-target,$(1)-$(2)),\
-		$(call step_pkg_size_before,$(3),$(TARGET_DIR)))
+		$(call step_pkg_size_before,$(TARGET_DIR)))
 	$(if $(filter start-install-staging,$(1)-$(2)),\
-		$(call step_pkg_size_before,$(3),$(STAGING_DIR),-staging))
+		$(call step_pkg_size_before,$(STAGING_DIR),-staging))
 	$(if $(filter start-install-host,$(1)-$(2)),\
-		$(call step_pkg_size_before,$(3),$(HOST_DIR),-host))
+		$(call step_pkg_size_before,$(HOST_DIR),-host))
 
 	$(if $(filter end-install-target,$(1)-$(2)),\
-		$(call step_pkg_size_after,$(3),$(TARGET_DIR)))
+		$(call step_pkg_size_after,$(TARGET_DIR)))
 	$(if $(filter end-install-staging,$(1)-$(2)),\
-		$(call step_pkg_size_after,$(3),$(STAGING_DIR),-staging))
+		$(call step_pkg_size_after,$(STAGING_DIR),-staging))
 	$(if $(filter end-install-host,$(1)-$(2)),\
-		$(call step_pkg_size_after,$(3),$(HOST_DIR),-host))
+		$(call step_pkg_size_after,$(HOST_DIR),-host))
 endef
 GLOBAL_INSTRUMENTATION_HOOKS += step_pkg_size
 
-- 
2.25.4

  parent reply	other threads:[~2020-04-30  9:52 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-30  9:52 [Buildroot] [PATCH 00/11] Overwritten file detection, improvements to file listing logic Thomas Petazzoni
2020-04-30  9:52 ` [Buildroot] [PATCH 01/11] package/pkg-generic.mk: use $(PKG)_NAME in step_pkg_size_after Thomas Petazzoni
2020-04-30  9:52 ` Thomas Petazzoni [this message]
2020-04-30  9:52 ` [Buildroot] [PATCH 03/11] package/pkg-generic.mk: introduce final 'install' step Thomas Petazzoni
2020-04-30  9:52 ` [Buildroot] [PATCH 04/11] package/pkg-generic.mk: create directories upfront in the configure step Thomas Petazzoni
2020-04-30  9:52 ` [Buildroot] [PATCH 05/11] package/pkg-generic.mk: rework pkg_size logic with the "installed" step Thomas Petazzoni
2020-05-01 20:44   ` Yann E. MORIN
2020-05-02  9:52     ` Thomas Petazzoni
2020-04-30  9:52 ` [Buildroot] [PATCH 06/11] package/pkg-generic.mk: exclude the staging sub-directory Thomas Petazzoni
2020-05-01 20:57   ` Yann E. MORIN
2020-04-30  9:52 ` [Buildroot] [PATCH 07/11] package/pkg-generic.mk: move pkg_size_{before, after} and check_bin_arch functions Thomas Petazzoni
2020-05-01 21:01   ` Yann E. MORIN
2020-04-30  9:52 ` [Buildroot] [PATCH 08/11] package/pkg-generic.mk: detect files overwritten in TARGET_DIR and HOST_DIR Thomas Petazzoni
2020-05-01 21:23   ` Yann E. MORIN
2020-07-24 19:53     ` Yann E. MORIN
2020-07-25  5:58       ` Peter Korsgaard
2020-07-25  7:13         ` Yann E. MORIN
2020-07-25  8:12           ` Peter Korsgaard
2020-04-30  9:52 ` [Buildroot] [PATCH 09/11] support/testing/infra: add log_file_path() function Thomas Petazzoni
2020-07-24 20:11   ` Yann E. MORIN
2020-04-30  9:52 ` [Buildroot] [PATCH 10/11] support/testing/tests: add test for check_bin_arch Thomas Petazzoni
2020-07-25 11:59   ` Yann E. MORIN
2020-04-30  9:52 ` [Buildroot] [PATCH 11/11] support/testing/tests: add test for file overwrite detection Thomas Petazzoni
2020-07-25 12:05   ` Yann E. MORIN
2020-07-23 20:54 ` [Buildroot] [PATCH 00/11] Overwritten file detection, improvements to file listing logic Yann E. MORIN

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200430095249.782597-3-thomas.petazzoni@bootlin.com \
    --to=thomas.petazzoni@bootlin.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.