Item1372: Plugin installation fails on Windows - extender.pl can't find Archive::Tar
Priority: Urgent
Current State: Closed
Released In: 1.0.5
Target Release: patch
Applies To: Engine
Component:
Branches:
Environment is Strawberry perl 5.10, Windows XP
Copied
DirectedGraphPlugin_installer into web root directory, issued ="perl
DirectedGraphPlugin_installer"
...
Got a local archive from C:/www/Foswiki-1.0.4/DirectedGraphPlugin.tgz
Archive::Tar is not installed; trying tar on the command-line
'tar' is not recognized as an internal or external command,
operable program or batch file.
tar failed: 256
If I copy the extender.pl from Foswiki 1.0.0 over the 1.0.4 version, installation works.
...
C:/www/Foswiki-1.0.4/DirectedGraphPlugin.tgz exists on this machine; would you l
ike me to use it?
It was created on Wed Mar 25 18:37:21 2009.
If not, I will try to download a new one.
Use existing C:/www/Foswiki-1.0.4/DirectedGraphPlugin.tgz? [y/n] y
Got a local archive from C:/www/Foswiki-1.0.4/DirectedGraphPlugin.tgz
DirectedGraphPlugin_installer
data/
data/System/
Archive::Tar is installed on the system
C:\www\Foswiki-1.0.4>perl
require Archive::Tar;
my $a = Archive::Tar->can_handle_compressed_files;
print "Archive::Tar reports $a \n";
^Z
Archive::Tar reports 1
Comparing the versions of extender.pl, syntax for checking the availability of Archive::Tar has changed.
Foswiki 1.0.4:
unless ( 'Archive::Tar'->use ) {=
Foswiki 1.0.0:
eval 'use Archive::Tar';
unless ( $@ ) {
At least on Strawberry perl 5.10, the new check doesn't work correctly.
--
GeorgeClark - 26 Mar 2009
Babar explained - this syntax uses the Perl UNIVERSAL::require module.
Further testing, the module is found, and is working correctly on Strawberry perl. It is however missing from the DEPENDENCIES file so the config checker doesn't show the version installed. Minor issue, but would be helpful in debugging.
tools/extender.pl has
unless
where it needs
if
unless ( 'Archive::Tar'->use ) {
my $tar = Archive::Tar->new();
...
}
else {
print STDERR
"Archive::Tar is not installed; trying tar on the command-line\n";
Unless it exists, use the program???
Same logic used for Archive::Zip
Because the routines fall through to shell zip or tar, the perl code didn't need to work on Linux. Found another issue - Archive::Zip returns 0 or an error-code from read(), Archive::Tar returns the file count. Also, Archive::Zip does not provide an error() function, so the error message generated an error due to the missing function.
Appears to be fixed - tested both Tar and Zip archives, on both Linux with perl 5.8, and Windows XP w/ Strawberry perl 5.10.
--
GeorgeClark
I merged over the fix to Release01x00 branch.
I think you should do these fixes in the release branch first and then merge over to trunk as the general rule because it is when you code you test the most and it is the release branch that needs most testing.
There will be 1.0.5 and 1.0.6 released within the next 3-6 months. 1.1.0 with its large changes will not be released until much later this year earliet. It simply will not be stable before.
Naturally only real clean bug fixes should be checked into Release01x00 branch. All enhancements and all code refactorings belong to trunk only.
I expect to release a 1.0.5 in the Easter week. So to get enough test exposure I chose to merge over your fix right away.
--
KennethLavrsen - 27 Mar 2009