Koha/misc/koha.upgrade
2003-11-05 23:31:10 +00:00

48 lines
1.3 KiB
Perl

#!/usr/bin/perl -w
#use diagnostics;
use strict; # please develop with the strict pragma
use Install;
Install::setlanguage('en');
###############################################
# SET THE etcdir ENVIRONMENT VAR INSTEAD #
###############################################
Install::setetcdir($ENV{etcdir}||'/etc');
my $input;
loadconfigfile();
($::kohaversion = Install::getkohaversion() ) || ($::kohaversion='unknown version');
$::newversion=`cat koha.version`;
chomp $::newversion;
if ($::newversion =~ /RC/) {
releasecandidatewarning();
}
#FIXME: need kohaversion number
my $answer = showmessage(getmessage('WelcomeToUpgrader',[$::kohaversion,$::newversion]),'yn');
unless ($answer =~/y/i) {
showmessage(getmessage('AbortingInstall'),'none');
exit;
} else {
print "Great! continuing upgrade... \n";
};
Install::setkohaversion($::newversion);
checkperlmodules();
backupkoha();
getapacheinfo();
installfiles();
# custom templates warning added to installfiles();
updatedatabase();
finalizeconfigfile();
showmessage(getmessage('UpgradeCompleted',['FIXME','FIXME','FIXME','FIXME','FIXME','FIXME']),'PressEnter');
my $reply=showmessage('Would you like to complete a survey about your library? [Y]/N: ', 'yn', 'y');
if ($reply=~/y/i) {
system("perl kohareporter");
}