[Buildroot] [PATCH 1 of 3] infra: remove trailing slash from pkgparentdir function

Arnout Vandecappelle arnout at mind.be
Fri Nov 8 00:24:02 UTC 2013


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 at 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



More information about the buildroot mailing list