[Koha-cvs] CVS: koha koha.upgrade,1.1.2.4,1.1.2.5

Steve Tonnesen tonnesen at users.sourceforge.net
Wed Jul 3 19:00:55 CEST 2002


Update of /cvsroot/koha/koha
In directory usw-pr-cvs1:/tmp/cvs-serv21010

Modified Files:
      Tag: rel-1-2
	koha.upgrade 
Log Message:
Modifies /etc/koha.conf, adding any missing entries.


Index: koha.upgrade
===================================================================
RCS file: /cvsroot/koha/koha/koha.upgrade,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -C2 -r1.1.2.4 -r1.1.2.5
*** koha.upgrade	29 Jun 2002 00:43:00 -0000	1.1.2.4
--- koha.upgrade	3 Jul 2002 17:00:53 -0000	1.1.2.5
***************
*** 280,284 ****
     }
  }
! $httpduser ||= 'Undetermined';
  
  print "\n\nINSTALLING KOHA...\n";
--- 280,300 ----
     }
  }
! 
! unless ($httpduser) {
!     print qq|
! I was not able to determine the user that Apache is running as.  This
! information is necessary in order to set the access privileges correctly on
! /etc/koha.conf.  This user should be set in one of the Apache configuration
! files using the "User" directive.
! |;
!     print "What is your Apache user? ";
!     chomp($input = <STDIN>);
! 
!     if ($input) {
! 	$httpduser = $input;
!     } else {
! 	$httpduser='Undetermined';
!     }
! }
  
  print "\n\nINSTALLING KOHA...\n";
***************
*** 299,302 ****
--- 315,361 ----
  system("chown -R root.$httpduser $opacdir");
  system("chown -R root.$httpduser $intranetdir");
+ 
+ 
+ 
+ open (KC, "/etc/koha.conf");
+ my $kccontents='';
+ my $kc;
+ while (<KC>) {
+     if (/^\s*includes\s*=/) {
+ 	$kccontents.="includes=$intranetdir/htdocs/includes\n";
+ 	$kc->{'includes'}=1;
+     } elsif (/^\s*kohaversion\s*=/) {
+ 	$kccontents.="kohaversion=$newversion\n";
+ 	$kc->{'kohaversion'}=1;
+     } elsif (/^\s*intranetdir\s*=/) {
+ 	$kccontents.="intranetdir=$intranetdir\n";
+ 	$kc->{'intranetdir'}=1;
+     } elsif (/^\s*opacdir\s*=/) {
+ 	$kccontents.="opacdir=$opacdir\n";
+ 	$kc->{'opacdir'}=1;
+     } else {
+ 	$kccontents.="$_";
+     }
+ }
+ 
+ unless (defined($kc->{'kohaversion'})) {
+     $kccontents.="kohaversion=$newversion\n";
+ }
+ unless (defined($kc->{'includes'})) {
+     $kccontents.="includes=$intranetdir/htdocs/includes\n";
+ }
+ unless (defined($kc->{'intranetdir'})) {
+     $kccontents.="intranetdir=$intranetdir\n";
+ }
+ unless (defined($kc->{'opacdir'})) {
+     $kccontents.="opacdir=$opacdir\n";
+ }
+ 
+ 
+ system("mv /etc/koha.conf /etc/koha.conf.backup");
+ 
+ open (KC, ">/etc/koha.conf") || warn "Couldn't open /etc/koha.conf for writing.";
+ print KC $kccontents;
+ close KC;
  
  





More information about the Koha-cvs mailing list