Patchwork [2/6] manual: add package-list.txt generation support

login
register
mail settings
Submitter Samuel Martin
Date Nov. 28, 2012, 9:40 p.m.
Message ID <1354138832-18149-2-git-send-email-s.martin49@gmail.com>
Download mbox | patch
Permalink /patch/202553/
State Superseded
Headers show

Comments

Samuel Martin - Nov. 28, 2012, 9:40 p.m.
Signed-off-by: Samuel Martin <s.martin49@gmail.com>
---
 docs/manual/manual.mk | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
Arnout Vandecappelle - Nov. 29, 2012, 12:11 a.m.
On 28/11/12 22:40, Samuel Martin wrote:
>
> Signed-off-by: Samuel Martin<s.martin49@gmail.com>
> ---
>   docs/manual/manual.mk | 20 ++++++++++++++++++++
>   1 file changed, 20 insertions(+)
>
> diff --git a/docs/manual/manual.mk b/docs/manual/manual.mk
> index aa20534..c4a21b2 100644
> --- a/docs/manual/manual.mk
> +++ b/docs/manual/manual.mk
> @@ -24,6 +24,26 @@ $$(O)/docs/$(1)/$(1).$(4): docs/$(1)/$(1).txt $$($(call UPPERCASE,$(1))_SOURCES)
>   	  -D $$(@D) $$<
>   endef
>
> +$(TOPDIR)/docs/manual/package-list.txt:
> +	@echo -en "\
> +	//\n\
> +	// Autogenerated file\n\
> +	//\n\n\
> +	[[package-list]]\n\
> +	Available packages\n\
> +	------------------\n\n\
> +	// docs/manaual/pkg-list.txt is generated using the following command:\n\
> +	// $ git grep -E '\\((autotools|cmake|generic)-package\\)' package/ | \\\n\
> +	//     cut -d':' -f1 | grep '\\.mk$$' | \\\n\
> +	//     sed -e 's;.*\\?/\\(.*\\?\\).mk;* \\1;' | \\\n\
> +	//     sort>  docs/manual/pkg-list.txt\n\n\

  Since there is now support to do this, I don't think it makes sense to add this
to the .txt file.  Especially with the typo in manaual :-)

> +	">  $@
> +	grep -rHE --color=never '\((autotools|cmake|generic)-package\)' \
> +		$(TOPDIR)/package/ | \
> +		cut -d':' -f1 | grep '\.mk$$' | \

  Why not just 'grep -lrE' instead of this cut ?

> +		sed -e 's;.*\?/\(.*\?\).mk;* \1;' | \

  You can do the grep and sed together with

  sed -n -e '/.*\/\(.*\).mk$$/s//* \1/p'

(not sure why the \? was necessary)

> +		sort>>  $@

  Personally, I wouldn't have put this in the makefile but just in
support/scripts/gen-manual-pkg-list.sh.

  Regardless of these comments, this gets my

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

  Regards,
  Arnout

> +
>   ################################################################################
>   # GENDOC -- generates the make targets needed to build asciidoc documentation.
>   #

Patch

diff --git a/docs/manual/manual.mk b/docs/manual/manual.mk
index aa20534..c4a21b2 100644
--- a/docs/manual/manual.mk
+++ b/docs/manual/manual.mk
@@ -24,6 +24,26 @@  $$(O)/docs/$(1)/$(1).$(4): docs/$(1)/$(1).txt $$($(call UPPERCASE,$(1))_SOURCES)
 	  -D $$(@D) $$<
 endef
 
+$(TOPDIR)/docs/manual/package-list.txt:
+	@echo -en "\
+	//\n\
+	// Autogenerated file\n\
+	//\n\n\
+	[[package-list]]\n\
+	Available packages\n\
+	------------------\n\n\
+	// docs/manaual/pkg-list.txt is generated using the following command:\n\
+	// $ git grep -E '\\((autotools|cmake|generic)-package\\)' package/ | \\\n\
+	//     cut -d':' -f1 | grep '\\.mk$$' | \\\n\
+	//     sed -e 's;.*\\?/\\(.*\\?\\).mk;* \\1;' | \\\n\
+	//     sort > docs/manual/pkg-list.txt\n\n\
+	" > $@
+	grep -rHE --color=never '\((autotools|cmake|generic)-package\)' \
+		$(TOPDIR)/package/ | \
+		cut -d':' -f1 | grep '\.mk$$' | \
+		sed -e 's;.*\?/\(.*\?\).mk;* \1;' | \
+		sort >> $@
+
 ################################################################################
 # GENDOC -- generates the make targets needed to build asciidoc documentation.
 #