Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 0 of 3] infra: misc. changes related to pkgparentdir
@ 2013-11-07 16:26 Thomas De Schampheleire
  2013-11-07 16:26 ` [Buildroot] [PATCH 1 of 3] infra: remove trailing slash from pkgparentdir function Thomas De Schampheleire
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Thomas De Schampheleire @ 2013-11-07 16:26 UTC (permalink / raw)
  To: buildroot

This series was driven by the observation that the 'Patching' message
contained a double slash which annoyed me:

>>> host-lzop 1.03 Patching package//lzop

While fixing this (pkgparentdir change), I bumped into FOO_DIR_PREFIX which
had an incorrect default, and the realization that the Patching message
didn't really need that directory anyway.

Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>

---
 package/pkg-generic.mk |  6 +++---
 package/pkg-utils.mk   |  2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Buildroot] [PATCH 1 of 3] infra: remove trailing slash from pkgparentdir function
  2013-11-07 16:26 [Buildroot] [PATCH 0 of 3] infra: misc. changes related to pkgparentdir Thomas De Schampheleire
@ 2013-11-07 16:26 ` Thomas De Schampheleire
  2013-11-08  0:24   ` Arnout Vandecappelle
  2013-11-07 16:26 ` [Buildroot] [PATCH 2 of 3] infra: remove incorrect default for FOO_DIR_PREFIX Thomas De Schampheleire
  2013-11-07 16:26 ` [Buildroot] [PATCH 3 of 3] infra: clean up 'Patching' message Thomas De Schampheleire
  2 siblings, 1 reply; 9+ messages in thread
From: Thomas De Schampheleire @ 2013-11-07 16:26 UTC (permalink / raw)
  To: buildroot

For a package located in package/foo/foo.mk, the pkgparentdir function
returns "package/". For a package located in boot/barebox/barebox.mk, it
returns "boot/". For linux/linux.mk, it returns the empty string.

There is actually no reason for the trailing slash in this function.
In the package 'Patching' message, it causes a double slash:
>>> host-lzop 1.03 Patching package//lzop
due to:
@$(call MESSAGE,"Patching $($(PKG)_DIR_PREFIX)/$(RAWNAME)")
(FOO_DIR_PREFIX is populated from pkgparentdir)

While the printing of 'package//lzop' in the message above is not useful,
and will be removed in a subsequent following patch, this patch removes
the unnecessary trailing slash in pkgparentdir anyhow

Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>

---
 package/pkg-generic.mk |  2 +-
 package/pkg-utils.mk   |  2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
@@ -473,7 +473,7 @@ endif
 # kernel case, the bootloaders case, and the normal packages case.
 ifeq ($(1),linux)
 $(2)_KCONFIG_VAR = BR2_LINUX_KERNEL
-else ifeq ($(4),boot/)
+else ifeq ($(4),boot)
 $(2)_KCONFIG_VAR = BR2_TARGET_$(2)
 else
 $(2)_KCONFIG_VAR = BR2_PACKAGE_$(2)
diff --git a/package/pkg-utils.mk b/package/pkg-utils.mk
--- a/package/pkg-utils.mk
+++ b/package/pkg-utils.mk
@@ -52,7 +52,7 @@ endef
 # package, for which the package directory is an empty string.
 pkgdir       = $(dir $(lastword $(MAKEFILE_LIST)))
 pkgname      = $(lastword $(subst /, ,$(call pkgdir)))
-pkgparentdir = $(patsubst %$(call pkgname)/,%,$(call pkgdir))
+pkgparentdir = $(patsubst %/,%,$(patsubst %$(call pkgname)/,%,$(call pkgdir)))
 
 # Define extractors for different archive suffixes
 INFLATE.bz2  = $(BZCAT)

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Buildroot] [PATCH 2 of 3] infra: remove incorrect default for FOO_DIR_PREFIX
  2013-11-07 16:26 [Buildroot] [PATCH 0 of 3] infra: misc. changes related to pkgparentdir Thomas De Schampheleire
  2013-11-07 16:26 ` [Buildroot] [PATCH 1 of 3] infra: remove trailing slash from pkgparentdir function Thomas De Schampheleire
@ 2013-11-07 16:26 ` Thomas De Schampheleire
  2013-11-10 23:14   ` Peter Korsgaard
  2013-11-07 16:26 ` [Buildroot] [PATCH 3 of 3] infra: clean up 'Patching' message Thomas De Schampheleire
  2 siblings, 1 reply; 9+ messages in thread
From: Thomas De Schampheleire @ 2013-11-07 16:26 UTC (permalink / raw)
  To: buildroot

Variable FOO_DIR_PREFIX is populated from pkgparentdir by the various
package infrastructures. However, if that would be empty (which in fact is
the case for the linux package), FOO_DIR_PREFIX would be set to
'$(TOP_SRCDIR)/package'.
Not only does this make no sense (LINUX_DIR_PREFIX becomes /package/linux,
and for all other packages pkgparentdir is not-empty anyway), but it is also
using a non-existing variable TOP_SRCDIR.
This patch therefore removes the incorrect default.

Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>

---
 package/pkg-generic.mk |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
@@ -313,7 +313,7 @@ endif
 $(2)_INSTALL_STAGING		?= NO
 $(2)_INSTALL_IMAGES		?= NO
 $(2)_INSTALL_TARGET		?= YES
-$(2)_DIR_PREFIX			= $(if $(4),$(4),$(TOP_SRCDIR)/package)
+$(2)_DIR_PREFIX			= $(4)
 
 # define sub-target stamps
 $(2)_TARGET_INSTALL_TARGET =	$$($(2)_DIR)/.stamp_target_installed

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Buildroot] [PATCH 3 of 3] infra: clean up 'Patching' message
  2013-11-07 16:26 [Buildroot] [PATCH 0 of 3] infra: misc. changes related to pkgparentdir Thomas De Schampheleire
  2013-11-07 16:26 ` [Buildroot] [PATCH 1 of 3] infra: remove trailing slash from pkgparentdir function Thomas De Schampheleire
  2013-11-07 16:26 ` [Buildroot] [PATCH 2 of 3] infra: remove incorrect default for FOO_DIR_PREFIX Thomas De Schampheleire
@ 2013-11-07 16:26 ` Thomas De Schampheleire
  2013-11-08  0:25   ` Arnout Vandecappelle
  2013-11-10 23:15   ` Peter Korsgaard
  2 siblings, 2 replies; 9+ messages in thread
From: Thomas De Schampheleire @ 2013-11-07 16:26 UTC (permalink / raw)
  To: buildroot

The 'Patching' message in the generic infrastructure prints not only the
package name, but also a reference to the assumed package directory, based
on FOO_DIR_PREFIX/FOO_RAWNAME. This doesn't really add value, as the name
of the package is already apparent from the message and its location should
be obvious. Hence, this patch simply reduces the print to "Patching".

Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>

---
 package/pkg-generic.mk |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
@@ -90,7 +90,7 @@ endif
 $(BUILD_DIR)/%/.stamp_patched: NAMEVER = $(RAWNAME)-$($(PKG)_VERSION)
 $(BUILD_DIR)/%/.stamp_patched: PATCH_BASE_DIRS = $($(PKG)_DIR_PREFIX)/$(RAWNAME) $(call qstrip,$(BR2_GLOBAL_PATCH_DIR))/$(RAWNAME)
 $(BUILD_DIR)/%/.stamp_patched:
-	@$(call MESSAGE,"Patching $($(PKG)_DIR_PREFIX)/$(RAWNAME)")
+	@$(call MESSAGE,"Patching")
 	$(foreach hook,$($(PKG)_PRE_PATCH_HOOKS),$(call $(hook))$(sep))
 	$(foreach p,$($(PKG)_PATCH),support/scripts/apply-patches.sh $(@D) $(DL_DIR) $(notdir $(p))$(sep))
 	$(Q)( \

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Buildroot] [PATCH 1 of 3] infra: remove trailing slash from pkgparentdir function
  2013-11-07 16:26 ` [Buildroot] [PATCH 1 of 3] infra: remove trailing slash from pkgparentdir function Thomas De Schampheleire
@ 2013-11-08  0:24   ` Arnout Vandecappelle
  2013-11-10 21:06     ` Thomas De Schampheleire
  0 siblings, 1 reply; 9+ messages in thread
From: Arnout Vandecappelle @ 2013-11-08  0:24 UTC (permalink / raw)
  To: buildroot

On 07/11/13 17:26, Thomas De Schampheleire wrote:
> For a package located in package/foo/foo.mk, the pkgparentdir function
> returns "package/". For a package located in boot/barebox/barebox.mk, it
> returns "boot/". For linux/linux.mk, it returns the empty string.
>
> There is actually no reason for the trailing slash in this function.
> In the package 'Patching' message, it causes a double slash:
>>>> host-lzop 1.03 Patching package//lzop
> due to:
> @$(call MESSAGE,"Patching $($(PKG)_DIR_PREFIX)/$(RAWNAME)")
> (FOO_DIR_PREFIX is populated from pkgparentdir)
>
> While the printing of 'package//lzop' in the message above is not useful,
> and will be removed in a subsequent following patch, this patch removes
> the unnecessary trailing slash in pkgparentdir anyhow
>
> Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
>
> ---
>   package/pkg-generic.mk |  2 +-
>   package/pkg-utils.mk   |  2 +-
>   2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
> --- a/package/pkg-generic.mk
> +++ b/package/pkg-generic.mk
> @@ -473,7 +473,7 @@ endif
>   # kernel case, the bootloaders case, and the normal packages case.
>   ifeq ($(1),linux)
>   $(2)_KCONFIG_VAR = BR2_LINUX_KERNEL
> -else ifeq ($(4),boot/)
> +else ifeq ($(4),boot)
>   $(2)_KCONFIG_VAR = BR2_TARGET_$(2)
>   else
>   $(2)_KCONFIG_VAR = BR2_PACKAGE_$(2)
> diff --git a/package/pkg-utils.mk b/package/pkg-utils.mk
> --- a/package/pkg-utils.mk
> +++ b/package/pkg-utils.mk
> @@ -52,7 +52,7 @@ endef
>   # package, for which the package directory is an empty string.
>   pkgdir       = $(dir $(lastword $(MAKEFILE_LIST)))
>   pkgname      = $(lastword $(subst /, ,$(call pkgdir)))
> -pkgparentdir = $(patsubst %$(call pkgname)/,%,$(call pkgdir))
> +pkgparentdir = $(patsubst %/,%,$(patsubst %$(call pkgname)/,%,$(call pkgdir)))

  I wonder if pkgparentdir is even needed anymore. For most cases, we 
actually need $(pkgdir). Only for the check against boot/* the parent 
directory is needed, but that one can be replaced with

else ifneq ($(filter boot/%,$(4)),)

(assuming $(4) is $(pkgdir) instead of $(pkgparentdir)).


  Regards,
  Arnout

>
>   # Define extractors for different archive suffixes
>   INFLATE.bz2  = $(BZCAT)
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
>


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Buildroot] [PATCH 3 of 3] infra: clean up 'Patching' message
  2013-11-07 16:26 ` [Buildroot] [PATCH 3 of 3] infra: clean up 'Patching' message Thomas De Schampheleire
@ 2013-11-08  0:25   ` Arnout Vandecappelle
  2013-11-10 23:15   ` Peter Korsgaard
  1 sibling, 0 replies; 9+ messages in thread
From: Arnout Vandecappelle @ 2013-11-08  0:25 UTC (permalink / raw)
  To: buildroot

On 07/11/13 17:26, Thomas De Schampheleire wrote:
> The 'Patching' message in the generic infrastructure prints not only the
> package name, but also a reference to the assumed package directory, based
> on FOO_DIR_PREFIX/FOO_RAWNAME. This doesn't really add value, as the name
> of the package is already apparent from the message and its location should
> be obvious. Hence, this patch simply reduces the print to "Patching".
>
> Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>

Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>

>
> ---
>   package/pkg-generic.mk |  2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
> --- a/package/pkg-generic.mk
> +++ b/package/pkg-generic.mk
> @@ -90,7 +90,7 @@ endif
>   $(BUILD_DIR)/%/.stamp_patched: NAMEVER = $(RAWNAME)-$($(PKG)_VERSION)
>   $(BUILD_DIR)/%/.stamp_patched: PATCH_BASE_DIRS = $($(PKG)_DIR_PREFIX)/$(RAWNAME) $(call qstrip,$(BR2_GLOBAL_PATCH_DIR))/$(RAWNAME)
>   $(BUILD_DIR)/%/.stamp_patched:
> -	@$(call MESSAGE,"Patching $($(PKG)_DIR_PREFIX)/$(RAWNAME)")
> +	@$(call MESSAGE,"Patching")
>   	$(foreach hook,$($(PKG)_PRE_PATCH_HOOKS),$(call $(hook))$(sep))
>   	$(foreach p,$($(PKG)_PATCH),support/scripts/apply-patches.sh $(@D) $(DL_DIR) $(notdir $(p))$(sep))
>   	$(Q)( \
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
>


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Buildroot] [PATCH 1 of 3] infra: remove trailing slash from pkgparentdir function
  2013-11-08  0:24   ` Arnout Vandecappelle
@ 2013-11-10 21:06     ` Thomas De Schampheleire
  0 siblings, 0 replies; 9+ messages in thread
From: Thomas De Schampheleire @ 2013-11-10 21:06 UTC (permalink / raw)
  To: buildroot

Arnout Vandecappelle <arnout@mind.be> wrote:
>On 07/11/13 17:26, Thomas De Schampheleire wrote:
>> For a package located in package/foo/foo.mk, the pkgparentdir function
>> returns "package/". For a package located in boot/barebox/barebox.mk, it
>> returns "boot/". For linux/linux.mk, it returns the empty string.
>>
>> There is actually no reason for the trailing slash in this function.
>> In the package 'Patching' message, it causes a double slash:
>>>>> host-lzop 1.03 Patching package//lzop
>> due to:
>> @$(call MESSAGE,"Patching $($(PKG)_DIR_PREFIX)/$(RAWNAME)")
>> (FOO_DIR_PREFIX is populated from pkgparentdir)
>>
>> While the printing of 'package//lzop' in the message above is not useful,
>> and will be removed in a subsequent following patch, this patch removes
>> the unnecessary trailing slash in pkgparentdir anyhow
>>
>> Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
>>
>> ---
>>   package/pkg-generic.mk |  2 +-
>>   package/pkg-utils.mk   |  2 +-
>>   2 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
>> --- a/package/pkg-generic.mk
>> +++ b/package/pkg-generic.mk
>> @@ -473,7 +473,7 @@ endif
>>   # kernel case, the bootloaders case, and the normal packages case.
>>   ifeq ($(1),linux)
>>   $(2)_KCONFIG_VAR = BR2_LINUX_KERNEL
>> -else ifeq ($(4),boot/)
>> +else ifeq ($(4),boot)
>>   $(2)_KCONFIG_VAR = BR2_TARGET_$(2)
>>   else
>>   $(2)_KCONFIG_VAR = BR2_PACKAGE_$(2)
>> diff --git a/package/pkg-utils.mk b/package/pkg-utils.mk
>> --- a/package/pkg-utils.mk
>> +++ b/package/pkg-utils.mk
>> @@ -52,7 +52,7 @@ endef
>>   # package, for which the package directory is an empty string.
>>   pkgdir       = $(dir $(lastword $(MAKEFILE_LIST)))
>>   pkgname      = $(lastword $(subst /, ,$(call pkgdir)))
>> -pkgparentdir = $(patsubst %$(call pkgname)/,%,$(call pkgdir))
>> +pkgparentdir = $(patsubst %/,%,$(patsubst %$(call pkgname)/,%,$(call pkgdir)))
>
>  I wonder if pkgparentdir is even needed anymore. For most cases, we 
>actually need $(pkgdir). Only for the check against boot/* the parent 
>directory is needed, but that one can be replaced with
>
>else ifneq ($(filter boot/%,$(4)),)
>
>(assuming $(4) is $(pkgdir) instead of $(pkgparentdir)).

I'm on it...

Best regards,
Thomas

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Buildroot] [PATCH 2 of 3] infra: remove incorrect default for FOO_DIR_PREFIX
  2013-11-07 16:26 ` [Buildroot] [PATCH 2 of 3] infra: remove incorrect default for FOO_DIR_PREFIX Thomas De Schampheleire
@ 2013-11-10 23:14   ` Peter Korsgaard
  0 siblings, 0 replies; 9+ messages in thread
From: Peter Korsgaard @ 2013-11-10 23:14 UTC (permalink / raw)
  To: buildroot

>>>>> "Thomas" == Thomas De Schampheleire <patrickdepinguin@gmail.com> writes:

> Variable FOO_DIR_PREFIX is populated from pkgparentdir by the various
> package infrastructures. However, if that would be empty (which in fact is
> the case for the linux package), FOO_DIR_PREFIX would be set to
> '$(TOP_SRCDIR)/package'.
> Not only does this make no sense (LINUX_DIR_PREFIX becomes /package/linux,
> and for all other packages pkgparentdir is not-empty anyway), but it is also
> using a non-existing variable TOP_SRCDIR.
> This patch therefore removes the incorrect default.

> Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>

Committed, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Buildroot] [PATCH 3 of 3] infra: clean up 'Patching' message
  2013-11-07 16:26 ` [Buildroot] [PATCH 3 of 3] infra: clean up 'Patching' message Thomas De Schampheleire
  2013-11-08  0:25   ` Arnout Vandecappelle
@ 2013-11-10 23:15   ` Peter Korsgaard
  1 sibling, 0 replies; 9+ messages in thread
From: Peter Korsgaard @ 2013-11-10 23:15 UTC (permalink / raw)
  To: buildroot

>>>>> "Thomas" == Thomas De Schampheleire <patrickdepinguin@gmail.com> writes:

> The 'Patching' message in the generic infrastructure prints not only the
> package name, but also a reference to the assumed package directory, based
> on FOO_DIR_PREFIX/FOO_RAWNAME. This doesn't really add value, as the name
> of the package is already apparent from the message and its location should
> be obvious. Hence, this patch simply reduces the print to "Patching".

> Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>

Committed, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2013-11-10 23:15 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-07 16:26 [Buildroot] [PATCH 0 of 3] infra: misc. changes related to pkgparentdir Thomas De Schampheleire
2013-11-07 16:26 ` [Buildroot] [PATCH 1 of 3] infra: remove trailing slash from pkgparentdir function Thomas De Schampheleire
2013-11-08  0:24   ` Arnout Vandecappelle
2013-11-10 21:06     ` Thomas De Schampheleire
2013-11-07 16:26 ` [Buildroot] [PATCH 2 of 3] infra: remove incorrect default for FOO_DIR_PREFIX Thomas De Schampheleire
2013-11-10 23:14   ` Peter Korsgaard
2013-11-07 16:26 ` [Buildroot] [PATCH 3 of 3] infra: clean up 'Patching' message Thomas De Schampheleire
2013-11-08  0:25   ` Arnout Vandecappelle
2013-11-10 23:15   ` Peter Korsgaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox