• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7848 for generic doc work for TWiki-6.1.1. Use View topic Item7851 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.

Item7293: extender.pl: Can't install extension due to redefined global $/ variable

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Engine Installer Normal Closed   major 6.0.0

Edit Form Data

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

Detail

Twiki extension installer scripts read their _DATA__section as one 'line' by undefining the line seperator variable before reading _ DATA__. Unfortunately the line separator variable is global. Undefining $/ will interfere with checking some module dependencies, e.g. Net::LDAP, specifically when useing Net::LDAP::Constant.

Admittedly, modules should probably not be using the global $/, however it may be in Twiki's best interest to protect itself against this scenario by updating the check_dep subroutine in tools/extender.pl to include a line near the top of the subroutine such as:

local $/ = "\n";

This ended up being a working solution when trying to install LdapContrib, but it's not an issue with LdapContrib per se.

Without this fix the installation looks like as follows:

root@cPHPBB:/var/www/twiki# ./LdapContrib_installer
### LdapContrib Installer ###
.
.
.
##########################################################
Checking dependency on Net::LDAP....
*** LdapContrib depends on cpan package Net::LDAP >=0.33
which is described as "Required"
But when I tried to find it I got this error:
"LDAP_SUCCESS" is not exported by the Net::LDAP::Constant module
"LDAP_COMPARE_TRUE" is not exported by the Net::LDAP::Constant module
"LDAP_COMPARE_FALSE" is not exported by the Net::LDAP::Constant module
Can't continue after import errors at /usr/local/share/perl/5.14.2/Net/LDAP/Message.pm line 8
BEGIN failed--compilation aborted at /usr/local/share/perl/5.14.2/Net/LDAP/Message.pm line 8, <DATA> chunk 1.
at /usr/local/share/perl/5.14.2/Net/LDAP/Message.pm line 8
require Net/LDAP/Message.pm called at /usr/local/share/perl/5.14.2/Net/LDAP.pm line 13
Net::LDAP::BEGIN() called at /usr/local/share/perl/5.14.2/Net/LDAP/Message.pm line 8
eval {...} called at /usr/local/share/perl/5.14.2/Net/LDAP/Message.pm line 8
require Net/LDAP.pm called at (eval 137) line 2
TWiki::Extender::BEGIN() called at /usr/local/share/perl/5.14.2/Net/LDAP/Message.pm line 8
eval {...} called at /usr/local/share/perl/5.14.2/Net/LDAP/Message.pm line 8
eval 'use Net::LDAP
;' called at tools/extender.pl line 167
TWiki::Extender::check_dep('HASH(0x3af5ea0)') called at tools/extender.pl line 226
TWiki::Extender::satisfy('HASH(0x3af5ea0)') called at tools/extender.pl line 924
TWiki::Extender::_install('ARRAY(0x3b47340)', 'LdapContrib') called at tools/extender.pl line 1056
TWiki::Extender::install('http://twiki.org/p/pub/Plugins', 'LdapContrib', 'LdapContrib', 'MANIFEST', 'data/TWiki/LdapContrib.txt,0644,\x{a}lib/TWiki/Contrib/LdapContri...', 'DEPENDENCIES', 'Authen::SASL,>=2.00,1,cpan,Optional\x{a}DB_File,>=1.00,1,cpan,Req...') called at ./LdapContrib_installer line 104
Compilation failed
This module is available from the CPAN archive (http://www.cpan.org). You
can download and install it from here. The module will be installed
to wherever you configured CPAN to install to.
Would you like me to try to download and install the latest version of Net::LDAP from cpan.org? [y/n] y
.
.
.
Net::LDAP is up to date (0.56).
#########################################################################
# WARNING: I still can't find the module Net::LDAP
#
# If you installed the module in a non-standard directory, make sure you
# have followed the instructions in bin/setlib.cfg and added it
# to your @INC path.
#########################################################################

.

.

.

Note that Net::LDAP::Constant is reading its DATA section and defining constants from it, but because of the aforementioned change of the line seperator variable it doesn't read its DATA section correctly and henceforth doesn't define the constants.

-- TWiki:Main/IanBerdei - 2013-07-10

Thanks Ian, I'll take this into the next release.

Could you please post the error message you get when you don't have this fix?

-- TWiki:Main.PeterThoeny - 2013-07-11

I've posted the error(s) in the message. Please see above.

-- TWiki:Main.IanBerdei - 2013-07-12

Thank you Ian! This is now in trunk and 5.1 branch.

-- TWiki:Main.PeterThoeny - 2013-08-07

ItemTemplate
Summary extender.pl: Can't install extension due to redefined global $/ variable
ReportedBy TWiki:Main.IanBerdei
Codebase ~twiki4, 5.1.4
SVN Range TWiki-5.1.3-trunk, Thu, 04 Jul 2013, build 26045
AppliesTo Engine
Component Installer
Priority Normal
CurrentState Closed
WaitingFor

Checkins TWikirev:26163 TWikirev:26164 TWikirev:26165 TWikirev:26166
TargetRelease major
ReleasedIn 6.0.0
Edit | Attach | Watch | Print version | History: r12 < r11 < r10 < r9 < r8 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r12 - 2013-10-15 - PeterThoeny
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback