From patchwork Tue Dec 17 09:00:26 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ryan Barnett X-Patchwork-Id: 302051 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (fraxinus.osuosl.org [140.211.166.137]) by ozlabs.org (Postfix) with ESMTP id 5E9B32C0084 for ; Tue, 17 Dec 2013 20:01:06 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 83DB58AD06; Tue, 17 Dec 2013 09:01:05 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RDBdCQIaKPOv; Tue, 17 Dec 2013 09:01:02 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id C1AB7896A3; Tue, 17 Dec 2013 09:01:02 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id B0BBE1BFA3E for ; Tue, 17 Dec 2013 09:01:01 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id ABD2A8B30B for ; Tue, 17 Dec 2013 09:01:01 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id AXb-gBIs+yCE for ; Tue, 17 Dec 2013 09:00:58 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from secvs01.rockwellcollins.com (secvs01.rockwellcollins.com [205.175.225.240]) by whitealder.osuosl.org (Postfix) with ESMTPS id 3C1EE881B5 for ; Tue, 17 Dec 2013 09:00:58 +0000 (UTC) Received: from nosuchhost.198.131.in-addr.arpa (HELO collinscrsmtp01.rockwellcollins.com) ([131.198.63.132]) by mail-virt.rockwellcollins.com with ESMTP; 17 Dec 2013 03:00:57 -0600 Received: from nunkun.rockwellcollins.com ([131.198.63.11]) by collinscrsmtp01.rockwellcollins.com (Lotus Domino Release 8.5.2FP2 HF162) with ESMTP id 2013121703005645-2502577 ; Tue, 17 Dec 2013 03:00:56 -0600 From: Ryan Barnett To: buildroot@busybox.net Date: Tue, 17 Dec 2013 03:00:26 -0600 Message-Id: <1387270827-4379-1-git-send-email-rjbarnet@rockwellcollins.com> X-Mailer: git-send-email 1.7.9.5 X-MIMETrack: Itemize by SMTP Server on CollinsCRSMTP01/CedarRapids/Collins/Rockwell(Release 8.5.2FP2 HF162|May 16, 2011) at 12/17/2013 03:00:56 AM, Serialize by Router on CollinsCRSMTP01/CedarRapids/Collins/Rockwell(Release 8.5.2FP2 HF162|May 16, 2011) at 12/17/2013 03:00:57 AM, Serialize complete at 12/17/2013 03:00:57 AM X-TNEFEvaluated: 1 Subject: [Buildroot] [PATCH v4 1/2] Support for multiple BR2_GLOBAL_PATCH_DIR X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net Adding support for specifying multiple directories in BR2_GLOBAL_PATCH_DIR. This will allow for a layered approach for the patching of a package. Signed-off-by: Ryan Barnett Cc: Thomas De Schampheleire Cc: Arnout Vandecappelle Reviewed-by: Thomas De Schampheleire --- Changes v3 -> v4: - None Changes v2 -> v3: - changed the generation of patch directories to use 'addsuffix' instead of a foreach loop. (suggested by Arnout) Changes v1 -> v2: - change wording in Config.in help (suggested by Thomas D) --- Config.in | 20 ++++++++++++-------- package/pkg-generic.mk | 5 ++++- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/Config.in b/Config.in index 2b401cb..d55e57c 100644 --- a/Config.in +++ b/Config.in @@ -461,18 +461,22 @@ config BR2_PACKAGE_OVERRIDE_FILE Buildroot documentation for more details on this feature. config BR2_GLOBAL_PATCH_DIR - string "global patch directory" + string "global patch directories" help - You may specify a directory containing global package patches. - For a specific version of a specific package - , patches are applied as follows. + You may specify a space separated list of one or more directories + containing global package patches. For a specific version + of a specific package , patches are + applied as follows: - First, the default Buildroot patch set for the package is applied. + First, the default Buildroot patch set for the package is applied + from the package's directory in Buildroot. - If the directory $(BR2_GLOBAL_PATCH_DIR)// - exists, then all *.patch files in the directory will be applied. + Then for every directory - - that exists in + BR2_GLOBAL_PATCH_DIR, if the directory + /// exists, then all + *.patch files in this directory will be applied. - Otherwise, if the directory $(BR2_GLOBAL_PATCH_DIR)/ exists, + Otherwise, if the directory / exists, then all *.patch files in the directory will be applied. endmenu diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk index 45b808a..66034ba 100644 --- a/package/pkg-generic.mk +++ b/package/pkg-generic.mk @@ -134,8 +134,11 @@ endif # The RAWNAME variable is the lowercased package name, which allows to # find the package directory (typically package/) and the # prefix of the patches +# +# For BR2_GLOBAL_PATCH_DIR, only generate if it is defined $(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)/$(RAWNAME) +$(BUILD_DIR)/%/.stamp_patched: PATCH_BASE_DIRS += $(addsuffix /$(RAWNAME),$(call qstrip,$(BR2_GLOBAL_PATCH_DIR))) $(BUILD_DIR)/%/.stamp_patched: @$(call step_start,patch) @$(call MESSAGE,"Patching")