From ac1f234162315b0457cca33327dd91be160f5098 Mon Sep 17 00:00:00 2001 From: tonnesen Date: Thu, 27 Jun 2002 19:07:21 +0000 Subject: [PATCH] Checks if a previous version of Koha is installed and prompts to run koha.upgrade if so. Removed option to specify the location of koha.conf as the /etc/ location is hardcoded in Database.pm and Output.pm. Plus, we need to know where it is when upgrading. Added opacdir, intranetdir, and kohaversion settings to koha.conf --- buildrelease | 7 +++++++ installer.pl | 50 +++++++++++++++++++++++++++++++++++++++++--------- 2 files changed, 48 insertions(+), 9 deletions(-) diff --git a/buildrelease b/buildrelease index 2c2c1bc19f..6f95127e2b 100644 --- a/buildrelease +++ b/buildrelease @@ -183,6 +183,12 @@ mkdir("scripts/z3950daemon", 0755); mkdir("modules", 0755); mkdir("docs", 0755); +# Create koha.versin file + +open (KV, ">$rootdir/koha.version"); +print KV "$releaseversion\n"; +close KV; + # Copy all CVS files to intranet-cgi system("cp -a $kohadir/* $rootdir/intranet-cgi"); @@ -199,6 +205,7 @@ system("mv $rootdir/intranet-cgi/README $rootdir"); system("mv $rootdir/intranet-cgi/TODO $rootdir"); system("mv $rootdir/intranet-cgi/databaseinstall.sh $rootdir"); system("mv $rootdir/intranet-cgi/installer.pl $rootdir"); +chmod 0770, "$rootdir/installer.pl"; system("mv $rootdir/intranet-cgi/koha.conf $rootdir"); system("mv $rootdir/intranet-cgi/koha.mysql $rootdir"); system("mv $rootdir/intranet-cgi/sampledata-1.2 $rootdir"); diff --git a/installer.pl b/installer.pl index f7244010c5..fe57559842 100644 --- a/installer.pl +++ b/installer.pl @@ -8,6 +8,35 @@ unless ($< == 0) { exit 1; } +my $kohaversion=`cat koha.version`; +chomp $kohaversion; + +if (-e "/etc/koha.conf") { + my $installedversion=`grep kohaversion= /etc/koha.conf`; + chomp $installedversion; + $installedversion=~m/kohaversion=(.*)/; + $installedversion=$1; + if ($installedversion) { + $installedversion="You currently have Koha $installedversion on your system.\n"; + } else { + $installedversion="I am not able to determine what version of Koha is installed now.\n"; + } + + print qq| + ========================== + = Koha already installed = + ========================== + +It looks like Koha is already installed on your system (/etc/koha.conf exists +already). If you would like to upgrade your system to $kohaversion, please use +the koha.upgrade script in this directory. + +$installedversion + +|; + exit; +} + system('clear'); print qq| ********************************** @@ -162,18 +191,18 @@ print qq| KOHA.CONF ========= -Koha uses a small configuration file that is usually placed in your /etc/ files -directory. The configuration file, will be created in this directory +Koha uses a small configuration file that is placed in your /etc/ files +directory. The configuration file, will be created in this directory. |; #Get the path to the koha.conf directory -print "Enter the path to your configuration directory [$etcdir]: "; -chomp($input = ); - -if ($input) { - $etcdir = $input; -} +#print "Enter the path to your configuration directory [$etcdir]: "; +#chomp($input = ); +# +#if ($input) { +# $etcdir = $input; +#} #Get the database name @@ -247,6 +276,9 @@ hostname=$hostname user=$user pass=$pass includes=$kohadir/htdocs/includes +intranetdir=$kohadir +opacdir=$opacdir +version=$kohaversion EOP ; close(SITES); @@ -425,7 +457,7 @@ configuration. my $includesdirectives=''; if ($includesmodule) { $includesdirectives.="Options +Includes\n"; - $includesdirectives.="AddHandler server-parsed .html\n"; + $includesdirectives.=" AddHandler server-parsed .html\n"; } open(SITE,">>$realhttpdconf") or warn "Insufficient priveleges to open $realhttpdconf for writing.\n"; print SITE <