From patchwork Tue Dec 17 14:48:49 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ryan Barnett X-Patchwork-Id: 302217 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (silver.osuosl.org [140.211.166.136]) by ozlabs.org (Postfix) with ESMTP id 188F02C0084 for ; Wed, 18 Dec 2013 01:49:18 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 3770132FD0; Tue, 17 Dec 2013 14:49:17 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FhNbV5ie5xZQ; Tue, 17 Dec 2013 14:49:11 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 7861D32F9C; Tue, 17 Dec 2013 14:49:08 +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 B70FE1C2A18 for ; Tue, 17 Dec 2013 14:49:05 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id B2C938BDE6 for ; Tue, 17 Dec 2013 14:49:05 +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 XaZ2MFIK3LyH for ; Tue, 17 Dec 2013 14:49:02 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from secvs02.rockwellcollins.com (secvs02.rockwellcollins.com [205.175.225.241]) by whitealder.osuosl.org (Postfix) with ESMTPS id 582AF8BE06 for ; Tue, 17 Dec 2013 14:49:02 +0000 (UTC) Received: from nosuchhost.198.131.in-addr.arpa (HELO collinscrsmtp02.rockwellcollins.com) ([131.198.63.133]) by mail-virt.rockwellcollins.com with ESMTP; 17 Dec 2013 08:49:01 -0600 Received: from nunkun.rockwellcollins.com ([131.198.63.11]) by collinscrsmtp02.rockwellcollins.com (Lotus Domino Release 8.5.2FP2 HF162) with ESMTP id 2013121708490074-1569263 ; Tue, 17 Dec 2013 08:49:00 -0600 From: Ryan Barnett To: buildroot@busybox.net Date: Tue, 17 Dec 2013 08:48:49 -0600 Message-Id: <1387291730-6513-1-git-send-email-rjbarnet@rockwellcollins.com> X-Mailer: git-send-email 1.7.9.5 X-MIMETrack: Itemize by SMTP Server on CollinsCRSMTP02/CedarRapids/RockwellCollins(Release 8.5.2FP2 HF162|May 16, 2011) at 12/17/2013 08:49:00 AM, Serialize by Router on CollinsCRSMTP02/CedarRapids/RockwellCollins(Release 8.5.2FP2 HF162|May 16, 2011) at 12/17/2013 08:49:00 AM, Serialize complete at 12/17/2013 08:49:00 AM X-TNEFEvaluated: 1 Subject: [Buildroot] [PATCH v5 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")