Call kohareporter from installer.pl and koha.upgrade

This commit is contained in:
tonnesen 2002-09-03 21:59:48 +00:00
parent 5bab37959f
commit 0efeb8ac5e
5 changed files with 69 additions and 2 deletions

View File

@ -115,6 +115,7 @@ They can be installed by running (as root) the following:
%s
|;
$messages->{'AllPerlModulesInstalled'}->{en}=qq|
==============================
@ -206,7 +207,7 @@ For more information visit http://www.koha.org
Press <ENTER> to exit the installer: |;
sub releasecandidatewarning {
my $message=getmessage('ReleaseCandidateWarning', [$::kohaversion, $::kohaversion]);
my $message=getmessage('ReleaseCandidateWarning', [$::newversion, $::newversion]);
my $answer=showmessage($message, 'yn', 'n');
if ($answer =~ /y/i) {
@ -263,8 +264,39 @@ sub checkperlmodules {
}
unless (-x "/usr/bin/perl") {
my $realperl=`which perl`;
chomp $realperl;
$realperl = showmessage(getmessage('NoUsrBinPerl'), 'none');
until (-x $realperl) {
$realperl=showmessage(getmessage('AskLocationOfPerlExecutable', $realperl), 'free', $realperl, 1);
}
my $response=showmessage(getmessage('ConfirmPerlExecutableSymlink', $realperl), 'yn', 'y', 1);
unless ($response eq 'n') {
system("ln -s $realperl /usr/bin/perl");
}
}
}
$messages->{'NoUsrBinPerl'}->{en}=qq|
========================================
= Perl is not located in /usr/bin/perl =
========================================
The Koha perl scripts expect to find the perl executable in the /usr/bin
directory. It is not there on your system.
|;
$messages->{'AskLocationOfPerlExecutable'}->{en}=qq|Location of Perl Executable: [%s]: |;
$messages->{'ConfirmPerlExecutableSymlink'}->{en}=qq|
The Koha scripts will _not_ work without a symlink from %s to /usr/bin/perl
May I create this symlink? ([Y]/N):
: |;
sub getmessage {
my $messagename=shift;

View File

@ -224,6 +224,7 @@ system("mv $rootdir/intranet-cgi/TODO $rootdir");
system("mv $rootdir/intranet-cgi/installer.pl $rootdir");
system("mv $rootdir/intranet-cgi/koha.upgrade $rootdir");
system("mv $rootdir/intranet-cgi/Install.pm $rootdir");
system("mv $rootdir/intranet-cgi/kohareporter $rootdir");
chmod 0770, "$rootdir/installer.pl";
chmod 0770, "$rootdir/koha.upgrade";
system("mv $rootdir/intranet-cgi/koha.conf $rootdir");

View File

@ -94,3 +94,10 @@ showmessage(getmessage('AuthenticationWarning'), 'PressEnter');
showmessage(getmessage('Completed', [ $::servername, $::intranetport, $::servername, $::opacport]), 'PressEnter');
my $reply=showmessage('Would you like to complete a survey about your library?', 'yn', 'y');
if ($reply=~/y/i) {
system("perl kohareporter");
}

View File

@ -453,3 +453,9 @@ Apache.
Please report any problems you encounter through http://bugs.koha.org/
|;
my $reply=showmessage('Would you like to complete a survey about your library?', 'yn', 'y');
if ($reply=~/y/i) {
system("perl kohareporter");
}

View File

@ -36,7 +36,10 @@ print qq|
= Koha Installation Survey =
============================
Feel free to skip any questions that you do not want to answer,
Feel free to skip any questions that you do not want to answer.
There will be a comments section at the end if you would like to provide
additional information that does not fit within these questions.
|;
@ -62,6 +65,8 @@ $params.="&$param";
print "\n\nAdditional Comments: [leave two blank lines to end]\n";
my $additionalcomments='%0D%0D';
my $lastlineblank=0;
while (<STDIN>) {
@ -79,6 +84,22 @@ while (<STDIN>) {
$additionalcomments=urlencode($additionalcomments);
$params.="&AdditionalComments=$additionalcomments";
print "\n\n";
print qq|
====================
= Survey Completed =
====================
Thank you for completing our survey. We will now connect to a web server on
$host to transfer your responses.
Do you wish to continue submitting your survey results ([Y]/N)? |;
my $reply=<STDIN>;
if ($reply=~/n/i) {
print "Aborting survey submission...\n";
sleep 3;
exit;
}
$remote = IO::Socket::INET->new( Proto => "tcp",