Koha/misc/koha.upgrade

51 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();
my $curr_ver = Install::getkohaversion();
$::newversion=`cat koha.version`;
chomp $::newversion;
Install::setkohaversion $::newversion;
if ($::newversion =~ /RC/) {
releasecandidatewarning();
}
my $answer = showmessage(getmessage('WelcomeToUpgrader',[$curr_ver,$::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();
backupmycnf();
backupkoha();
getapacheinfo();
installfiles();
# custom templates warning added to installfiles();
updatedatabase();
restoremycnf();
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");
# }