Commits
Marcus Calhoun-Lopez authored and MarcusCalhoun-Lopez committed e2b0b15b883
1 + | From 6d178b36a7ac2b0e5d67868fdcd3992ac04f2cd4 Mon Sep 17 00:00:00 2001 |
2 + | From: Dan Kelley <kelley.dan@gmail.com> |
3 + | Date: Wed, 21 Jun 2017 17:14:56 -0300 |
4 + | Subject: [PATCH] doc-building update |
5 + | |
6 + | Thanks to Damyan Ivanov for the patch. Below is the info from the |
7 + | associated message to the debian bug tracking system: |
8 + | |
9 + | Bug#865482: src:gri: FTBFS with perl 5.26 -- Unescaped left brace in |
10 + | regex is illegal |
11 + | Package: src:gri |
12 + | Version: 2.12.23-10 |
13 + | Severity: important |
14 + | Tags: patch upstream |
15 + | User: debian-perl@lists.debian.org |
16 + | Usertags: perl-5.26-transition |
17 + | |
18 + | gri fails to build with perl 5.26 currently in experimental. |
19 + | |
20 + | The attached patch makes it build again by escaping curly braces in |
21 + | regular |
22 + | expressions. |
23 + | |
24 + | -- dam |
25 + | |
26 + | -- System Information: |
27 + | Debian Release: 9.0 |
28 + | APT prefers unstable |
29 + | APT policy: (500, 'unstable'), (1, 'experimental') |
30 + | Architecture: amd64 (x86_64) |
31 + | |
32 + | Kernel: Linux 4.9.0-3-amd64 (SMP w/4 CPU cores) |
33 + | Locale: LANG=bg_BG.UTF-8, LC_CTYPE=bg_BG.UTF-8 (charmap=UTF-8), |
34 + | LANGUAGE=bg_BG.UTF-8 (charmap=UTF-8) |
35 + | Shell: /bin/sh linked to /bin/dash |
36 + | Init: systemd (via /run/systemd/system) |
37 + | --- |
38 + | doc/texinfo2HTML | 72 ++++++++++++++++++++++++++++---------------------------- |
39 + | 1 file changed, 36 insertions(+), 36 deletions(-) |
40 + | |
41 + | diff --git a/doc/texinfo2HTML b/doc/texinfo2HTML |
42 + | index 618d6ad..15962b3 100755 |
43 + | --- doc/texinfo2HTML |
44 + | +++ doc/texinfo2HTML |
45 + | |
46 + | next; |
47 + | } |
48 + | # Process image commands (NOT...it's there already) |
49 + | - if (/\@image{(.*)}/) { |
50 + | + if (/\@image\{(.*)\}/) { |
51 + | #print "<img src=\"$1.gif\" border=\"1\">\n"; |
52 + | next; |
53 + | } |
54 + | |
55 + | s,<,<,og; |
56 + | # Special tweak to make 'Gri' look cooler. |
57 + | # s, Gri , G<FONT SIZE=-1>RI</FONT> ,og; |
58 + | - s,\@code{\@\@},\@code{TEXINFO2HTML-AT-AT},og; |
59 + | + s,\@code\{\@\@\},\@code{TEXINFO2HTML-AT-AT},og; |
60 + | s,\@},TEXINFO2HTML-CLOSE-BRACE,og; # retain inside e.g. @code{} |
61 + | s,\@\@,TEXINFO2HTML-AT-AT,og; |
62 + | - s,\@{,{,og; |
63 + | - s,\@TeX{},TeX,og; |
64 + | - s,\@dots{},...,og; |
65 + | + s,\@\{,{,og; |
66 + | + s,\@TeX\{\},TeX,og; |
67 + | + s,\@dots\{\},...,og; |
68 + | # Put in place-holders for some accents. I should check for all |
69 + | # of them, but for now, I'm just kludging in a couple, |
70 + | # to solve an immediate problem and to serve as a place-holder |
71 + | |
72 + | } |
73 + | next; |
74 + | } |
75 + | - while (/\@url{([^}]*)}/) { |
76 + | + while (/\@url\{([^}]*)\}/) { |
77 + | $the_url = $1; |
78 + | - s:\@url{[^}]*}:<a href="$the_url">\@code{$the_url}</a>:; |
79 + | + s:\@url\{[^}]*\}:<a href="$the_url">\@code{$the_url}</a>:; |
80 + | } |
81 + | - while (/\@uref{([^}]*)}/) { |
82 + | + while (/\@uref\{([^}]*)\}/) { |
83 + | @items = split(/,/, $1); |
84 + | if ($#items == 0) { |
85 + | - s:\@uref{[^}]*}:<a href="$items[0]">$items[0]</a>:; |
86 + | + s:\@uref\{[^}]*\}:<a href="$items[0]">$items[0]</a>:; |
87 + | } elsif ($#items == 1) { |
88 + | - s:\@uref{[^}]*}:<a href="$items[0]">$items[1]</a>:; |
89 + | + s:\@uref\{[^}]*\}:<a href="$items[0]">$items[1]</a>:; |
90 + | } elsif ($#items == 2) { |
91 + | - s:\@uref{[^}]*}:\@code{$items[2]}:; |
92 + | + s:\@uref\{[^}]*\}:\@code{$items[2]}:; |
93 + | } else { |
94 + | die "Cannot have more than 3 items in a 'uref' at \"$_\""; |
95 + | } |
96 + | |
97 + | while(get_a_line()) { |
98 + | next if /\@sp/; |
99 + | next if /\@cindex/; |
100 + | - s|\@anchor{([^}]*)}|<a name=\"$1\"></a>|g; |
101 + | + s|\@anchor\{([^}]*)\}|<a name=\"$1\"></a>|g; |
102 + | &process_examples(); |
103 + | # Handle HTML inserts |
104 + | if (/^\@c HTML (.*)/o) { |
105 + | |
106 + | } |
107 + | if (/\s*\@item\s*(.*)/o) { |
108 + | $the_item = $1; |
109 + | - $the_item =~ s:\@{:{:og; |
110 + | - $the_item =~ s:\@}:}:og; |
111 + | + $the_item =~ s:\@\{:{:og; |
112 + | + $the_item =~ s:\@\}:}:og; |
113 + | $the_item =~ s:\@\@:\@:og; |
114 + | - $the_item =~ s:\@code{([^}]*)}:`<font color="$ex_color"><code>$1</code></font>':og; |
115 + | + $the_item =~ s:\@code\{([^}]*)\}:`<font color="$ex_color"><code>$1</code></font>':og; |
116 + | print "<dt> $start_item$the_item$end_item\n<dd>"; |
117 + | } else { |
118 + | print "<p>" if (/^$/o); |
119 + | |
120 + | } else { |
121 + | s,\@value\{([^}]*)\},$value{$1},g; # Substitute set/value pair |
122 + | s,\@},},og; |
123 + | - s,\@{,{,og; |
124 + | + s,\@\{,{,og; |
125 + | } |
126 + | } |
127 + | |
128 + | |
129 + | sub sub_refs { |
130 + | - die "line $. of file: cannot have multiple refs on one line" if (/\@[px]*ref{(.*)}(.*)\@[px]*ref{(.*)}/); |
131 + | + die "line $. of file: cannot have multiple refs on one line" if (/\@[px]*ref\{(.*)\}(.*)\@[px]*ref\{(.*)\}/); |
132 + | # anchors |
133 + | - s|\@anchor{([^}]*)}|<a name=\"$1\"></a>|g; |
134 + | + s|\@anchor\{([^}]*)\}|<a name=\"$1\"></a>|g; |
135 + | # Change e.g. |
136 + | # @xref{Viewing} |
137 + | # into |
138 + | # <a href="#Viewing">see Viewing</a> |
139 + | |
140 + | #if (/\@ref/){print "AAA[$_]AAA\n"; |
141 + | - s|\@ref{([^}]*)}|see <a href="#$1">$1</a>|g; |
142 + | + s|\@ref\{([^}]*)\}|see <a href="#$1">$1</a>|g; |
143 + | #print "BBB[$_]BBB\n";} |
144 + | |
145 + | - s|\@xref{([^}]*)}|see <a href="#$1">$1</a>|g; |
146 + | - s|\@pxref{([^}]*)}|see <a href="#$1">$1.</a>|g; |
147 + | - while (/\@url{([^}]*)}/) { |
148 + | + s|\@xref\{([^}]*)\}|see <a href="#$1">$1</a>|g; |
149 + | + s|\@pxref\{([^}]*)\}|see <a href="#$1">$1.</a>|g; |
150 + | + while (/\@url\{([^}]*)\}/) { |
151 + | $the_url = $1; |
152 + | - s:\@url{[^}]*}:<a href="$the_url">\@code{$the_url}</a>:; |
153 + | + s:\@url\{[^}]*\}:<a href="$the_url">\@code{$the_url}</a>:; |
154 + | } |
155 + | - while (/\@uref{([^}]*)}/) { |
156 + | + while (/\@uref\{([^}]*)\}/) { |
157 + | @items = split(/,/, $1); |
158 + | if ($#items == 0) { |
159 + | - s:\@uref{[^}]*}:<a href="$items[0]">$items[0]</a>:; |
160 + | + s:\@uref\{[^}]*\}:<a href="$items[0]">$items[0]</a>:; |
161 + | } elsif ($#items == 1) { |
162 + | - s:\@uref{[^}]*}:<a href="$items[0]">$items[1]</a>:; |
163 + | + s:\@uref\{[^}]*\}:<a href="$items[0]">$items[1]</a>:; |
164 + | } elsif ($#items == 2) { |
165 + | - s:\@uref{[^}]*}:\@code{$items[2]}:; |
166 + | + s:\@uref\{[^}]*\}:\@code{$items[2]}:; |
167 + | } else { |
168 + | die "Cannot have more than 3 items in a 'uref' at \"$_\""; |
169 + | } |
170 + | |
171 + | sub sub_emphasis { |
172 + | s,<<,<<,g; |
173 + | s,>>,>>,g; |
174 + | - s,\@emph{([^}]*)},<em>$1</em>,g; |
175 + | - s,\@strong{([^}]*)},<b>$1</b>,g; |
176 + | - s,\@footnote{([^}]*)}, [$1],g; |
177 + | - s,\@b{([^}]*)},<b>$1</b>,g; |
178 + | + s,\@emph\{([^}]*)\},<em>$1</em>,g; |
179 + | + s,\@strong\{([^}]*)\},<b>$1</b>,g; |
180 + | + s,\@footnote\{([^}]*)\}, [$1],g; |
181 + | + s,\@b\{([^}]*)\},<b>$1</b>,g; |
182 + | |
183 + | - s,\@code{([^}]*)},`<font color="$ex_color"><code>$1</code></font>',g; |
184 + | + s,\@code\{([^}]*)\},`<font color="$ex_color"><code>$1</code></font>',g; |
185 + | s,\@\@,\@,g; |
186 + | - s,\@samp{([^}]*)},`<font color="$ex_color"><samp>$1</samp></font>',g; |
187 + | - s,\@key{([^}]*)},`<font color="$ex_color"><kbd>$1</kbd></font>',g; |
188 + | - s,\@kbd{([^}]*)},`<font color="$ex_color"><kbd>$1</kbd></font>',g; |
189 + | - s,\@file{([^}]*)},`<font color="$ex_color"><samp>$1</samp></font>',g; |
190 + | + s,\@samp\{([^}]*)\},`<font color="$ex_color"><samp>$1</samp></font>',g; |
191 + | + s,\@key\{([^}]*)\},`<font color="$ex_color"><kbd>$1</kbd></font>',g; |
192 + | + s,\@kbd\{([^}]*)\},`<font color="$ex_color"><kbd>$1</kbd></font>',g; |
193 + | + s,\@file\{([^}]*)\},`<font color="$ex_color"><samp>$1</samp></font>',g; |
194 + | s,TEXINFO2HTML-CLOSE-BRACE,},g; |
195 + | s,TEXINFO2HTML-AT-AT,\@,g; |
196 + | s,TEXINFO2HTML-ACCENT-ACUTE-a,á,g; |