diff mbox

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

Message ID 1354138832-18149-2-git-send-email-s.martin49@gmail.com
State Superseded
Headers show

Commit Message

Samuel Martin Nov. 28, 2012, 9:40 p.m. UTC
Signed-off-by: Samuel Martin <s.martin49@gmail.com>
---
 docs/manual/manual.mk | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

Comments

Arnout Vandecappelle Nov. 29, 2012, 12:11 a.m. UTC | #1
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.
>   #
diff mbox

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