Note: For each new beta tarball I start with running UpgradeTwiki on my existing Cairo TWiki. This is the first of two workarounds I've applied before I got my first HTTP response from Dakar.
Running UpgradeTwiki from a freshly unzipped tarball doesn't work ('No such file or directory'):
- UpgradeTwiki does a
require 'setlib.cfg'
, after having added setlib.cfg='s directory to =@INC
-
setlib.cfg
wants to determine $twikiLibPath
from =Cwd::abs_path( "../lib" )"
Per default
setlib.cfg
assumes that it is running in the
bin
directory of a distribution.
This is enforced by the CGI programs, but not by UpgradeTwiki.
I've been working around this with the following patch:
--- UpgradeTwiki.orig 2005-09-22 14:31:42.000000000 +0200
+++ UpgradeTwiki 2005-09-26 14:06:10.197766400 +0200
@@ -90,5 +90,11 @@
unshift @INC, $newCfgFileDir;
unshift @INC, $newCfgFileDir.'/../lib'; #TODO: make sure its not a relative path
- require 'setlib.cfg';
+ {
+ use Cwd;
+ my $current = cwd();
+ chdir $newCfgFileDir;
+ require 'setlib.cfg';
+ chdir $current;
+ }
eval 'use TWiki';
This needs to be fixed before the next beta.
CC
I have applied your patch, (
SVN:6635) and am playing with it as i work on other aspects of
UpgradeTWiki
however, it worries me that I was able to run
UpgradeTWiki successfully without it, while you could not.
Harald - could you post your command line please
Ok - here it is.
My Cairo installation (still active) is under
/usr/haj/web/Twiki/
My Dakar tarball goes to
/usr/haj/web/_Dakar/
Then, in
/usr/haj/web/_Dakar/
, I say
/usr/haj/web/_Dakar $ ./UpgradeTwiki /usr/haj/web/Twiki/bin/setlib.cfg /usr/haj/web/Dakar
Darn. This may once again be a OS issue. On Linux, Cwd::abs_path seems to be rather forgiving. All I could get was an "undef" (which wouldn't break UpgradeTwiki). My error report was from a cygwin installation. Cwd.pm shows a couple of suspicious calls to Carp::Croak in fast_abs_path which is aliased to abs_path on cygwin. I'll check with MSWin32+Activeperl and cygwinperl and report back.
--
TWiki:Main.HaraldJoerg
Confirmed: Under WindowsXP Pro, MSWin32+Activeperl 5.8.6 and cygwin perl 5.8.7 both croak if
Cwd::abs_path
is called on a nonexistent file. The following one-liner does
not print 'Done' under these perls:
perl -MCwd -e "print Cwd::abs_path(q(../directorywhichdoesntexist));print q(Done)"
This could be considered a perl rather than TWiki issue. Nevertheless I'd suggest to make UpgradeTwiki robust enough to run on Windows derived systems....
--
TWiki:Main.HaraldJoerg
Where is the call to abs_path? I can't find any calls inthe TWiki codebase. Is it behind File::Spec->rel2abs?
CC
bin/setlib.cfg
, lines 29-32:
unless (( defined ($twikiLibPath) ) and (-e $twikiLibPath)) {
use Cwd qw( abs_path );
( $twikiLibPath ) = ($twikiLibPath = Cwd::abs_path( "../lib" )) =~ /(.*)/;
}
--
TWiki:Main.HaraldJoerg
ok, as i've applied your patch, it should resolve lucking issues like this - thanks
-- SD