[Buildroot] [PATCH v2] asciidoc: use absolute path for resources

Matthew Weber matthew.weber at rockwellcollins.com
Wed Jul 27 15:19:12 UTC 2016


All, pardon the top post.  I messed up my rebase and will resubmit this as
v3
On Jul 27, 2016 9:50 AM, "Matt Weber" <matthew.weber at rockwellcollins.com>
wrote:

> From: Atul Singh <atul.singh.mandla at rockwellcollins.com>
>
> One of the "features" of a2x is that the '-r|--resource' flag imports
> resources relative to the [SOURCE_FILE], not the CWD. The current
> implementation tries to import resources from the destination dir $(@D),
> which works fine for out-of-tree builds because $(@D) is an absolute
> path, however in-tree builds treat $(@D) as a relative path, which breaks
> because a2x treats $(@D) relative to SOURCE_FILE.
>
> Use the make command $(abspath names...) to convert the dest dir to an
> absolute path before passing it as a resource.
>
> Reviewed-by: "Yann E. MORIN" <yann.morin.1998 at free.fr>
>
> Signed-off-by: Brandon Maier <brandon.maier at rockwellcollins.com>
> Signed-off-by: Atul Singh Mandla <atul.singh.mandla at rockwellcollins.com>
> Signed-off-by: Matt Weber <matthew.weber at rockwellcollins.com>
>
> ---
> v1 -> v2
> [Yann
>  - Removed extra spaces before the $$(foreach and --resource
>  - Updated commit message to be $(@D) vs $(D)
> ---
>  package/doc-asciidoc.mk | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/package/doc-asciidoc.mk b/package/doc-asciidoc.mk
> index 6ab5ad2..c5ff2ae 100644
> --- a/package/doc-asciidoc.mk
> +++ b/package/doc-asciidoc.mk
> @@ -117,7 +117,8 @@ $$(O)/docs/$(1)/$(1).$(6): $$($(2)_SOURCES) \
>         $$(Q)$$(call MESSAGE,"Generating $(7) $(1)...")
>         $$(Q)mkdir -p $$(@D)
>         $$(Q)a2x $(8) -f $(4) -d book -L \
> -               $$(foreach r,$$($(2)_RESOURCES),-r $$(r)) -r $$(@D) \
> +                $$(foreach r,$$($(2)_RESOURCES) $$(@D), \
> +                        --resource="$$(abspath $$(r))") \
>                 $$($(2)_$(4)_A2X_OPTS) \
>                 --asciidoc-opts="$$($(2)_$(4)_ASCIIDOC_OPTS)" \
>                 $$(BUILD_DIR)/docs/$(1)/$(1).txt
> --
> 1.9.1
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.buildroot.org/pipermail/buildroot/attachments/20160727/ab849c09/attachment-0001.html>


More information about the buildroot mailing list