Re: Cannot easily contribute to the wiki

Thomas Schwinge <[email protected]> Wed, 26 Sep 2018 22:50:44 +0200
Newsgroups gmane.os.hurd.web.devel,gmane.os.hurd.bugs
Message-ID <[email protected]>
--=-=-=
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable

Hi!

On Wed, 26 Sep 2018 16:36:44 -0400, Joshua Branson <[email protected]> w=
rote:
> Thomas Schwinge <[email protected]> writes:
> > I'm aware of one problem that is seen with "recent" verions of Perl
> > (don't know when exactly this started), which indeed makes the "getfiel=
d"
> > plugin fail to load:
> >
> >     $ ./render_locally=20
> >     Failed to load plugin IkiWiki::Plugin::getfield: Unescaped left bra=
ce in regex is illegal here in regex; marked by <-- HERE in m/{{ <-- HERE \=
$([-\w/]+#)?[-\w]+}}/ at [...]/.library/IkiWiki/Plugin/getfield.pm line 68.
> >     Compilation failed in require at (eval 94) line 1.
> >     BEGIN failed--compilation aborted at (eval 94) line 1.
> >
>=20
> This is pretty the exact issue that I had.  :)
>=20
>=20
> > (This, or something similar, also happens when pushing to darnassus.)
> >
> > I already have identified a fix, and will push that in the next days.

I now pushed the attached to address this.


Please fetch and try again.


Gr=C3=BC=C3=9Fe
 Thomas



--=-=-=
Content-Type: text/x-diff; charset="utf-8"
Content-Disposition: inline;
	filename="0001-Resolve-incompatibility-in-getfield-and-texinfo-plug.patch"
Content-Transfer-Encoding: quoted-printable

From 6a870e98d7f94402e83c02e9d7dfffb15f9013e4 Mon Sep 17 00:00:00 2001
From: Thomas Schwinge <[email protected]>
Date: Wed, 26 Sep 2018 22:20:34 +0200
Subject: [PATCH] Resolve incompatibility in "getfield" and "texinfo" plugins

... seen with recent versions of Perl:

    Failed to load plugin IkiWiki::Plugin::getfield: Unescaped left brace i=
n regex is illegal here in regex; marked by <-- HERE in m/{{ <-- HERE \$([-=
\w/]+#)?[-\w]+}}/ at [...]/.library/IkiWiki/Plugin/getfield.pm line 68.
    Compilation failed in require at (eval 94) line 1.
    BEGIN failed--compilation aborted at (eval 94) line 1.
---
 .library/IkiWiki/Plugin/getfield.pm | 12 ++++++------
 .library/IkiWiki/Plugin/texinfo.pm  |  2 +-
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/.library/IkiWiki/Plugin/getfield.pm b/.library/IkiWiki/Plugin/=
getfield.pm
index 971e7ec..fb876f3 100644
--- a/.library/IkiWiki/Plugin/getfield.pm
+++ b/.library/IkiWiki/Plugin/getfield.pm
@@ -65,13 +65,13 @@ sub do_filter (@) {
     my $page_type=3Dpagetype($page_file);
     if (defined $page_type)
     {
-	while ($params{content} =3D~ /{{\$([-\w\/]+#)?[-\w]+}}/)
+	while ($params{content} =3D~ /\{\{\$([-\w\/]+#)?[-\w]+\}\}/)
 	{
 	    # substitute {{$var}} variables (source-page)
-	    $params{content} =3D~ s/{{\$([-\w]+)}}/get_field_value($1,$page)/eg;
+	    $params{content} =3D~ s/\{\{\$([-\w]+)\}\}/get_field_value($1,$page)/=
eg;
=20
 	    # substitute {{$page#var}} variables (source-page)
-	    $params{content} =3D~ s/{{\$([-\w\/]+)#([-\w]+)}}/get_other_page_fiel=
d_value($2,$page,$1)/eg;
+	    $params{content} =3D~ s/\{\{\$([-\w\/]+)#([-\w]+)\}\}/get_other_page_=
field_value($2,$page,$1)/eg;
 	}
     }
=20
@@ -79,12 +79,12 @@ sub do_filter (@) {
     $page_type=3Dpagetype($page_file);
     if (defined $page_type)
     {
-	while ($params{content} =3D~ /{{\+\$([-\w\/]+#)?[-\w]+\+}}/)
+	while ($params{content} =3D~ /\{\{\+\$([-\w\/]+#)?[-\w]+\+\}\}/)
 	{
 	    # substitute {{+$var+}} variables (dest-page)
-	    $params{content} =3D~ s/{{\+\$([-\w]+)\+}}/get_field_value($1,$destpa=
ge)/eg;
+	    $params{content} =3D~ s/\{\{\+\$([-\w]+)\+\}\}/get_field_value($1,$de=
stpage)/eg;
 	    # substitute {{+$page#var+}} variables (source-page)
-	    $params{content} =3D~ s/{{\+\$([-\w\/]+)#([-\w]+)\+}}/get_other_page_=
field_value($2,$destpage,$1)/eg;
+	    $params{content} =3D~ s/\{\{\+\$([-\w\/]+)#([-\w]+)\+\}\}/get_other_p=
age_field_value($2,$destpage,$1)/eg;
 	}
     }
=20
diff --git a/.library/IkiWiki/Plugin/texinfo.pm b/.library/IkiWiki/Plugin/t=
exinfo.pm
index 8c65116..0950fb6 100644
--- a/.library/IkiWiki/Plugin/texinfo.pm
+++ b/.library/IkiWiki/Plugin/texinfo.pm
@@ -107,7 +107,7 @@ sub filter (@)
     # ``Render'' by hand some stuff that is commonly found in this section.
     if (defined $copyright{$page})
     {
-	$copyright{$page} =3D~ s/\@copyright{}/=C2=A9/g;
+	$copyright{$page} =3D~ s/\@copyright\{\}/=C2=A9/g;
     }
     if (defined $license{$page})
     {
--=20
1.9.1


--=-=-=--