[build-path-prefix-map-spec] 42/50: Use rst2html5 instead of pandoc

Ximin Luo infinity0 at debian.org
Fri Mar 10 15:17:22 UTC 2017


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch master
in repository build-path-prefix-map-spec.

commit 39c78ca8dfa7c420bab9bf64a2a50e182594721b
Author: Ximin Luo <infinity0 at debian.org>
Date:   Fri Feb 24 18:44:06 2017 +0100

    Use rst2html5 instead of pandoc
    
    Unfortunately pandoc moves all the notes to the bottom of the document
---
 Makefile                  |  6 +++---
 consume/Makefile          | 18 +++++++++---------
 consume/testcases-rst.css |  6 +-----
 consume/testcases-rst.sh  |  8 ++++----
 spec-main.rst             | 28 ++++++++++++++++++----------
 5 files changed, 35 insertions(+), 31 deletions(-)

diff --git a/Makefile b/Makefile
index a1dce40..b0e69b9 100644
--- a/Makefile
+++ b/Makefile
@@ -1,17 +1,17 @@
 all: spec.html
 
 %.html: %.rst %.css
-	pandoc -s --css "$*.css" "$<" > "$@"
+	rst2html5 --stylesheet minimal.css,"$*.css" "$<" > "$@"
 
 spec.rst: spec-main.rst spec-testcases.rst
 	cat $^ > "$@"
 
-T = testcases-rst-pecsplit.rst
+T = testcases-pecsplit.rst
 .PHONY: consume/$(T)
 consume/$(T):
 	$(MAKE) -C consume $(T)
 
-spec-testcases.rst: consume/testcases-rst-pecsplit.rst
+spec-testcases.rst: consume/testcases-pecsplit.rst
 	cp "$<" "$@"
 
 spec.css: consume/testcases-rst.css
diff --git a/consume/Makefile b/consume/Makefile
index 54523cf..00e0926 100644
--- a/consume/Makefile
+++ b/consume/Makefile
@@ -37,25 +37,25 @@ all: $(ALL_SOURCE:%=%.out)
 
 .PHONY: check testcases-rst
 check: $(ALL_FORMATS:%=check-%)
-testcases-rst: $(ALL_FORMATS:%=testcases-rst-%.html)
+testcases-html: $(ALL_FORMATS:%=testcases-%.html)
 
 export TESTDIR = $(T)
-check-%:
+check-%: check.sh
 	$(MAKE) $(ALLCHECK_$*)
 	set -e; for case in $(TESTCASES_0); do ./check.sh "$(ALLCHECK_$*)" $* 0 $$case $$case.$* $$case; done
 	set -e; for case in $(TESTCASES_1); do ./check.sh "$(ALLCHECK_$*)" $* 1 $$case $$case.$* $$case; done
 	set -e; for case in $(TESTCASES_$*.0); do ./check.sh "$(ALLCHECK_$*)" $* 0 $$case $$case $*.0; done
 	set -e; for case in $(TESTCASES_$*.1); do ./check.sh "$(ALLCHECK_$*)" $* 1 $$case $$case $*.1; done
 
-testcases-rst-%.html: testcases-rst-%.rst
-	pandoc -s --css testcases-rst.css "$<" > "$@"
+testcases-%.html: testcases-%.rst testcases-rst.css
+	rst2html5 --stylesheet minimal.css,testcases-rst.css "$<" > "$@"
 
-testcases-rst-%.rst: $(wildcard $(T)/*) Makefile
+testcases-%.rst: testcases-rst.sh $(wildcard $(T)/*) Makefile
 	rm -f "$@" "$@.tmp" && touch "$@.tmp"
-	set -e; for case in $(TESTCASES_0); do ./testcases-rst.sh $* $$case $$case.$* $$case valid; done >> "$@.tmp"
-	set -e; for case in $(TESTCASES_1); do ./testcases-rst.sh $* $$case $$case.$* $$case invalid; done >> "$@.tmp"
-	set -e; for case in $(TESTCASES_$*.0); do ./testcases-rst.sh $* $$case $$case $*.0 valid; done >> "$@.tmp"
-	set -e; for case in $(TESTCASES_$*.1); do ./testcases-rst.sh $* $$case $$case $*.1 invalid; done >> "$@.tmp"
+	set -e; for case in $(TESTCASES_0); do ./testcases-rst.sh $* $$case $$case.$* $$case "decode valid"; done >> "$@.tmp"
+	set -e; for case in $(TESTCASES_1); do ./testcases-rst.sh $* $$case $$case.$* $$case "decode invalid"; done >> "$@.tmp"
+	set -e; for case in $(TESTCASES_$*.0); do ./testcases-rst.sh $* $$case $$case $*.0 "decode valid"; done >> "$@.tmp"
+	set -e; for case in $(TESTCASES_$*.1); do ./testcases-rst.sh $* $$case $$case $*.1 "decode invalid"; done >> "$@.tmp"
 	mv "$@.tmp" "$@"
 
 make-afl-test-case = \
diff --git a/consume/testcases-rst.css b/consume/testcases-rst.css
index acffe57..920fec8 100644
--- a/consume/testcases-rst.css
+++ b/consume/testcases-rst.css
@@ -1,8 +1,4 @@
-p code {
+.literal > span.pre {
     white-space: normal;
     word-break: break-all;
 }
-
-pre, blockquote {
-    margin-left: 40px;
-}
diff --git a/consume/testcases-rst.sh b/consume/testcases-rst.sh
index 3a7f70f..75b026c 100755
--- a/consume/testcases-rst.sh
+++ b/consume/testcases-rst.sh
@@ -22,9 +22,9 @@ dump_or_ref() {
 	if [ -h "$2" ]; then
 		local dst="$(readlink "$2")"
 		if [ "${dst%.out}" != "$dst" ]; then
-			print_section "${1}:" echo "(same as the output for Case '${dst%.out}')"
+			print_section "${1}:" echo "(same as the output for Case \"${dst%.out}\")"
 		elif [ "${dst%.in}" != "$dst" ]; then
-			print_section "${1}:" echo "(same as the input for Case '${dst%.in}')"
+			print_section "${1}:" echo "(same as the input for Case \"${dst%.in}\")"
 		else
 			echo >&2 "ERROR: unknown symlink"
 			exit 1
@@ -41,11 +41,11 @@ case="$2"
 	envfile="${T}${3}.env"
 
 	if [ -s "$output" ]; then
-		dump_or_ref "Case '$2', **${5}**"': ``'"$(./make_printable.py "$envfile")"'`` maps' "$input"
+		dump_or_ref "Case \"$2\", **${5}**"': ``'"$(./make_printable.py "$envfile")"'`` maps' "$input"
 		dump_or_ref 'to' "$output"
 
 	else
-		echo "Case '$2', **${5}**"': ``'"$(./make_printable.py "$envfile")"'``'
+		echo "Case \"$2\", **${5}**"': ``'"$(./make_printable.py "$envfile")"'``'
 		echo
 
 	fi
diff --git a/spec-main.rst b/spec-main.rst
index fcf1e9a..9150cf4 100644
--- a/spec-main.rst
+++ b/spec-main.rst
@@ -38,7 +38,7 @@ encoding them using a character encoding such as UTF-8 or UTF-16; or (b) if you
 must use a character encoding e.g. because your language's standard libraries
 force you to, then either it is total and injective over the system string type
 [1]_, or you MUST raise a parse error for inputs where it is undefined or not
-injective. See [2]_ for further details and guidance on how to do this.
+injective. (See [2]_ for further details and guidance on how to do this.)
 
 The encoding is as follows:
 
@@ -84,11 +84,11 @@ The encoding is as follows:
   A. decoding:
 
      1. check elem does not match the regex ``/%[^#+.]|%$/g``, then
-     2. ``elem.replace("%.", ':').replace("%+", '=').replace("%#", '%')``
+     2. ``elem.replace("%.", ":").replace("%+", "=").replace("%#", "%")``
 
   B. encoding:
 
-     1. ``elem.replace("%#", '%').replace("%+", '=').replace("%.", ':')``
+     1. ``elem.replace("%#", "%").replace("%+", "=").replace("%.", ":")``
 
   Our recommended approach for a low-level language without string replace:
 
@@ -161,9 +161,10 @@ Notes and links
 
 .. [2] Detailed implementation notes and advice are available on `our wiki page
     <https://wiki.debian.org/ReproducibleBuilds/BuildPathProposal#Implementation_notes>`_.
-    Example source code is also available on the above page, as well as in
-    runnable form in `our git repository
+    Example source code is also available there, as well as in runnable form in
+    `our git repository
     <https://anonscm.debian.org/git/reproducible/standards.git/tree/build-path-prefix-map>`_.
+    The test vectors from this document's appendix are also available there.
 
 .. [3] This is to make it easier for producers to append values, e.g. as in
     ``envvar += ":" + encoded_pair`` which would be valid even if envvar is
@@ -229,10 +230,17 @@ Appendix
 Test vectors
 ------------
 
-In the below, statements of the form "E maps I to O" means that when E is set
-as the value of ``BUILD_PATH_PREFIX_MAP``, then a compliant consumer, when
-implementing either algorithm 1 or 2 in "Applying the decoded structure",
-should map line-separated input paths I to line-separated output paths O.
-
+Here are test vectors for implementations to check their correctness. They are
+intended for guidance and *not* as a substitute to the above specification. In
+particular, it may be possible to match the behaviour described below exactly
+but still violate the specification. The vectors are also available as part of
+an executable test suite in `our git repository
+<https://anonscm.debian.org/git/reproducible/standards.git/tree/build-path-prefix-map>`_.
+
+In the prescriptions below, statements of the form "E maps I to O" mean that
+when E is set as the value of ``BUILD_PATH_PREFIX_MAP``, then a compliant
+consumer, when implementing either algorithm 1 or 2 from *Applying the decoded
+structure*, maps line-separated input paths I to line-separated output paths O.
 Where E is wrapped by ``b'`` and ``'``, it is to be interpreted as a sequence
 of bytes, represented in the same way as Python byte literals.
+

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/build-path-prefix-map-spec.git



More information about the Reproducible-commits mailing list