From patchwork Sun Jul 28 08:54:52 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzu-Jung Lee X-Patchwork-Id: 262566 X-Patchwork-Delegate: patrickdepinguin+buildroot@gmail.com 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 50D052C0124 for ; Sun, 28 Jul 2013 18:51:25 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 6DB003086D; Sun, 28 Jul 2013 08:51:22 +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 tVHuJIT8FPvU; Sun, 28 Jul 2013 08:51:20 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id A166A27026; Sun, 28 Jul 2013 08:51:20 +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 3D2D91C22A3 for ; Sun, 28 Jul 2013 08:51:34 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 30B4A8C4D3 for ; Sun, 28 Jul 2013 08:51:21 +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 PA33voS92eiQ for ; Sun, 28 Jul 2013 08:51:20 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pa0-f49.google.com (mail-pa0-f49.google.com [209.85.220.49]) by whitealder.osuosl.org (Postfix) with ESMTPS id 835838BB2D for ; Sun, 28 Jul 2013 08:51:20 +0000 (UTC) Received: by mail-pa0-f49.google.com with SMTP id bi5so4752873pad.36 for ; Sun, 28 Jul 2013 01:51:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=MjppBOQoEF2HxtHHuebxgtrb9c21udQpGomugmU8OmY=; b=O1zuRpBNO2IIW70m8pysCljyz4e1T2fhsr9TbhyLtsGacU9eTpZKCgvBuzB4Ex5784 oCaGEExq4bNSdAdojhCQzD2HLjmCqEBNjQg1SPEcFapkWdTYesgwNztVpcbIiHPy2J1F dnIpqXOw5121g82ddAw6Fq1NS4VSkyHm4cMyeEjsWA4DzhF3wAiz54ExnzTkpr6kDGpR ewXCRLpDihkXk7Qq0aT628jvc/V4tw3wBFoI4NvDNbX5x2/1FW5Wct2pB8Eza13kXQRL i1GGlsSkb+by+iM8OuFxXPBcUo5yotErQ406xiY5IUkadp83kxgn64MEeb5smRAyP2aw gMWQ== X-Received: by 10.66.146.199 with SMTP id te7mr2343843pab.106.1375001480220; Sun, 28 Jul 2013 01:51:20 -0700 (PDT) Received: from localhost.localdomain (59-104-36-192.adsl.dynamic.seed.net.tw. [59.104.36.192]) by mx.google.com with ESMTPSA id w8sm13928145pab.12.2013.07.28.01.51.17 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 28 Jul 2013 01:51:19 -0700 (PDT) From: Tzu-Jung Lee To: buildroot@busybox.net Date: Sun, 28 Jul 2013 16:54:52 +0800 Message-Id: <1375001692-12024-1-git-send-email-tjlee@ambarella.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: References: Cc: Tzu-Jung Lee Subject: [Buildroot] [PATCH v2] buildroot: Add POST_RSYNC_HOOKS support 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 One of the use cases is for the 'local packages' to restore the SCM info. Some packages use this information to generate version info during build time. In this case, the local package can have this hook to restore it by symbolic link for example. Signed-off-by: Tzu-Jung Lee Acked-by: Arnout Vandecappelle (Essensium/Mind) --- Include the comments aginst v1 from Thomas De Schampheleire: Updte manual for the new hook. Set the default hook to empty docs/manual/adding-packages-generic.txt | 1 + package/pkg-generic.mk | 2 ++ 2 files changed, 3 insertions(+) diff --git a/docs/manual/adding-packages-generic.txt b/docs/manual/adding-packages-generic.txt index faf70b1..2889add 100644 --- a/docs/manual/adding-packages-generic.txt +++ b/docs/manual/adding-packages-generic.txt @@ -441,6 +441,7 @@ The following hook points are available: * +LIBFOO_POST_DOWNLOAD_HOOKS+ * +LIBFOO_POST_EXTRACT_HOOKS+ +* +LIBFOO_POST_RSYNC_HOOKS+ * +LIBFOO_PRE_PATCH_HOOKS+ * +LIBFOO_POST_PATCH_HOOKS+ * +LIBFOO_PRE_CONFIGURE_HOOKS+ diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk index d9a12f2..3d3adc9 100644 --- a/package/pkg-generic.mk +++ b/package/pkg-generic.mk @@ -63,6 +63,7 @@ $(BUILD_DIR)/%/.stamp_rsynced: @$(call MESSAGE,"Syncing from source dir $(SRCDIR)") @test -d $(SRCDIR) || (echo "ERROR: $(SRCDIR) does not exist" ; exit 1) rsync -au --cvs-exclude --include core $(SRCDIR)/ $(@D) + $(foreach hook,$($(PKG)_POST_RSYNC_HOOKS),$(call $(hook))$(sep)) $(Q)touch $@ # Handle the SOURCE_CHECK and SHOW_EXTERNAL_DEPS cases for rsynced @@ -337,6 +338,7 @@ $(2)_EXTRACT_CMDS ?= \ # post-steps hooks $(2)_POST_DOWNLOAD_HOOKS ?= $(2)_POST_EXTRACT_HOOKS ?= +$(2)_POST_RSYNC_HOOKS ?= $(2)_PRE_PATCH_HOOKS ?= $(2)_POST_PATCH_HOOKS ?= $(2)_PRE_CONFIGURE_HOOKS ?=