Item13743: Configure expects any MANIFEST entry in a dir called "data" as a .txt file,
Priority: Normal
Current State: Closed
Released In: 2.0.2
Target Release: patch
Applies To: Engine
Component: Configure
Branches: master
An extensions that has
data/mime.types in its MANIFEST fails installation (e.g. with tools/configure) with the following message:
Use of uninitialized value $web in concatenation (.) or string at /var/www/foswiki/lib/Foswiki/Configure/Package.pm line 958.
Use of uninitialized value $topic in concatenation (.) or string at /var/www/foswiki/lib/Foswiki/Configure/Package.pm line 958.
Use of uninitialized value $tweb in concatenation (.) or string at /var/www/foswiki/lib/Foswiki/Configure/Package.pm line 958.
Use of uninitialized value $ttopic in concatenation (.) or string at /var/www/foswiki/lib/Foswiki/Configure/Package.pm line 958.
Use of uninitialized value in string eq at /var/www/foswiki/lib/Foswiki/Meta.pm line 2077.
Use of uninitialized value in concatenation (.) or string at /var/www/foswiki/lib/Foswiki/Meta.pm line 2077.
Use of uninitialized value in concatenation (.) or string at /var/www/foswiki/lib/Foswiki/Meta.pm line 2077.
Unable to save topic - web does not exist at /var/www/foswiki/lib/Foswiki/Meta.pm line 2077.
This fails because _getMappedWebTopic gets called for anything in data, but not anything in data is a wiki topic. This worked in Foswiki 1.1.9.
Patch included, see also:
https://github.com/foswiki/distro/pull/5
This fixes an error occuring during installation when an extension tries to install data/mime.types.
The Package.pm probably needs some additional work, as the data directory is hardcoded and there are quite a lot of corner cases to be dealt with (e.g. we probably do not want an extension to overwrite .htpasswd, but a .changes file might be valid).
--
MaikGlatki - 23 Sep 2015
Thanks for the suggested fix and for opening a task. I've adjusted your fix a bit to allow for any filename in the pub or data directories. If a Web/Topic cannot be identified, then the file is simply copied. I also addressed the .htpasswd exposure, and also added in a check for .htaccess files. And in thinking further about .changes, that file also should never be modified directly by the package installer. Adding an exclusion for that as well.
--
Main.GeorgeClark - 25 Sep 2015 - 02:24