All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH libnetfilter_queue v3 1/6] build: doc: Fix man pages
@ 2021-08-28  3:35 Duncan Roe
  2021-08-28  3:35 ` [PATCH libnetfilter_queue v3 2/6] build: doc: Add a man page post-processor to build_man.sh Duncan Roe
                   ` (6 more replies)
  0 siblings, 7 replies; 14+ messages in thread
From: Duncan Roe @ 2021-08-28  3:35 UTC (permalink / raw)
  To: pablo; +Cc: netfilter-devel

Split off shell script from within doxygen/Makefile.am into
doxygen/build_man.sh.

This patch by itself doesn't fix anything.
The patch is only for traceability, because diff patch format is not very good
at catching code updates and moving code together.
Therefore the script is exactly as it was; it still looks a bit different
because of having to un-double doubled-up $ signs, remove trailing ";/" and so
on.

Signed-off-by: Duncan Roe <duncan_roe@optusnet.com.au>
---
 doxygen/Makefile.am  | 34 +++-------------------------------
 doxygen/build_man.sh | 29 +++++++++++++++++++++++++++++
 2 files changed, 32 insertions(+), 31 deletions(-)
 create mode 100755 doxygen/build_man.sh

diff --git a/doxygen/Makefile.am b/doxygen/Makefile.am
index 29078de..5068544 100644
--- a/doxygen/Makefile.am
+++ b/doxygen/Makefile.am
@@ -16,37 +16,7 @@ doxyfile.stamp: $(doc_srcs) Makefile.am
 	[ ! -d ../src.distcheck ] || \
 { set -x; cd ..; rm src; mv src.distcheck src; }
 
-# We need to use bash for its associative array facility
-# (`bash -p` prevents import of functions from the environment).
-# The command has to be a single line so the functions work
-# and so `make` gives all lines to `bash -c`
-# (hence ";\" at the end of every line but the last).
-	/bin/bash -p -c 'declare -A renamed_page;\
-main(){ set -e; cd man/man3; rm -f _*;\
-  count_real_pages;\
-  rename_real_pages;\
-  make_symlinks;\
-};\
-count_real_pages(){ page_count=0;\
-  for i in $$(ls -S);\
-  do head -n1 $$i | grep -E -q '^\.so' && break;\
-    page_count=$$(($$page_count + 1));\
-  done;\
-  first_link=$$(($$page_count + 1));\
-};\
-rename_real_pages(){ for i in $$(ls -S | head -n$$page_count);\
-  do for j in $$(ls -S | tail -n+$$first_link);\
-    do grep -E -q $$i$$ $$j && break;\
-    done;\
-    mv -f $$i $$j;\
-    renamed_page[$$i]=$$j;\
-  done;\
-};\
-make_symlinks(){ for j in $$(ls -S | tail -n+$$first_link);\
-  do ln -sf $${renamed_page[$$(cat $$j | cut -f2 -d/)]} $$j;\
-  done;\
-};\
-main'
+	$(abs_top_srcdir)/doxygen/build_man.sh
 
 	touch doxyfile.stamp
 
@@ -64,3 +34,5 @@ install-data-local:
 uninstall-local:
 	rm -r $(DESTDIR)$(mandir) man html doxyfile.stamp
 endif
+
+EXTRA_DIST = build_man.sh
diff --git a/doxygen/build_man.sh b/doxygen/build_man.sh
new file mode 100755
index 0000000..304a305
--- /dev/null
+++ b/doxygen/build_man.sh
@@ -0,0 +1,29 @@
+#!/bin/bash -p
+# We need to use bash for its associative array facility
+# (`bash -p` prevents import of functions from the environment).
+declare -A renamed_page
+main(){ set -e; cd man/man3; rm -f _*
+  count_real_pages
+  rename_real_pages
+  make_symlinks
+}
+count_real_pages(){ page_count=0
+  for i in $(ls -S)
+  do head -n1 $i | grep -E -q '^\.so' && break
+    page_count=$(($page_count + 1))
+  done
+  first_link=$(($page_count + 1))
+}
+rename_real_pages(){ for i in $(ls -S | head -n$page_count)
+  do for j in $(ls -S | tail -n+$first_link)
+    do grep -E -q $i$ $j && break
+    done
+    mv -f $i $j
+    renamed_page[$i]=$j
+  done
+}
+make_symlinks(){ for j in $(ls -S | tail -n+$first_link)
+  do ln -sf ${renamed_page[$(cat $j | cut -f2 -d/)]} $j
+  done
+}
+main
-- 
2.17.5


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

end of thread, other threads:[~2021-08-30  1:08 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-28  3:35 [PATCH libnetfilter_queue v3 1/6] build: doc: Fix man pages Duncan Roe
2021-08-28  3:35 ` [PATCH libnetfilter_queue v3 2/6] build: doc: Add a man page post-processor to build_man.sh Duncan Roe
2021-08-28  9:10   ` Pablo Neira Ayuso
2021-08-28  3:35 ` [PATCH libnetfilter_queue v3 3/6] build: doc: Avoid having to special-case `make distcheck` Duncan Roe
2021-08-28  9:10   ` Pablo Neira Ayuso
2021-08-28  3:35 ` [PATCH libnetfilter_queue v3 4/6] build: doc: fix `make distcleancheck` Duncan Roe
2021-08-28  9:11   ` Pablo Neira Ayuso
2021-08-28  3:35 ` [PATCH libnetfilter_queue v3 5/6] build: doc: Allow to specify whether to produce man pages, html, neither or both Duncan Roe
2021-08-30  1:08   ` Duncan Roe
2021-08-28  3:35 ` [PATCH libnetfilter_queue v3 6/6] build: doc: Eliminate warning from ./autogen.sh Duncan Roe
2021-08-29  3:45   ` [PATCH libnetfilter_queue v2] " Duncan Roe
2021-08-30  0:18     ` Pablo Neira Ayuso
2021-08-28  3:49 ` Verion info Duncan Roe
2021-08-28  9:09 ` [PATCH libnetfilter_queue v3 1/6] build: doc: Fix man pages Pablo Neira Ayuso

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.