All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 01/22] tmplcvt: make the tool more robust
@ 2017-03-30 10:45 Mauro Carvalho Chehab
  2017-03-30 10:45 ` [PATCH v2 02/22] driver-api/basics.rst: add device table header Mauro Carvalho Chehab
                   ` (23 more replies)
  0 siblings, 24 replies; 27+ messages in thread
From: Mauro Carvalho Chehab @ 2017-03-30 10:45 UTC (permalink / raw)
  To: Linux Media Mailing List, Linux Doc Mailing List, Greg Kroah-Hartman
  Cc: Mauro Carvalho Chehab, Mauro Carvalho Chehab, John Youn,
	linux-usb, linux-rpi-kernel, Laurent Pinchart, Jonathan Corbet,
	Mauro Carvalho Chehab, Jani Nikula

Currently, the script just assumes to be called at
Documentation/sphinx/. Change it to work on any directory,
and make it abort if something gets wrong.

Also, be sure that both parameters are specified.

That should avoid troubles like this:

$ Documentation/sphinx/tmplcvt Documentation/DocBook/writing_usb_driver.tmpl
sed: couldn't open file convert_template.sed: No such file or directory

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
---
 Documentation/sphinx/tmplcvt | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/Documentation/sphinx/tmplcvt b/Documentation/sphinx/tmplcvt
index 909a73065e0a..31df8eb7feca 100755
--- a/Documentation/sphinx/tmplcvt
+++ b/Documentation/sphinx/tmplcvt
@@ -7,13 +7,22 @@
 # fix \_
 # title line?
 #
+set -eu
+
+if [ "$2" == "" ]; then
+	echo "$0 <docbook file> <rst file>"
+	exit
+fi
+
+DIR=$(dirname $0)
 
 in=$1
 rst=$2
 tmp=$rst.tmp
 
 cp $in $tmp
-sed --in-place -f convert_template.sed $tmp
+sed --in-place -f $DIR/convert_template.sed $tmp
 pandoc -s -S -f docbook -t rst -o $rst $tmp
-sed --in-place -f post_convert.sed $rst
+sed --in-place -f $DIR/post_convert.sed $rst
 rm $tmp
+echo "book writen to $rst"
-- 
2.9.3

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

end of thread, other threads:[~2017-04-05 13:08 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-30 10:45 [PATCH v2 01/22] tmplcvt: make the tool more robust Mauro Carvalho Chehab
2017-03-30 10:45 ` [PATCH v2 02/22] driver-api/basics.rst: add device table header Mauro Carvalho Chehab
2017-03-30 10:45 ` [PATCH v2 03/22] docs-rst: convert usb docbooks to ReST Mauro Carvalho Chehab
2017-03-30 10:45 ` [PATCH v2 04/22] usb.rst: Enrich its ReST representation Mauro Carvalho Chehab
2017-03-30 10:45 ` [PATCH v2 05/22] gadget.rst: Enrich its ReST representation and add kernel-doc tag Mauro Carvalho Chehab
2017-03-30 10:45 ` [PATCH v2 06/22] writing_usb_driver.rst: Enrich its ReST representation Mauro Carvalho Chehab
2017-03-30 10:45 ` [PATCH v2 07/22] writing_musb_glue_layer.rst: " Mauro Carvalho Chehab
2017-03-30 10:45 ` [PATCH v2 08/22] usb/anchors.txt: convert to ReST and add to driver-api book Mauro Carvalho Chehab
2017-03-30 10:45 ` [PATCH v2 09/22] usb/bulk-streams.txt: " Mauro Carvalho Chehab
2017-03-30 10:45 ` [PATCH v2 10/22] usb/callbacks.txt: " Mauro Carvalho Chehab
2017-03-30 10:45 ` [PATCH v2 11/22] usb/power-management.txt: " Mauro Carvalho Chehab
2017-03-30 10:45 ` [PATCH v2 12/22] usb/dma.txt: " Mauro Carvalho Chehab
2017-03-30 10:45 ` [PATCH v2 13/22] error-codes.rst: " Mauro Carvalho Chehab
2017-03-30 10:45 ` [PATCH v2 14/22] usb/hotplug.txt: " Mauro Carvalho Chehab
2017-03-30 10:45 ` [PATCH v2 15/22] usb/persist.txt: " Mauro Carvalho Chehab
2017-03-30 10:45 ` [PATCH v2 16/22] usb/URB.txt: convert to ReST and update it Mauro Carvalho Chehab
2017-03-30 10:45 ` [PATCH v2 17/22] usb.rst: get rid of some Sphinx errors Mauro Carvalho Chehab
2017-03-30 10:45 ` [PATCH v2 18/22] usb: get rid of some ReST doc build errors Mauro Carvalho Chehab
2017-03-30 10:45 ` [PATCH v2 19/22] usb: composite.h: fix two warnings when building docs Mauro Carvalho Chehab
2017-03-30 10:45 ` [PATCH v2 20/22] usb: gadget.h: be consistent at kernel doc macros Mauro Carvalho Chehab
2017-03-30 10:45 ` [PATCH v2 21/22] docs-rst: fix usb cross-references Mauro Carvalho Chehab
2017-03-30 10:45   ` Mauro Carvalho Chehab
2017-03-30 10:45 ` [PATCH v2 22/22] usb: document that URB transfer_buffer should be aligned Mauro Carvalho Chehab
2017-03-30 10:58 ` [PATCH v2 01/22] tmplcvt: make the tool more robust Mauro Carvalho Chehab
2017-03-30 11:45 ` Jani Nikula
2017-04-02 21:32 ` Jonathan Corbet
2017-04-05 13:07   ` Mauro Carvalho Chehab

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.