• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7700 for generic doc work for TWiki-6.0.2. Use View topic Item7703 for doc work on extensions that are not part of a release. More... Close
• Anything you create or change in standard webs (Main, TWiki, Sandbox etc) will be automatically reverted on every SVN update.
Does this site look broken?. Use the LitterTray web for test cases.

Item7517: configure breaks {RCS}{filePermission} under Perl v5.18.2

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Engine configure Normal Closed   patch 6.0.1

Edit Form Data

Summary:
Reported By:
Codebase:
Applies To:
Component:
Priority:
Current State:
Waiting For:
Target Release:
Released In:
 

Detail

If I run configure repeatedly under Perl v5.18.2 (as shipped with current Ubuntu), the settings {RCS}{filePermission} and {RCS}{dirPermission} are broken and can't be fixed without manually editing LocalSite.cfg. The symptoms are very similar to Item3529.

The cause is, however, different. It took me quite some time to figure out what's going on, but basically it is

  1. A plain typo in lib/TWiki.spec, colliding with
  2. questionable coding style in lib/TWiki/Configure/Type.pm, colliding with
  3. a veritable bug in Perl itself, introduced by a commit before 2012, so other recent Perl versions might be affected, too.
The typo: Obvious, isn't it?

diff --git a/twiki/lib/TWiki.spec b/twiki/lib/TWiki.spec
index c9fc4af..42a9d60 100644
--- a/twiki/lib/TWiki.spec
+++ b/twiki/lib/TWiki.spec
@@ -542,7 +542,7 @@ $TWiki::cfg{INCLUDE}{AllowURLs} = $FALSE;
 # correctly.
 $TWiki::cfg{AllowInlineScript} = $TRUE;
 
-# **BOOLEAN EXPERT*
+# **BOOLEAN EXPERT**
 # In HTML rednering, "<p />" has long been put for a blank line in TML.
 # Though "<p />" is self-closing in XML, web browsers handle it as "<p>"
 # because the MIME type of most TWiki pages is text/html rather than text/xml.

The questionable coding style: This routine doesn't check $@ after eval, and it is using use where require is sufficient. Not actually wrong, but perldoc -f use will tell the difference. It is rather unfortunate that it is this difference which triggers a perl bug.

diff --git a/twiki/lib/TWiki/Configure/Type.pm b/twiki/lib/TWiki/Configure/Type.
index 2907e8b..35dab55 100644
--- a/twiki/lib/TWiki/Configure/Type.pm
+++ b/twiki/lib/TWiki/Configure/Type.pm
@@ -44,7 +44,7 @@ sub load {
     my $typer = $knownTypes{$id};
     unless ($typer) {
         my $typeClass = 'TWiki::Configure::Types::'.$id;
-        $typer = eval 'use '.$typeClass.'; new '.$typeClass.'("'.$id.'")';
+        $typer = eval 'require '.$typeClass.'; new '.$typeClass.'("'.$id.'")';
         # unknown type - give it default string behaviours
         $typer = new TWiki::Configure::Type($id) unless $typer;
         $knownTypes{$id} = $typer;

The perl bug: https://rt.perl.org/Public/Bug/Display.html?id=122107

-- TWiki:Main/HaraldJoerg - 2014-06-16

Thank you very much Harald! I'll check this in.

-- TWiki:Main.PeterThoeny - 2014-06-17

Affected support questions:

-- TWiki:Main.PeterThoeny - 2014-06-17

This is now in SVN trunk and 6.0 branch.

Patch for TWiki-6.0.0 code base:

===================================================================
--- TWiki.spec   (revision 27365)
+++ TWiki.spec   (working copy)
@@ -542,7 +542,7 @@
 # correctly.
 $TWiki::cfg{AllowInlineScript} = $TRUE;
 
-# **BOOLEAN EXPERT*
+# **BOOLEAN EXPERT**
 # In HTML rednering, "<p />" has long been put for a blank line in TML.
 # Though "<p />" is self-closing in XML, web browsers handle it as "<p>"
 # because the MIME type of most TWiki pages is text/html rather than text/xml.
Index: TWiki/Configure/Type.pm
===================================================================
--- TWiki/Configure/Type.pm   (revision 27365)
+++ TWiki/Configure/Type.pm   (working copy)
@@ -44,7 +44,7 @@
     my $typer = $knownTypes{$id};
     unless ($typer) {
         my $typeClass = 'TWiki::Configure::Types::'.$id;
-        $typer = eval 'use '.$typeClass.'; new '.$typeClass.'("'.$id.'")';
+        $typer = eval 'require '.$typeClass.'; new '.$typeClass.'("'.$id.'")';
         # unknown type - give it default string behaviours
         $typer = new TWiki::Configure::Type($id) unless $typer;
         $knownTypes{$id} = $typer;

-- TWiki:Main.PeterThoeny - 2014-06-17

More better. Thanks!!!

-- TWiki:Main.StephenPreisach - 2014-06-19

If you run into this issue:

  • Apply the patch
  • Run configure and set {RCS}{dirPermission} to 0755, and {RCS}{filePermission} to 0644

-- TWiki:Main.PeterThoeny - 2014-06-19

Hello How Can I apply the patch exactly Its somehow confusing me , please help and thanks in advance

-- TWiki:Main.YasserAmir - 2014-06-23

Yasser: If you are not familiar with applying patches, there's another way: find the file TWiki.spec in the lib directory of your installation and open it in an editor. On line 545, replace

# **BOOLEAN EXPERT*

by

# **BOOLEAN EXPERT**

...then run configure again to fix permissions.

-- TWiki:Main.HaraldJoerg - 2014-06-23

Harald

Thanks a lot for the help , now it is fixed

-- TWiki:Main.YasserAmir - 2014-07-02

ItemTemplate
Summary configure breaks {RCS}{filePermission} under Perl v5.18.2
ReportedBy TWiki:Main.HaraldJoerg
Codebase ~twiki4, 6.0.0
SVN Range TWiki-6.0.1-trunk, Sun, 15 Jun 2014, build 27651
AppliesTo Engine
Component configure
Priority Normal
CurrentState Closed
WaitingFor

Checkins TWikirev:27659 TWikirev:27660
TargetRelease patch
ReleasedIn 6.0.1
Edit | Attach | Watch | Print version | History: r12 < r11 < r10 < r9 < r8 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r12 - 2014-10-06 - PeterThoeny
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback