Gentoo Archives: gentoo-commits

From: "Alon Bar-Lev (alonbl)" <alonbl@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in net-libs/gnutls/files: gnutls-2.12.23-gdoc-perl-5.18.patch
Date: Sat, 29 Mar 2014 21:15:09
Message-Id: 20140329211505.8BFCA20057@flycatcher.gentoo.org
1 alonbl 14/03/29 21:15:05
2
3 Added: gnutls-2.12.23-gdoc-perl-5.18.patch
4 Log:
5 Fix perl-5.18 compatibility, bug#504028, thanks to Kerin Millar
6
7 (Portage version: 2.2.8-r1/cvs/Linux x86_64, signed Manifest commit with key BF20DC51)
8
9 Revision Changes Path
10 1.1 net-libs/gnutls/files/gnutls-2.12.23-gdoc-perl-5.18.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-libs/gnutls/files/gnutls-2.12.23-gdoc-perl-5.18.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-libs/gnutls/files/gnutls-2.12.23-gdoc-perl-5.18.patch?rev=1.1&content-type=text/plain
14
15 Index: gnutls-2.12.23-gdoc-perl-5.18.patch
16 ===================================================================
17 --- gnutls-2.12.23.orig/doc/scripts/gdoc 2011-04-08 02:30:44.000000000 +0200
18 +++ gnutls-2.12.23/doc/scripts/gdoc 2014-03-10 01:53:28.899566076 +0200
19 @@ -7,6 +7,8 @@
20 ## Copyright (c) 2001, 2002 Nikos Mavrogiannopoulos
21 ## added -tex
22 ## Copyright (c) 1998 Michael Zucchi
23 +## Copyright (c) 2013 Adam Sampson
24 +## made highlighting not depend on hash order, for Perl 5.18
25
26 # This program is free software: you can redistribute it and/or modify
27 # it under the terms of the GNU General Public License as published by
28 @@ -143,44 +145,44 @@
29 # One for each output format
30
31 # these work fairly well
32 -%highlights_html = ( $type_constant, "<i>\$2</i>",
33 - $type_func, "<b>\$1</b>",
34 - $type_struct, "<i>\$1</i>",
35 - $type_param, "<tt><b>\$1</b></tt>" );
36 +@highlights_html = ( [$type_constant, "<i>\$2</i>"],
37 + [$type_func, "<b>\$1</b>"],
38 + [$type_struct, "<i>\$1</i>"],
39 + [$type_param, "<tt><b>\$1</b></tt>"] );
40 $blankline_html = "<p>";
41
42 -%highlights_texinfo = ( $type_constant, "\\\@code{\$2}",
43 - $type_func, "\\\@code{\$1}",
44 - $type_struct, "\\\@code{\$1}",
45 - $type_param, "\\\@code{\$1}" );
46 +@highlights_texinfo = ( [$type_constant, "\\\@code{\$2}"],
47 + [$type_func, "\\\@code{\$1}"],
48 + [$type_struct, "\\\@code{\$1}"],
49 + [$type_param, "\\\@code{\$1}"] );
50 $blankline_texinfo = "";
51
52 -%highlights_tex = ( $type_constant, "{\\\\it \$2}",
53 - $type_func, "{\\\\bf \$1}",
54 - $type_struct, "{\\\\it \$1}",
55 - $type_param, "{\\\\bf \$1}" );
56 +@highlights_tex = ( [$type_constant, "{\\\\it \$2}"],
57 + [$type_func, "{\\\\bf \$1}"],
58 + [$type_struct, "{\\\\it \$1}"],
59 + [$type_param, "{\\\\bf \$1}"] );
60 $blankline_tex = "\\\\";
61
62 # sgml, docbook format
63 -%highlights_sgml = ( $type_constant, "<replaceable class=\"option\">\$2</replaceable>",
64 - $type_func, "<function>\$1</function>",
65 - $type_struct, "<structname>\$1</structname>",
66 - $type_env, "<envar>\$1</envar>",
67 - $type_param, "<parameter>\$1</parameter>" );
68 +@highlights_sgml = ( [$type_constant, "<replaceable class=\"option\">\$2</replaceable>"],
69 + [$type_func, "<function>\$1</function>"],
70 + [$type_struct, "<structname>\$1</structname>"],
71 + [$type_env, "<envar>\$1</envar>"],
72 + [$type_param, "<parameter>\$1</parameter>"] );
73 $blankline_sgml = "</para><para>\n";
74
75 # these are pretty rough
76 -%highlights_man = ( $type_constant, "\\\\fB\$2\\\\fP",
77 - $type_func, "\\\\fB\$1\\\\fP",
78 - $type_struct, "\\\\fB\$1\\\\fP",
79 - $type_param, "\\\\fI\$1\\\\fP" );
80 +@highlights_man = ( [$type_constant, "\\\\fB\$2\\\\fP"],
81 + [$type_func, "\\\\fB\$1\\\\fP"],
82 + [$type_struct, "\\\\fB\$1\\\\fP"],
83 + [$type_param, "\\\\fI\$1\\\\fP"] );
84 $blankline_man = "";
85
86 # text-mode
87 -%highlights_text = ( $type_constant, "\$2",
88 - $type_func, "\$1",
89 - $type_struct, "\$1",
90 - $type_param, "\$1" );
91 +@highlights_text = ( [$type_constant, "\$2"],
92 + [$type_func, "\$1"],
93 + [$type_struct, "\$1"],
94 + [$type_param, "\$1"] );
95 $blankline_text = "";
96
97
98 @@ -201,7 +203,7 @@
99
100 $verbose = 0;
101 $output_mode = "man";
102 -%highlights = %highlights_man;
103 +@highlights = @highlights_man;
104 $blankline = $blankline_man;
105 $modulename = "API Documentation";
106 $sourceversion = strftime "%Y-%m-%d", localtime;
107 @@ -210,27 +212,27 @@
108 $cmd = shift @ARGV;
109 if ($cmd eq "-html") {
110 $output_mode = "html";
111 - %highlights = %highlights_html;
112 + @highlights = @highlights_html;
113 $blankline = $blankline_html;
114 } elsif ($cmd eq "-man") {
115 $output_mode = "man";
116 - %highlights = %highlights_man;
117 + @highlights = @highlights_man;
118 $blankline = $blankline_man;
119 } elsif ($cmd eq "-tex") {
120 $output_mode = "tex";
121 - %highlights = %highlights_tex;
122 + @highlights = @highlights_tex;
123 $blankline = $blankline_tex;
124 } elsif ($cmd eq "-texinfo") {
125 $output_mode = "texinfo";
126 %highlights = %highlights_texinfo;
127 - $blankline = $blankline_texinfo;
128 + @blankline = @blankline_texinfo;
129 } elsif ($cmd eq "-text") {
130 $output_mode = "text";
131 %highlights = %highlights_text;
132 - $blankline = $blankline_text;
133 + @blankline = @blankline_text;
134 } elsif ($cmd eq "-docbook") {
135 $output_mode = "sgml";
136 - %highlights = %highlights_sgml;
137 + @highlights = @highlights_sgml;
138 $blankline = $blankline_sgml;
139 } elsif ($cmd eq "-listfunc") {
140 $output_mode = "listfunc";
141 @@ -322,9 +324,10 @@
142 my $line;
143 my $ret = "";
144
145 - foreach $pattern (keys %highlights) {
146 + foreach $highlight (@highlights) {
147 + my ($pattern, $replace) = @$highlight;
148 # print "scanning pattern $pattern ($highlights{$pattern})\n";
149 - $contents =~ s:$pattern:repstr($pattern, $highlights{$pattern}, $1, $2, $3, $4):gse;
150 + $contents =~ s:$pattern:repstr($pattern, $replace, $1, $2, $3, $4):gse;
151 }
152 foreach $line (split "\n", $contents) {
153 if ($line eq ""){