bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cannot easily contribute to the wiki


From: Thomas Schwinge
Subject: Re: Cannot easily contribute to the wiki
Date: Wed, 26 Sep 2018 22:50:44 +0200
User-agent: Notmuch/0.9-125-g4686d11 (http://notmuchmail.org) Emacs/25.2.2 (x86_64-pc-linux-gnu)

Hi!

On Wed, 26 Sep 2018 16:36:44 -0400, Joshua Branson <jbranso@fastmail.com> wrote:
> Thomas Schwinge <thomas@codesourcery.com> 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 "getfield"
> > plugin fail to load:
> >
> >     $ ./render_locally 
> >     Failed to load plugin IkiWiki::Plugin::getfield: Unescaped left brace 
> > 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.
> >
> 
> This is pretty the exact issue that I had.  :)
> 
> 
> > (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üße
 Thomas


>From 6a870e98d7f94402e83c02e9d7dfffb15f9013e4 Mon Sep 17 00:00:00 2001
From: Thomas Schwinge <thomas@codesourcery.com>
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 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.
---
 .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=pagetype($page_file);
     if (defined $page_type)
     {
-       while ($params{content} =~ /{{\$([-\w\/]+#)?[-\w]+}}/)
+       while ($params{content} =~ /\{\{\$([-\w\/]+#)?[-\w]+\}\}/)
        {
            # substitute {{$var}} variables (source-page)
-           $params{content} =~ s/{{\$([-\w]+)}}/get_field_value($1,$page)/eg;
+           $params{content} =~ 
s/\{\{\$([-\w]+)\}\}/get_field_value($1,$page)/eg;
 
            # substitute {{$page#var}} variables (source-page)
-           $params{content} =~ 
s/{{\$([-\w\/]+)#([-\w]+)}}/get_other_page_field_value($2,$page,$1)/eg;
+           $params{content} =~ 
s/\{\{\$([-\w\/]+)#([-\w]+)\}\}/get_other_page_field_value($2,$page,$1)/eg;
        }
     }
 
@@ -79,12 +79,12 @@ sub do_filter (@) {
     $page_type=pagetype($page_file);
     if (defined $page_type)
     {
-       while ($params{content} =~ /{{\+\$([-\w\/]+#)?[-\w]+\+}}/)
+       while ($params{content} =~ /\{\{\+\$([-\w\/]+#)?[-\w]+\+\}\}/)
        {
            # substitute {{+$var+}} variables (dest-page)
-           $params{content} =~ 
s/{{\+\$([-\w]+)\+}}/get_field_value($1,$destpage)/eg;
+           $params{content} =~ 
s/\{\{\+\$([-\w]+)\+\}\}/get_field_value($1,$destpage)/eg;
            # substitute {{+$page#var+}} variables (source-page)
-           $params{content} =~ 
s/{{\+\$([-\w\/]+)#([-\w]+)\+}}/get_other_page_field_value($2,$destpage,$1)/eg;
+           $params{content} =~ 
s/\{\{\+\$([-\w\/]+)#([-\w]+)\+\}\}/get_other_page_field_value($2,$destpage,$1)/eg;
        }
     }
 
diff --git a/.library/IkiWiki/Plugin/texinfo.pm 
b/.library/IkiWiki/Plugin/texinfo.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} =~ s/\@copyright{}/©/g;
+       $copyright{$page} =~ s/\@copyright\{\}/©/g;
     }
     if (defined $license{$page})
     {
-- 
1.9.1


reply via email to

[Prev in Thread] Current Thread [Next in Thread]