Item9819: Extensions with Topic names or directories with non-alphanumeric characters fail to install

pencil
Priority: Urgent
Current State: Closed
Released In: 1.1.1
Target Release: patch
Applies To: Engine
Component: Configure::Package
Branches:
Reported By: MichaelLorenzen
Waiting For:
Last Change By: KennethLavrsen
If I try to install FullCalendarPlugin on Foswiki 1.1.0 (vanilla download package) via the configure script it fails with:

Software error:

Use of uninitialized value $tweb in concatenation (.) or string at /srv/www/foswiki/lib/Foswiki/Configure/Package.pm line 1082, <$fh> line 152.

-- MichaelLorenzen - 11 Oct 2010

I have the same issue with my site

-- PadraigLennon - 11 Oct 2010

Confirmed. The issue is that this extension is attempting to install data into a subdirectory of a pub/Web/Topic/ directory. Looks like I missed that requirement in the rewrite of the extension installer.

You should be able to get around this by manually installing. Untar the file from the root of your foswiki installation. I'll work on a fix and testcase.

I've updated the Summary to describe the actual issue for the release notes.

-- GeorgeClark - 11 Oct 2010

The following patch appears to allow the install to proceed. It's probably not the final fix, as the installer is interpreting the file pub/System/FullCalendarPlugin/fullcalendar-1.4.4/gcal.js,0644, as:
  • WEB = System/FullCalendarPlugin
  • TOPIC = fullcalendar-1.4.4
  • ATTACH = gcal.js
Because the detected web/topic don't really exist in that form, the install just copies in the file.

diff --git a/core/lib/Foswiki/Configure/Package.pm b/core/lib/Foswiki/Configure/Package.pm
index c82ca28..5220cf2 100644
--- a/core/lib/Foswiki/Configure/Package.pm
+++ b/core/lib/Foswiki/Configure/Package.pm
@@ -1079,7 +1079,7 @@ sub _parseManifest {
         ( $tweb, $ttopic ) = $file =~ /^data\/(.*)\/(\w+).txt$/;
     }
     if ( $file =~ m/^pub\/.*/ ) {
-        ( $tweb, $ttopic, $tattach ) = $file =~ /^pub\/(.*)\/(\w+)\/([^\/]+)$/;
+        ( $tweb, $ttopic, $tattach ) = $file =~ /^pub\/(.*)\/(.*?)\/([^\/]+)$/;
     }
 
     $this->{_manifest}->{$file}->{ci}    = ( $desc =~ /\(noci\)/ ? 0 : 1 );

-- GeorgeClark - 11 Oct 2010

I guess the proper fix is to tell in the MANIFEST that it shouldn't checkin the files. So some well placed noci, and maybe some reorganisation of the MANIFEST so not everything gets not checked in...

Also, this seems to be the same in other plugins, such as JQueryPlugin, but it doesn't matter as, as George found out, the web part doesn't exist, so it doesn't bother trying.

-- OlivierRaginel - 11 Oct 2010

Unfortunately this needs to be a core fix, and not the MANIFEST. The error occurs when the MANIFEST file is parsed to find the !noci, so changing !noci or reordering the manifest has no effect.

I've committed a fix for 1.1.1, along with changes to the unit tests that would expose the issue and demonstrate that it is fixed.

You can download an updated Package.pm here: http://trac.foswiki.org/export/9557/branches/Release01x01/core/lib/Foswiki/Configure/Package.pm

-- GeorgeClark - 11 Oct 2010

I could install FullCalendarPlugin with the updated Package.pm

-- MichaelLorenzen - 12 Oct 2010
 

ItemTemplate edit

Summary Extensions with Topic names or directories with non-alphanumeric characters fail to install
ReportedBy MichaelLorenzen
Codebase 1.1.0, trunk
SVN Range
AppliesTo Engine
Component Configure::Package
Priority Urgent
CurrentState Closed
WaitingFor
Checkins distro:3031fce7b0d3 distro:3151bab79075
TargetRelease patch
ReleasedIn 1.1.1
Topic revision: r10 - 25 Oct 2010, KennethLavrsen
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy