[Koha-cvs] CVS: koha installer.pl,1.2.2.2,1.2.2.3

Mike Mylonas dragon28 at users.sourceforge.net
Fri May 10 10:50:19 CEST 2002


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

Modified Files:
      Tag: rel-1-2
	installer.pl 
Log Message:
general cleanup, now tests for existance of koha.conf, still a number of issues to fix.

Index: installer.pl
===================================================================
RCS file: /cvsroot/koha/koha/installer.pl,v
retrieving revision 1.2.2.2
retrieving revision 1.2.2.3
diff -C2 -r1.2.2.2 -r1.2.2.3
*** installer.pl	9 May 2002 09:26:47 -0000	1.2.2.2
--- installer.pl	10 May 2002 08:50:17 -0000	1.2.2.3
***************
*** 1,7 ****
  #!/usr/bin/perl -w # please develop with -w
  
! 
  use strict; # please develop with the strict pragma
  
  print <<EOM;
  **********************************
--- 1,8 ----
  #!/usr/bin/perl -w # please develop with -w
  
! use diagnostics;
  use strict; # please develop with the strict pragma
  
+ system('clear');
  print <<EOM;
  **********************************
***************
*** 9,13 ****
  **********************************
  
- 
  This installer will prompt you with a series of questions.
  It assumes you (or your system administrator) has installed:
--- 10,13 ----
***************
*** 15,45 ****
    * Perl (http://www.perl.org)
  
- 
  and one of the following database applications:
    * MySql (http://www.mysql.org)
  
- 
  on some type of Unix or Unix-like operating system
  
  
- 
  Are Apache, Perl, and a database from the list above installed 
  on this system? (Y/[N]):
  EOM
  
! my $answer = $_;                      
  chomp $answer;
  
  if ($answer eq "Y" || $answer eq "y") {
! 	print "Great!  \n";
      } else {
      print <<EOM;
! You will need to setup database space for your application.
! The installer currently does not support an automated setup with this database.
! Please be sure to read the documentation.
! EOM
!     exit(1);
!   };
  
  
  #
--- 15,43 ----
    * Perl (http://www.perl.org)
  
  and one of the following database applications:
    * MySql (http://www.mysql.org)
  
  on some type of Unix or Unix-like operating system
  
  
  Are Apache, Perl, and a database from the list above installed 
  on this system? (Y/[N]):
  EOM
  
! my $answer = <STDIN>;
  chomp $answer;
  
  if ($answer eq "Y" || $answer eq "y") {
! 	print "Great! continuing setup... \n";
      } else {
      print <<EOM;
! This installer currently does not support an completely automated 
! setup.
  
+ Please be sure to read the documentation, or visit the Koha website 
+ at http://www.koha.org for more information.
+ EOM
+     exit;
+ };
  
  #
***************
*** 47,57 ****
  #  is it likely to be untarred again?
  #
! print "I need to unpack the Koha TarFile -- where is it?  ";
! $answer = $_;
! chomp $answer;    
  
  # FIXME?  using system is probably not the best way to do this 
  # tar on solaris may not work properly, etc.
! system("tar -x $answer"); #unpack fill out
  
  #
--- 45,55 ----
  #  is it likely to be untarred again?
  #
! #print "I need to unpack the Koha TarFile -- where is it?  ";
! #$answer = $_;
! #chomp $answer;    
  
  # FIXME?  using system is probably not the best way to do this 
  # tar on solaris may not work properly, etc.
! #system("tar -x $answer"); #unpack fill out
  
  #
***************
*** 62,66 ****
      die "Sorry, you need at least Perl 5.004\n";
  }
- 	
  
  #
--- 60,63 ----
***************
*** 80,101 ****
      print "\n\n";
      print "You are missing some Perl modules which are required by Koha.\n";
      print "They can be installed by running (as root) the following:\n";
      foreach my $module (@missing) {
!     print "   perl -MCPAN -e 'install \"$module\"'\n";
!     }
!     print "\n";
!     exit;
! }
  
  
  #test for MySQL?
! print "Are you using MySql?(Y/[N]): ";
! $answer = $_;                      
! chomp $answer
! if ($answer eq "Y" || $answer eq "y") {
      # FIXME
      # there is no $password or $KohaDBNAME yet
!     system("mysqladmin -uroot -p$password create $KohaDBNAME ");
!     system("mysql -u$root -p$password ");
      #need to get to mysql prompt  HOW DO I DO THIS?
      
--- 77,99 ----
      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 installery.\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";
! };
  
  
  #test for MySQL?
! #print "Are you using MySql?(Y/[N]): ";
! #$answer = $_;                      
! #chomp $answer
! #if ($answer eq "Y" || $answer eq "y") {
      # FIXME
      # there is no $password or $KohaDBNAME yet
! #    system("mysqladmin -uroot -p$password create $KohaDBNAME ");
! #    system("mysql -u$root -p$password ");
      #need to get to mysql prompt  HOW DO I DO THIS?
      
***************
*** 103,113 ****
      # you could pipe this into mysql in the shell that system generates
      # can this be done from dbi?
!     system("grant all privileges on Koha.* to koha at localhost identified by 'kohapassword'; ");
! } else {
!     print <<EOM;
! You will need to use the MySQL database system for your application.
! The installer currently does not support an automated setup with this database.
! EOM
!   };
  
  print "\n";
--- 101,111 ----
      # you could pipe this into mysql in the shell that system generates
      # can this be done from dbi?
! #    system("grant all privileges on Koha.* to koha at localhost identified by 'kohapassword'; ");
! #} else {
! #    print <<EOM;
! #You will need to use the MySQL database system for your application.
! #The installer currently does not support an automated setup with this database.
! #EOM
! #  };
  
  print "\n";
***************
*** 116,122 ****
  # there is no updatedatabase program yet
  #
! system ("perl updatedatabase -I /pathtoC4 ");
  
  #KOHA conf
  
  # FIXME
--- 114,137 ----
  # there is no updatedatabase program yet
  #
! #system ("perl updatedatabase -I /pathtoC4 ");
  
+ #
  #KOHA conf
+ #
+ print <<EOM;
+ Koha uses a small configuration file that is usually placed in 
+ the /etc/ directory (although technically you could place it
+ anywhere you wish).
+ 
+ Checking to see if koha.conf already exists...
+ EOM
+ 
+ # Check to see if the koha.conf file exists.
+ my($file) = "/etc/koha.conf";
+ my($content);
+ open(FILE, "<$file") or die "cannot open $file for reading : $!";
+ $content = <FILE>;
+ close (FILE);
+ 
  
  # FIXME
***************
*** 127,138 ****
  # file first).
  #
! print <<EOM;
! You will need to add the following to the Koha configuration file\n";
! database=Koha\n";
! hostname=localhost\n";
! user=Koha\n";
! pass=$password\n";
! includes=/usr/local/www/koha/htdocs/includes\n";
! EOM
  
  
--- 142,153 ----
  # file first).
  #
! #print <<EOM;
! #You will need to add the following to the Koha configuration file\n";
! #database=Koha\n";
! #hostname=localhost\n";
! #user=Koha\n";
! #pass=$password\n";
! #includes=/usr/local/www/koha/htdocs/includes\n";
! #EOM
  
  
***************
*** 159,161 ****
  # perhaps asking the user first would be better.
  #
! system('/etc/rc.d/init.d/httpd restart');
--- 174,181 ----
  # perhaps asking the user first would be better.
  #
! #system('/etc/rc.d/init.d/httpd restart');
! 
! #
! # It is competed
! #
! print "\nCongratulations ... you Koha installation is complete!\n";
\ No newline at end of file





More information about the Koha-cvs mailing list