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;
Install::setlanguage('en');
###############################################
# SET THE etcdir ENVIRONMENT VAR INSTEAD #
###############################################
Install::setetcdir($ENV{etcdir}||'/etc');
my $input;
loadconfigfile();
$::newversion=`cat koha.version`;
chomp $::newversion;
Install::setkohaversion $::newversion;
if ($::newversion =~ /RC/) {
releasecandidatewarning();
}
my $answer = showmessage(getmessage('WelcomeToUpgrader',[$::newversion]),'yn','n');
if ($answer eq "Y" || $answer eq "y") {
print "Great! continuing upgrade... \n";
} else {
showmessage(getmessage('AbortingInstall'),'none');
exit;
};
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");
# }