Package: yelp-tools / 3.18.0-3

local-mallard-rng.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Description: use locally provided mallard-1.0.rng file
 Do not download http://projectmallard.org/1.0/mallard-1.0.rng on every
 invocation but ship a copy in the package and use that instead. This is a
 workaround until we can depend on a mallard-rng Debian package, that should
 be used automatically when properly registered with the XML catalog system.
Author: Florian Schlichting <fsfs@debian.org>
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=788769
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=765215

--- a/tools/yelp-check.in
+++ b/tools/yelp-check.in
@@ -931,46 +931,9 @@
 }
 
 yelp_validate_page () {
-    # Using temp files because pipes create subshells, making it really
-    # hard to return the right exit status in a portable way.
-    if [ "x$check_rng_dir" = "x" ]; then
-        check_rng_dir=`mktemp -d "${TMPDIR:-/tmp}"/yelp-XXXXXXXX`
-    fi
     check_out_file=`mktemp "${TMPDIR:-/tmp}"/yelp-XXXXXXXX`
-    check_rng_file=`(
-            echo '<xsl:stylesheet'
-            echo ' xmlns:cache="http://projectmallard.org/cache/1.0/"'
-            echo ' xmlns:xsl="http://www.w3.org/1999/XSL/Transform"'
-            echo ' version="1.0">'
-            echo '<xsl:output method="text"/>'
-            echo '<xsl:template match="/*">'
-            echo '<xsl:choose>'
-            echo '<xsl:when test="string(@version) != '"''"'">'
-            echo '<xsl:value-of select="@version"/>'
-            echo '</xsl:when>'
-            echo '<xsl:when test="/cache:cache">'
-            echo '<xsl:text>cache/1.0 1.0</xsl:text>'
-            echo '</xsl:when>'
-            echo '<xsl:otherwise>'
-            echo '<xsl:text>1.0</xsl:text>'
-            echo '</xsl:otherwise>'
-            echo '</xsl:choose>'
-            echo '</xsl:template>'
-            echo '</xsl:stylesheet>'
-            ) | xsltproc - "$1"`
-    check_rng_file=`urlencode "$check_rng_file" /`.rng
-    if [ ! -f "$check_rng_dir/$check_rng_file" ]; then
-        # If we've already made an RNG file for this version string, don't
-        # do it again. We've urlencoded the file name + slashes, because
-        # version strings often contain slashes. But xsltproc treats the
-        # -o option as a URL and urldecodes, so doubly urlencode, because
-        # we want the urlencoded string to be the on-disk name.
-        xsltproc -o "$check_rng_dir/"`urlencode "$check_rng_file"` \
-            --param rng.strict "$check_strict" \
-            --stringparam rng.strict.allow "$check_strict_allow" \
-            "$xsl_mal_rng" "$1"
-    fi
-    xmllint --noout --xinclude --noent --relaxng "$check_rng_dir/$check_rng_file" "$1" > "$check_out_file" 2>&1
+    check_rng_file="/usr/share/yelp-tools/mallard/mallard-1.0.rng"
+    xmllint --noout --xinclude --noent --relaxng "$check_rng_file" "$1" > "$check_out_file" 2>&1
     ret="$?"
     cat "$check_out_file" | grep -v 'validates$'
     rm "$check_out_file"