New Foswiki release 2.1.6 is available with important security fixes.
Sourceforge foswiki email lists being discontinued. Subscribe to the new Foswiki announce and discuss lists at MailingLists

Item1372: Plugin installation fails on Windows - can't find Archive::Tar

Priority: Urgent
Current State: Closed
Released In: 1.0.5
Target Release: patch
Applies To: Engine
Reported By: GeorgeClark
Waiting For:
Last Change By: KennethLavrsen
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 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

Archive::Tar is installed on the system

require Archive::Tar;
my $a = Archive::Tar->can_handle_compressed_files;
print "Archive::Tar reports $a \n";
Archive::Tar reports 1

Comparing the versions of, 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/ 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

ItemTemplate edit

Summary Plugin installation fails on Windows - can't find Archive::Tar
ReportedBy GeorgeClark
Codebase 1.0.4
SVN Range Foswiki-1.0.0, Thu, 08 Jan 2009, build 1878
AppliesTo Engine
Priority Urgent
CurrentState Closed
Checkins distro:a3eb8af9162f distro:488a84c84d32 distro:b5560cb1e131
TargetRelease patch
ReleasedIn 1.0.5
Topic revision: r10 - 25 Apr 2009, KennethLavrsen - This page was cached on 21 Mar 2018 - 21:22.

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License