[Koha-cvs] CVS: koha Install.pm,1.1.2.5,1.1.2.6 buildrelease,1.1.2.18,1.1.2.19 koha.upgrade,1.1.2.14,1.1.2.15

Steve Tonnesen tonnesen at users.sourceforge.net
Fri Jul 26 15:46:52 CEST 2002


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

Modified Files:
      Tag: rel-1-2
	Install.pm buildrelease koha.upgrade 
Log Message:
added some new modular code to koha.upgrade


Index: Install.pm
===================================================================
RCS file: /cvsroot/koha/koha/Attic/Install.pm,v
retrieving revision 1.1.2.5
retrieving revision 1.1.2.6
diff -C2 -r1.1.2.5 -r1.1.2.6
*** Install.pm	25 Jul 2002 18:07:32 -0000	1.1.2.5
--- Install.pm	26 Jul 2002 13:46:50 -0000	1.1.2.6
***************
*** 23,26 ****
--- 23,27 ----
  		&databasesetup
  		&restartapache
+ 		&loadconfigfile
  		);
  
***************
*** 163,167 ****
  to any patrons unless you want them to have full access to your intranet.]
  
! print "Press the <ENTER> key to continue: |;
  
  $messages->{'Completed'}->{en}=qq|
--- 164,168 ----
  to any patrons unless you want them to have full access to your intranet.]
  
! Press the <ENTER> key to continue: |;
  
  $messages->{'Completed'}->{en}=qq|
***************
*** 1167,1170 ****
--- 1168,1200 ----
      }
  
+ }
+ 
+ sub loadconfigfile {
+     my %configfile;
+ 
+     open (KC, "/etc/koha.conf");
+     while (<KC>) {
+      chomp;
+      (next) if (/^\s*#/);
+      if (/(.*)\s*=\s*(.*)/) {
+        my $variable=$1;
+        my $value=$2;
+        # Clean up white space at beginning and end
+        $variable=~s/^\s*//g;
+        $variable=~s/\s*$//g;
+        $value=~s/^\s*//g;
+        $value=~s/\s*$//g;
+        $configfile{$variable}=$value;
+      }
+     }
+ 
+     $::intranetdir=$configfile{'intranetdir'};
+     $::opacdir=$configfile{'opacdir'};
+     $::kohaversion=$configfile{'kohaversion'};
+     $::kohalogdir=$configfile{'kohalogdir'};
+     $::database=$configfile{'database'};
+     $::hostname=$configfile{'hostname'};
+     $::user=$configfile{'user'};
+     $::pass=$configfile{'pass'};
  }
  

Index: buildrelease
===================================================================
RCS file: /cvsroot/koha/koha/buildrelease,v
retrieving revision 1.1.2.18
retrieving revision 1.1.2.19
diff -C2 -r1.1.2.18 -r1.1.2.19
*** buildrelease	11 Jul 2002 21:17:31 -0000	1.1.2.18
--- buildrelease	26 Jul 2002 13:46:50 -0000	1.1.2.19
***************
*** 224,227 ****
--- 224,228 ----
  system("mv $rootdir/intranet-cgi/installer.pl $rootdir"); 
  system("mv $rootdir/intranet-cgi/koha.upgrade $rootdir"); 
+ system("mv $rootdir/intranet-cgi/Install.pm $rootdir"); 
  chmod 0770, "$rootdir/installer.pl";
  chmod 0770, "$rootdir/koha.upgrade";

Index: koha.upgrade
===================================================================
RCS file: /cvsroot/koha/koha/koha.upgrade,v
retrieving revision 1.1.2.14
retrieving revision 1.1.2.15
diff -C2 -r1.1.2.14 -r1.1.2.15
*** koha.upgrade	22 Jul 2002 22:41:59 -0000	1.1.2.14
--- koha.upgrade	26 Jul 2002 13:46:50 -0000	1.1.2.15
***************
*** 12,41 ****
  my $input;
  
- my %configfile;
  
! open (KC, "/etc/koha.conf");
! while (<KC>) {
!  chomp;
!  (next) if (/^\s*#/);
!  if (/(.*)\s*=\s*(.*)/) {
!    my $variable=$1;
!    my $value=$2;
!    # Clean up white space at beginning and end
!    $variable=~s/^\s*//g;
!    $variable=~s/\s*$//g;
!    $value=~s/^\s*//g;
!    $value=~s/\s*$//g;
!    $configfile{$variable}=$value;
!  }
! }
! 
! my $intranetdir=$configfile{'intranetdir'};
! my $opacdir=$configfile{'opacdir'};
! my $kohaversion=$configfile{'kohaversion'};
! my $kohalogdir=$configfile{'kohalogdir'};
! my $database=$configfile{'database'};
! my $hostname=$configfile{'hostname'};
! my $user=$configfile{'user'};
! my $pass=$configfile{'pass'};
  
  
--- 12,18 ----
  my $input;
  
  
! loadconfigfile();
! 
  
  
***************
*** 43,76 ****
  my $newversion=`cat koha.version`;
  chomp $newversion;
! if ($newversion =~ /RC/) {
!     print qq|
! =====================
! = RELEASE CANDIDATE =
! =====================
! 
! WARNING WARNING WARNING WARNING WARNING
! 
! You are about to install Koha version $newversion.  This version of Koha is a
! release candidate.  It is not intended to be installed on production systems.
! It is being released so that users can test it before we release a final
! version.
! 
! |;
!     print "Are you sure you want to install Koha $newversion? (Y/[N]): ";
! 
!     my $answer = <STDIN>;
!     chomp $answer;
! 
!     if ($answer eq "Y" || $answer eq "y") {
! 	print "Great! continuing setup... \n";
!     } else {
! 	print qq|
! 
! Watch for announcements of Koha releases on the Koha mailing list or the Koha
! web site (http://www.koha.org/).
! 
! |;
! 	exit;
!     };
  }
  
--- 20,25 ----
  my $newversion=`cat koha.version`;
  chomp $newversion;
! if ($::kohaversion =~ /RC/) {
!     releasecandidatewarning();
  }
  
***************
*** 104,157 ****
  
  
! #
! # Test for Perl and Modules
! #
! print qq|
! 
! PERL & MODULES
! ==============
! 
! |;
! 
! print "\nChecking perl modules ...\n";
!     unless (eval "require 5.004") {
!     die "Sorry, you need at least Perl 5.004\n";
! }
! 
! my @missing = ();
! unless (eval {require DBI})               { push @missing,"DBI" };
! unless (eval {require Date::Manip})       { push @missing,"Date::Manip" };
! unless (eval {require DBD::mysql})        { push @missing,"DBD::mysql" };
! unless (eval {require Set::Scalar})       { push @missing,"Set::Scalar" };
! unless (eval {require Net::Z3950})        { 
!     print qq|
! 
! The Net::Z3950 module is missing.  This module is necessary if you want to use
! Koha's Z39.50 client to download bibliographic records from other libraries.
! To install this module, you will need the yaz client installed from
! http://www.indexdata.dk/yaz/ and then you can install the perl module with the
! command:
! 
! perl -MCPAN -e 'install Net::Z3950'
! 
! Press the <ENTER> key to continue:
! |;
!     <STDIN>;
! }
! 
! #
! # Print out a list of any missing modules
! #
! if (@missing > 0) {
!     print "\n\n";
!     print "You are missing some Perl modules which are required by Koha.\n";
!     print "Once these modules have been installed, rerun this installer.\n";
!     print "They can be installed by running (as root) the following:\n";
!     foreach my $module (@missing) {
! 	print "   perl -MCPAN -e 'install \"$module\"'\n";
! 	exit(1);
!     }} else{
!     print "All modules appear to be installed, continuing...\n";
! };
  
  
--- 53,57 ----
  
  
! checkperlmodules();
  
  
***************
*** 415,436 ****
  system("chown -R root.$httpduser $intranetdir");
  
- # LAUNCH SCRIPT
- print "Modifying Z39.50 daemon launch script...\n";
- my $newfile='';
- open (L, "$intranetdir/scripts/z3950daemon/z3950-daemon-launch.sh");
- while (<L>) {
-     if (/^RunAsUser=/) {
- 	$newfile.="RunAsUser=$httpduser\n";
-     } elsif (/^KohaZ3950Dir=/) {
- 	$newfile.="KohaZ3950Dir=$intranetdir/scripts/z3950daemon\n";
-     } else {
- 	$newfile.=$_;
-     }
- }
- close L;
- system("mv $intranetdir/scripts/z3950daemon/z3950-daemon-launch.sh $intranetdir/scripts/z3950daemon/z3950-daemon-launch.sh.orig");
- open L, ">$intranetdir/scripts/z3950daemon/z3950-daemon-launch.sh";
- print L $newfile;
- close L;
  
  unless ($kohalogdir && -e $kohalogdir) {
--- 315,318 ----
***************
*** 457,481 ****
  }
  
- # SHELL SCRIPT
- print "Modifying Z39.50 daemon wrapper script...\n";
- $newfile='';
- open (S, "$intranetdir/scripts/z3950daemon/z3950-daemon-shell.sh");
- while (<S>) {
-     if (/^KohaModuleDir=/) {
- 	$newfile.="KohaModuleDir=$intranetdir/modules\n";
-     } elsif (/^KohaZ3950Dir=/) {
- 	$newfile.="KohaZ3950Dir=$intranetdir/scripts/z3950daemon\n";
-     } elsif (/^LogDir=/) {
- 	$newfile.="LogDir=$kohalogdir\n";
-     } else {
- 	$newfile.=$_;
-     }
- }
- close S;
- 
- system("mv $intranetdir/scripts/z3950daemon/z3950-daemon-shell.sh $intranetdir/scripts/z3950daemon/z3950-daemon-shell.sh.orig");
- open S, ">$intranetdir/scripts/z3950daemon/z3950-daemon-shell.sh";
- print S $newfile;
- close S;
  chmod 0750, "$intranetdir/scripts/z3950daemon/z3950-daemon-launch.sh";
  chmod 0750, "$intranetdir/scripts/z3950daemon/z3950-daemon-shell.sh";
--- 339,342 ----





More information about the Koha-cvs mailing list