All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnout Vandecappelle <arnout@mind.be>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 2 of 2] infra: remove usage of pkgparentdir in favor of pkgdir
Date: Tue, 12 Nov 2013 00:15:53 +0100	[thread overview]
Message-ID: <52816529.9010704@mind.be> (raw)
In-Reply-To: <8953db252a5816d2e988.1384170792@argentina>

On 11/11/13 12:53, Thomas De Schampheleire wrote:
> As Arnout suggested, pkgparentdir is no longer really needed. Its usage can
> be replaced with pkgdir. This patch makes that change, and removes the
> definition of pkgparentdir.
>
> Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
>
> ---
> Note: as a consequence of this change, the definition of FOO_DIR_PREFIX
> slightly changed. I could have renamed the variable, but FOO_DIR was already
> taken, and it's still more or less a prefix.

  I think it's a better idea to choose a new name - if only to help 
people who are using this variable in custom packages. Or better yet, 
remove it completely - it's anyway not used anymore.


>
>   package/pkg-autotools.mk |   6 +++---
>   package/pkg-cmake.mk     |   6 +++---
>   package/pkg-generic.mk   |  10 +++++-----
>   package/pkg-utils.mk     |   1 -
>   4 files changed, 11 insertions(+), 12 deletions(-)
>
> diff --git a/package/pkg-autotools.mk b/package/pkg-autotools.mk
> --- a/package/pkg-autotools.mk
> +++ b/package/pkg-autotools.mk
> @@ -48,7 +48,7 @@ endef
>   #             for host packages
>   #  argument 3 is the uppercase package name, without the HOST_ prefix
>   #             for host packages
> -#  argument 4 is the package directory prefix
> +#  argument 4 is the package directory
>   #  argument 5 is the type (target or host)
>   ################################################################################
>
> @@ -311,5 +311,5 @@ endef
>   # autotools-package -- the target generator macro for autotools packages
>   ################################################################################
>
> -autotools-package = $(call inner-autotools-package,$(call pkgname),$(call UPPERCASE,$(call pkgname)),$(call UPPERCASE,$(call pkgname)),$(call pkgparentdir),target)
> -host-autotools-package = $(call inner-autotools-package,host-$(call pkgname),$(call UPPERCASE,host-$(call pkgname)),$(call UPPERCASE,$(call pkgname)),$(call pkgparentdir),host)
> +autotools-package = $(call inner-autotools-package,$(call pkgname),$(call UPPERCASE,$(call pkgname)),$(call UPPERCASE,$(call pkgname)),$(call pkgdir),target)
> +host-autotools-package = $(call inner-autotools-package,host-$(call pkgname),$(call UPPERCASE,host-$(call pkgname)),$(call UPPERCASE,$(call pkgname)),$(call pkgdir),host)
> diff --git a/package/pkg-cmake.mk b/package/pkg-cmake.mk
> --- a/package/pkg-cmake.mk
> +++ b/package/pkg-cmake.mk
> @@ -31,7 +31,7 @@
>   #             for host packages
>   #  argument 3 is the uppercase package name, without the HOST_ prefix
>   #             for host packages
> -#  argument 4 is the package directory prefix
> +#  argument 4 is the package directory
>   #  argument 5 is the type (target or host)
>   ################################################################################
>
> @@ -179,8 +179,8 @@ endef
>   # cmake-package -- the target generator macro for CMake packages
>   ################################################################################
>
> -cmake-package = $(call inner-cmake-package,$(call pkgname),$(call UPPERCASE,$(call pkgname)),$(call UPPERCASE,$(call pkgname)),$(call pkgparentdir),target)
> -host-cmake-package = $(call inner-cmake-package,host-$(call pkgname),$(call UPPERCASE,host-$(call pkgname)),$(call UPPERCASE,$(call pkgname)),$(call pkgparentdir),host)
> +cmake-package = $(call inner-cmake-package,$(call pkgname),$(call UPPERCASE,$(call pkgname)),$(call UPPERCASE,$(call pkgname)),$(call pkgdir),target)
> +host-cmake-package = $(call inner-cmake-package,host-$(call pkgname),$(call UPPERCASE,host-$(call pkgname)),$(call UPPERCASE,$(call pkgname)),$(call pkgdir),host)
>
>   ################################################################################
>   # Generation of the CMake toolchain file
> diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
> --- a/package/pkg-generic.mk
> +++ b/package/pkg-generic.mk
> @@ -89,7 +89,7 @@ endif
>   # find the package directory (typically package/<pkgname>) and the
>   # prefix of the patches
>   $(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: PATCH_BASE_DIRS = $($(PKG)_DIR_PREFIX) $(call qstrip,$(BR2_GLOBAL_PATCH_DIR))/$(RAWNAME)
>   $(BUILD_DIR)/%/.stamp_patched:
>   	@$(call MESSAGE,"Patching")
>   	$(foreach hook,$($(PKG)_PRE_PATCH_HOOKS),$(call $(hook))$(sep))
> @@ -197,7 +197,7 @@ endif
>   #             for host packages
>   #  argument 3 is the uppercase package name, without the HOST_ prefix
>   #             for host packages
> -#  argument 4 is the package directory prefix
> +#  argument 4 is the package directory
>   #  argument 5 is the type (target or host)
>   ################################################################################
>
> @@ -475,7 +475,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 ifneq ($(filter boot/%,$(4)),)

  Since this is the only place where $(4) is used, we could use $(pkgdir) 
directly and drop the 4th parameter. (I just tested and it seems to work.)


  Regards,
  Arnout

>   $(2)_KCONFIG_VAR = BR2_TARGET_$(2)
>   else
>   $(2)_KCONFIG_VAR = BR2_PACKAGE_$(2)
> @@ -565,8 +565,8 @@ endef # inner-generic-package
>   ################################################################################
>
>   # In the case of target packages, keep the package name "pkg"
> -generic-package = $(call inner-generic-package,$(call pkgname),$(call UPPERCASE,$(call pkgname)),$(call UPPERCASE,$(call pkgname)),$(call pkgparentdir),target)
> +generic-package = $(call inner-generic-package,$(call pkgname),$(call UPPERCASE,$(call pkgname)),$(call UPPERCASE,$(call pkgname)),$(call pkgdir),target)
>   # In the case of host packages, turn the package name "pkg" into "host-pkg"
> -host-generic-package = $(call inner-generic-package,host-$(call pkgname),$(call UPPERCASE,host-$(call pkgname)),$(call UPPERCASE,$(call pkgname)),$(call pkgparentdir),host)
> +host-generic-package = $(call inner-generic-package,host-$(call pkgname),$(call UPPERCASE,host-$(call pkgname)),$(call UPPERCASE,$(call pkgname)),$(call pkgdir),host)
>
>   # :mode=makefile:
> diff --git a/package/pkg-utils.mk b/package/pkg-utils.mk
> --- a/package/pkg-utils.mk
> +++ b/package/pkg-utils.mk
> @@ -60,7 +60,6 @@ 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))
>
>   # Define extractors for different archive suffixes
>   INFLATE.bz2  = $(BZCAT)
>


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

  reply	other threads:[~2013-11-11 23:15 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-11 11:53 [Buildroot] [PATCH 0 of 2] infra: remove pkgparentdir Thomas De Schampheleire
2013-11-11 11:53 ` [Buildroot] [PATCH 1 of 2] dhrystone: remove usage of FOO_DIR_PREFIX Thomas De Schampheleire
2014-02-04 13:18   ` Peter Korsgaard
2013-11-11 11:53 ` [Buildroot] [PATCH 2 of 2] infra: remove usage of pkgparentdir in favor of pkgdir Thomas De Schampheleire
2013-11-11 23:15   ` Arnout Vandecappelle [this message]
2013-11-12  8:56     ` Thomas De Schampheleire
2013-11-12 11:09       ` Thomas Petazzoni
2013-11-12 11:32         ` Thomas De Schampheleire
2013-11-12 13:42           ` Arnout Vandecappelle
2013-11-12 13:49             ` Thomas De Schampheleire
2013-11-12 15:35               ` Arnout Vandecappelle
2013-11-12 22:06                 ` Peter Korsgaard
2013-11-12 22:05             ` Peter Korsgaard
2013-12-05 14:53             ` Thomas De Schampheleire
2013-12-15 13:14               ` Thomas De Schampheleire
2013-11-12 13:46       ` Arnout Vandecappelle

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=52816529.9010704@mind.be \
    --to=arnout@mind.be \
    --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.