--- safe-installer.dist Wed Oct 30 09:04:33 2002 +++ safe-installer Sat Nov 9 00:56:28 2002 @@ -59,6 +59,9 @@ # $INTRA_HOST (virtual) hosts reside. They are # arrays because the user might spread the # load among several real hosts. +use vars qw(@REQUIRED_FILE_SHORT_LIST); + # A few required files to make sure we are + # running from the right directory $SIG{'__DIE__'} = \&sig_DIE; # Clean up after we die $SIG{'INT'} = \&sig_INT; # Clean up if ^C given @@ -85,10 +88,31 @@ exit 0; } -# XXX - Make sure we're in the right directory. Look for a few +# Make sure we're in the right directory. Look for a few # required files ("koha.mysql" seems like a good candidate). If they # don't exist, try 'cd `dirname $0`' and try again. address@hidden = qw( koha.mysql ); +unless (&shortlisted_required_files_exist) { + if ($0 =~ /^(.*)\/[^\/]+$/) { # XXX won't work in Windows + chdir $1 || die "$1: $!\n"; + unless (&shortlisted_required_files_exist) { + print <