Koha/misc/koha.upgrade

48 lines
1.2 KiB
Perl

#!/usr/bin/perl -w
#use diagnostics;
use strict; # please develop with the strict pragma
use Install;
setlanguage('en');
###############################################
# SET THE etcdir ENVIRONMENT VAR INSTEAD #
###############################################
Install::setetcdir($ENV{etcdir}||'/etc');
my $input;
loadconfigfile();
($::kohaversion) || ($::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";
};
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?', 'yn', 'y');
if ($reply=~/y/i) {
system("perl kohareporter");
}