rst2html.py

Nicolas Sebrecht nicolas.s-dev at laposte.net
Thu Jan 27 19:11:32 GMT 2011


On Thu, Jan 27, 2011 at 10:08:55AM +0100, Sebastian Spaeth wrote:

> I just tried "make doc" and it complained that I don't have rst2html.py
> installed. I do have docutils installed which provides me with an
> "rst2html" command.
>
> Would it be possible to use and test for the existence of "rst2html"
> first? If that doesn't exist, we should perhaps output a nicer message
> to the user, instructing her why "make docs" failed.

Should be working now. I don't agree about the "nicer message" part. Full errors
would be much usefull if something fails.

-- >8 --
Subject: Makefile: fix docutils commands call if extension is stripped

Looks like some distribution strip the extensions of the python commands and
some don't. Try to find the correct commands by ourself.

Reported-by: Sebastian Spaeth <Sebastian at SSpaeth.de>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev at laposte.net>
---
 Changelog.draft.rst |    2 ++
 Makefile            |    7 ++++---
 docs/Makefile       |    6 ++++--
 3 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/Changelog.draft.rst b/Changelog.draft.rst
index 8b599f9..eeb6c1f 100644
--- a/Changelog.draft.rst
+++ b/Changelog.draft.rst
@@ -19,6 +19,8 @@ Changes
 Bug Fixes
 ---------
 
+* Makefile: docutils: work whether python extension is stripped or not
+
 
 Pending for the next major release
 ==================================
diff --git a/Makefile b/Makefile
index 125e396..17c277b 100644
--- a/Makefile
+++ b/Makefile
@@ -18,6 +18,7 @@
 VERSION=4.0.16
 TARGZ=offlineimap_$(VERSION).tar.gz
 SHELL=/bin/bash
+RST2HTML=`type rst2html 2>/dev/null && echo rst2html || echo rst2html.py`
 
 all: build
 
@@ -44,9 +45,9 @@ man:
 
 doc:
 	@$(MAKE) -C docs
-	rst2html.py README.rst readme.html
-	rst2html.py SubmittingPatches.rst SubmittingPatches.html
-	rst2html.py Changelog.rst Changelog.html
+	$(RST2HTML) README.rst readme.html
+	$(RST2HTML) SubmittingPatches.rst SubmittingPatches.html
+	$(RST2HTML) Changelog.rst Changelog.html
 
 targz: ../$(TARGZ)
 ../$(TARGZ):
diff --git a/docs/Makefile b/docs/Makefile
index 3ee4bbd..fd1153e 100644
--- a/docs/Makefile
+++ b/docs/Makefile
@@ -5,18 +5,20 @@ SOURCES = $(wildcard *.rst)
 HTML_TARGETS = $(patsubst %.rst,%.html,$(SOURCES))
 
 RM = rm
+RST2HTML=`type rst2html 2>/dev/null && echo rst2html || echo rst2html.py`
+RST2MAN=`type rst2man 2>/dev/null && echo rst2man || echo rst2man.py`
 
 all: html
 
 html: $(HTML_TARGETS)
 
 $(HTML_TARGETS): %.html : %.rst
-	rst2html.py $? $@
+	$(RST2HTML) $? $@
 
 man: offlineimap.1
 
 offlineimap.1: MANUAL.rst
-	rst2man.py MANUAL.rst offlineimap.1
+	$(RST2MAN) MANUAL.rst offlineimap.1
 	cp -f offlineimap.1 ..
 
 clean:
-- 
1.7.4.rc1.220.g438e4





More information about the OfflineIMAP-project mailing list