[Koha-cvs] CVS: koha/misc Install.pm,1.16,1.17 installer.pl,1.9,1.10

Ambrose Li acli at users.sourceforge.net
Sat Jan 25 10:35:11 CET 2003


Update of /cvsroot/koha/koha/misc
In directory sc8-pr-cvs1:/tmp/cvs-serv26849/misc

Modified Files:
	Install.pm installer.pl 
Log Message:
Removed the $:: notation from a lot of global variables; this is needed to
get "use strict" to do something useful regarding these global variables.
Because of this change, a number of accessor functions have been created to
let installer.pl get/set some of these global variables. (We should not use
the $Install:: notation for the global variables either, as that will also
make "use strict" do nothing about these variables.)

POD updates


Index: Install.pm
===================================================================
RCS file: /cvsroot/koha/koha/misc/Install.pm,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -r1.16 -r1.17
*** Install.pm	25 Jan 2003 08:40:22 -0000	1.16
--- Install.pm	25 Jan 2003 09:35:08 -0000	1.17
***************
*** 65,68 ****
--- 65,83 ----
  		);
  
+ use vars qw( $kohaversion );			# set in installer.pl
+ use vars qw( $language );			# set in installer.pl
+ use vars qw( $domainname );			# set in installer.pl
+ 
+ use vars qw( $etcdir );				# set in installer.pl, usu. /etc
+ use vars qw( $intranetdir $opacdir $kohalogdir );
+ use vars qw( $realhttpdconf $httpduser );
[...1072 lines suppressed...]
!     $kohalogdir=$configfile{'kohalogdir'};
!     $database=$configfile{'database'};
!     $hostname=$configfile{'hostname'};
!     $user=$configfile{'user'};
!     $pass=$configfile{'pass'};
  }
  
***************
*** 1468,1477 ****
  
  =back
- 
- =head1 BUGS
- 
- A lot of variables like $::opacdir. Because Perl does not check
- for strictness when a package name is explicitly specified,
- using such variables defeats the purpose of "use strict".
  
  =head1 SEE ALSO
--- 1599,1602 ----

Index: installer.pl
===================================================================
RCS file: /cvsroot/koha/koha/misc/installer.pl,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** installer.pl	15 Jan 2003 13:05:21 -0000	1.9
--- installer.pl	25 Jan 2003 09:35:08 -0000	1.10
***************
*** 8,16 ****
  use vars qw( $input );
  
! $::language='en';
! $::domainname = `hostname -d`;
! chomp $::domainname;
! $::etcdir = '/etc';
  
  
  unless ($< == 0) {
--- 8,19 ----
  use vars qw( $input );
  
! Install::setlanguage 'en';
  
+ my $domainname = `hostname`; # Note: must not have any arguments (portability)
+ $domainname = $domainname =~ /^[^\.]+\.(.*)$/? $1: undef;
+ Install::setdomainname $domainname;
+ 
+ my $etcdir = '/etc';
+ Install::setetcdir $etcdir;
  
  unless ($< == 0) {
***************
*** 28,36 ****
  }
  
! $::kohaversion=`cat koha.version`;
! chomp $::kohaversion;
  
  
! if ($::kohaversion =~ /RC/) {
      releasecandidatewarning();
  }
--- 31,40 ----
  }
  
! my $kohaversion=`cat koha.version`;
! chomp $kohaversion;
! Install::setkohaversion $kohaversion;
  
  
! if ($kohaversion =~ /RC/) {
      releasecandidatewarning();
  }
***************
*** 38,54 ****
  checkabortedinstall();
  
! if (-e "$::etcdir/koha.conf") {
!     $::installedversion=`grep kohaversion= $::etcdir/koha.conf`;
!     chomp $::installedversion;
!     $::installedversion=~m/kohaversion=(.*)/;
!     $::installedversion=$1;
      my $installedversionmsg;
!     if ($::installedversion) {
! 	$installedversionmsg=getmessage('KohaVersionInstalled', [$::installedversion]);
      } else {
  	$installedversionmsg=getmessage('KohaUnknownVersionInstalled');
      }
  
!     my $message=getmessage('KohaAlreadyInstalled', [$::etcdir, $::kohaversion, $installedversionmsg]);
      showmessage($message, 'none');
      exit;
--- 42,58 ----
  checkabortedinstall();
  
! if (-e "$etcdir/koha.conf") {
!     my $installedversion=`grep kohaversion= $etcdir/koha.conf`;
!     chomp $installedversion;
!     $installedversion=~m/kohaversion=(.*)/;
!     $installedversion=$1;
      my $installedversionmsg;
!     if ($installedversion) {
! 	$installedversionmsg=getmessage('KohaVersionInstalled', [$installedversion]);
      } else {
  	$installedversionmsg=getmessage('KohaUnknownVersionInstalled');
      }
  
!     my $message=getmessage('KohaAlreadyInstalled', [$etcdir, $kohaversion, $installedversionmsg]);
      showmessage($message, 'none');
      exit;
***************
*** 104,114 ****
  # Installation is complete.  Rename the koha.conf.tmp file
  
! rename "$::etcdir/koha.conf.tmp", "$::etcdir/koha.conf" || warn "Couldn't rename file at $::etcdir. Must have write capability.\n";
  
  
! showmessage(getmessage('AuthenticationWarning', [$::etcdir]), 'PressEnter');
  
  
! showmessage(getmessage('Completed', [ $::servername, $::intranetport, $::servername, $::opacport]), 'PressEnter');
  
  
--- 108,118 ----
  # Installation is complete.  Rename the koha.conf.tmp file
  
! rename "$etcdir/koha.conf.tmp", "$etcdir/koha.conf" || warn "Couldn't rename file at $etcdir. Must have write capability.\n";
  
  
! showmessage(getmessage('AuthenticationWarning', [$etcdir]), 'PressEnter');
  
  
! showmessage(getmessage('Completed', [ Install::getservername(), Install::getintranetport(), Install::getservername(), Install::getopacport()]), 'PressEnter');
  
  





More information about the Koha-cvs mailing list