All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] buildroot: Add POST_RSYNC_HOOKS support
@ 2013-07-27 16:56 Tzu-Jung Lee
  2013-07-28  8:19 ` Thomas De Schampheleire
  0 siblings, 1 reply; 4+ messages in thread
From: Tzu-Jung Lee @ 2013-07-27 16:56 UTC (permalink / raw)
  To: buildroot

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 <tjlee@ambarella.com>
---
 package/pkg-generic.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
index d9a12f2..06e865d 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
-- 
1.8.3.2

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH] buildroot: Add POST_RSYNC_HOOKS support
  2013-07-27 16:56 [Buildroot] [PATCH] buildroot: Add POST_RSYNC_HOOKS support Tzu-Jung Lee
@ 2013-07-28  8:19 ` Thomas De Schampheleire
  2013-07-28  8:54   ` [Buildroot] [PATCH v2] " Tzu-Jung Lee
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas De Schampheleire @ 2013-07-28  8:19 UTC (permalink / raw)
  To: buildroot

Hi Tzu-Jung Lee,

On Sat, Jul 27, 2013 at 6:56 PM, Tzu-Jung Lee <roylee17@gmail.com> wrote:
> 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 <tjlee@ambarella.com>
> ---
>  package/pkg-generic.mk | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
> index d9a12f2..06e865d 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

I think you should update the documentation to mention this hook.

Also, further in pkg-generic.mk is a list of all hooks defaulting to
empty. You should add the new POST_RSYNC_HOOK there as well.

Best regards,
Thomas

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH v2] buildroot: Add POST_RSYNC_HOOKS support
  2013-07-28  8:19 ` Thomas De Schampheleire
@ 2013-07-28  8:54   ` Tzu-Jung Lee
  2013-08-12 15:58     ` Arnout Vandecappelle
  0 siblings, 1 reply; 4+ messages in thread
From: Tzu-Jung Lee @ 2013-07-28  8:54 UTC (permalink / raw)
  To: buildroot

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 <tjlee@ambarella.com>
---
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        ?=
-- 
1.8.3.2

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH v2] buildroot: Add POST_RSYNC_HOOKS support
  2013-07-28  8:54   ` [Buildroot] [PATCH v2] " Tzu-Jung Lee
@ 2013-08-12 15:58     ` Arnout Vandecappelle
  0 siblings, 0 replies; 4+ messages in thread
From: Arnout Vandecappelle @ 2013-08-12 15:58 UTC (permalink / raw)
  To: buildroot

On 28/07/13 10:54, Tzu-Jung Lee wrote:
> 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 <tjlee@ambarella.com>

Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>

 Although IMHO it's a bit of a hack to use it for that specific use 
case. That use case would be better served with

rsync -au --cvs-exclude --include core $($(PKG)_RSYNC_OPTS) $(SRCDIR)/ $(@D)

(note that it is possible to set FOO_RSYNC_OPTS in the override file).

 Regards,
 Arnout

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


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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-08-12 15:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-27 16:56 [Buildroot] [PATCH] buildroot: Add POST_RSYNC_HOOKS support Tzu-Jung Lee
2013-07-28  8:19 ` Thomas De Schampheleire
2013-07-28  8:54   ` [Buildroot] [PATCH v2] " Tzu-Jung Lee
2013-08-12 15:58     ` Arnout Vandecappelle

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.