[Koha-cvs] CVS: koha/misc merge_authority.pl,1.1,1.2 Install.pm,1.88,1.89 buildrelease,1.23,1.24 koha.upgrade,1.17,1.18 overduenotices.pl,1.1,1.2 rebuildnonmarc.pl,1.4,1.5

Paul POULAIN tipaul at users.sourceforge.net
Tue Mar 1 14:42:01 CET 2005


Update of /cvsroot/koha/koha/misc
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20915/misc

Modified Files:
	Install.pm buildrelease koha.upgrade overduenotices.pl 
	rebuildnonmarc.pl 
Added Files:
	merge_authority.pl 
Log Message:
merging 2.2 branch with head. Sorry for not making it before, many many commits done here


Index: Install.pm
===================================================================
RCS file: /cvsroot/koha/koha/misc/Install.pm,v
retrieving revision 1.88
retrieving revision 1.89
diff -C2 -r1.88 -r1.89
*** Install.pm	5 Jan 2005 14:31:17 -0000	1.88
--- Install.pm	1 Mar 2005 13:41:26 -0000	1.89
***************
*** 3,7 ****
  
  # Copyright 2000-2002 Katipo Communications
! # Contains parts Copyright 2003 MJ Ray
  #
  # This file is part of Koha.
--- 3,7 ----
  
  # Copyright 2000-2002 Katipo Communications
! # Contains parts Copyright 2003-4 MJ Ray
  #
  # This file is part of Koha.
***************
*** 27,33 ****
  #MJR: everyone will have these modules, right?
  # They look like part of perl core to me
! use Term::Cap;
  use Term::ANSIColor qw(:constants);
  use Text::Wrap;
  require Exporter;
  
--- 27,34 ----
  #MJR: everyone will have these modules, right?
  # They look like part of perl core to me
! #use Term::Cap;
  use Term::ANSIColor qw(:constants);
  use Text::Wrap;
+ use File::Temp qw/ :mktemp /;
  require Exporter;
  
***************
*** 61,64 ****
--- 62,66 ----
  		&getmessage
  		&showmessage
+ 		&completeupgrade
  		&releasecandidatewarning
  		&getinstallationdirectories
***************
*** 86,90 ****
  use vars qw( $etcdir );				# set in installer.pl, usu. /etc
  use vars qw( $intranetdir $opacdir $kohalogdir );
! use vars qw( $realhttpdconf $httpduser );
  use vars qw( $servername $svr_admin $opacport $intranetport );
  use vars qw( $mysqldir );
--- 88,92 ----
  use vars qw( $etcdir );				# set in installer.pl, usu. /etc
  use vars qw( $intranetdir $opacdir $kohalogdir );
! use vars qw( $realhttpdconf $httpduser $httpdgroup );
  use vars qw( $servername $svr_admin $opacport $intranetport );
  use vars qw( $mysqldir );
***************
*** 107,114 ****
  =cut
  
! my $termios = POSIX::Termios->new();
! $termios->getattr();
! my $terminal = Term::Cap->Tgetent({OSPEED=>$termios->getospeed()});
! my $clear_string = "\n";
  
  sub heading ($) {
--- 109,116 ----
  =cut
  
! #my $termios = POSIX::Termios->new();
! #$termios->getattr();
! #my $terminal = Term::Cap->Tgetent({OSPEED=>$termios->getospeed()});
! my $clear_string = "\n\n"; #MJR: was $terminal->Tputs('cl');
  
  sub heading ($) {
***************
*** 119,123 ****
  
  my $mycnf = $ENV{HOME}."/.my.cnf";
! my $mytmpcnf = `mktemp my.cnf.koha.XXXXXX`;
  chomp($mytmpcnf);
  
--- 121,125 ----
  
  my $mycnf = $ENV{HOME}."/.my.cnf";
! my $mytmpcnf = mktemp("my.cnf.koha.XXXXXX");
  chomp($mytmpcnf);
  
***************
*** 127,138 ****
     heading('Welcome to the Koha Installer') . qq|
  This program will ask some questions and try to install koha for you.
! You need to know: 
! * where most koha files should be stored (you can set the prefix environment variable for this);
! * the username and password of a mysql superuser; 
! * Details of your library setup. 
! * Details of your Apache setup.
  
  If you want to install the Koha configuration files somewhere other than
! /etc (for multiple Koha versions on one system, for example), you should
  set the etcdir environment variable.  Please look at your manuals for
  details of how to set that.
--- 129,139 ----
     heading('Welcome to the Koha Installer') . qq|
  This program will ask some questions and try to install koha for you.
! You need to know: where most koha files should be stored (you can set
! the prefix environment variable for this); the username and password of
! a mysql superuser; and details of your library setup.  You may also need
! to know details of your Apache setup.
  
  If you want to install the Koha configuration files somewhere other than
! /etc (for installing not as root, or to have many Kohas on one system, for example), you should
  set the etcdir environment variable.  Please look at your manuals for
  details of how to set that.
***************
*** 149,153 ****
  $messages->{'WelcomeToUpgrader'}->{en} =
     heading('Welcome to the Koha Upgrader') . qq|
! You are attempting to upgrade to Koha %s.
  
  We recommend that you do a complete backup of all your files before upgrading.
--- 150,154 ----
  $messages->{'WelcomeToUpgrader'}->{en} =
     heading('Welcome to the Koha Upgrader') . qq|
! You are attempting to upgrade from Koha %s to Koha %s.
  
  We recommend that you do a complete backup of all your files before upgrading.
***************
*** 262,269 ****
--- 263,274 ----
  $messages->{'Completed'}->{en} = heading('INSTALLATION COMPLETE') . qq|
  Congratulations ... your Koha installation is complete!
+ 
  You will be able to connect to your Librarian interface at:
+ 
     http://%s\:%s/
+ 
     use the koha admin mysql login and password to connect to this interface.
  and the OPAC interface at:
+ 
     http://%s\:%s/
     
***************
*** 283,286 ****
--- 288,305 ----
  
  #'
+ 
+ =item completeupgrade
+ 
+    completeupgrade
+ 
+ Display a message describing what may need changing in httpd.conf
+ and any other instructions
+ 
+ =cut
+ 
+ sub completeupgrade {
+ 	showmessage(getmessage('UpgradeCompleted',[$intranetdir,$intranetdir,$intranetdir,$opacdir,$opacdir,$intranetdir]),'PressEnter');
+ }
+ 
  sub releasecandidatewarning {
      my $message=getmessage('ReleaseCandidateWarning', [$newversion, $newversion]);
***************
*** 290,294 ****
  	print getmessage('continuing');
      } else {
! 	my $message=getmessage('WatchForReleaseAnnouncements','');
  	print $message."\n";
  	exit;
--- 309,313 ----
  	print getmessage('continuing');
      } else {
! 	my $message=getmessage('WatchForReleaseAnnouncements');
  	print $message."\n";
  	exit;
***************
*** 375,378 ****
--- 394,398 ----
  Sets the sysconfdir, normally /etc.
  This should be an absolute path; a trailing / is not required.
+ Must be writeable, else we die.
  
  =cut
***************
*** 380,383 ****
--- 400,404 ----
  sub setetcdir ($) {
      ($etcdir) = @_;
+     if (! ((-d $etcdir) && (-w $etcdir))) { die("Cannot write to $etcdir! Please set the etcdir environment variable to a writeable directory.\nFailed"); }
  }
  
***************
*** 933,937 ****
  sub getinstallationdirectories {
  	my ($auto_install) = @_;
! 	if (!$ENV{prefix}) { $ENV{prefix} = "/usr/local"; } #"
      $opacdir = $ENV{prefix}.'/koha/opac';
      $intranetdir = $ENV{prefix}.'/koha/intranet';
--- 954,958 ----
  sub getinstallationdirectories {
  	my ($auto_install) = @_;
! 	if (!$ENV{prefix}) { $ENV{prefix} = "/usr/local"; }
      $opacdir = $ENV{prefix}.'/koha/opac';
      $intranetdir = $ENV{prefix}.'/koha/intranet';
***************
*** 1026,1030 ****
  			  /usr
  			  )) {
!        if ( -d $mysql  && -f "$mysql/bin/mysqladmin") { #"
  	    $mysqldir=$mysql;
         }
--- 1047,1051 ----
  			  /usr
  			  )) {
!        if ( -d $mysql  && -f "$mysql/bin/mysqladmin") {
  	    $mysqldir=$mysql;
         }
***************
*** 1303,1307 ****
--- 1324,1330 ----
  NOTE: You will need to add lines to your main httpd.conf to
  include %s/koha-httpd.conf
+ (using the Include directive)
  and to make sure it is listening on the right ports
+ and host names
  (using the Listen directive).
  
***************
*** 1463,1466 ****
--- 1486,1497 ----
  	print SITE <<EOP
  
+ # Koha 2.2 Apache Virtual Host Config File
+ #
+ # Please include this file in your apache configuration.
+ # The best way to do that depends on your site setup.
+ # Some like an Include adding to /etc/apache/httpd.conf
+ # and some prefer a symlink to this file from some dir.
+ # Please refer to your system manuals.
+ 
  # Ports to listen to for Koha
  # uncomment these if they aren't already in main httpd.conf
***************
*** 1469,1472 ****
--- 1500,1505 ----
  
  # NameVirtualHost is used by one of the optional configurations detailed below
+ # Please make sure this line is correct before uncommenting.
+ # See http://httpd.apache.org/docs/vhosts/ for some guides.
  
  #NameVirtualHost 11.22.33.44
***************
*** 1478,1481 ****
--- 1511,1515 ----
     ServerName $servername
     ScriptAlias /cgi-bin/koha/ $opacdir/cgi-bin/
+    Redirect permanent index.html http://$servername\:$opacport/cgi-bin/koha/opac-main.pl
     ErrorLog $logfiledir/opac-error_log
     TransferLog $logfiledir/opac-access_log
***************
*** 1491,1494 ****
--- 1525,1529 ----
     ServerName $servername
     ScriptAlias /cgi-bin/koha/ "$intranetdir/cgi-bin/"
+    Redirect permanent index.html http://$servername\:$intranetport/cgi-bin/koha/mainpage.pl
     ErrorLog $logfiledir/koha-error_log
     TransferLog $logfiledir/koha-access_log
***************
*** 1771,1776 ****
  	# Set up permissions
  	startsysout();
! 	print system("$mysqldir/bin/mysql -u$mysqluser mysql -e \"insert into user (Host,User,Password) values ('$hostname','$user',password('$pass'))\"\;");#"
! 	system("$mysqldir/bin/mysql -u$mysqluser mysql -e \"insert into db (Host,Db,User,Select_priv,Insert_priv,Update_priv,Delete_priv,Create_priv,Drop_priv, index_priv, alter_priv) values ('%','$database','$user','Y','Y','Y','Y','Y','Y','Y','Y')\"");
  	system("$mysqldir/bin/mysqladmin -u$mysqluser reload");
  	# Change to admin user login
--- 1806,1811 ----
  	# Set up permissions
  	startsysout();
! 	print system("$mysqldir/bin/mysql -u$mysqluser -e \"insert into user (Host,User,Password) values ('$hostname','$user',password('$pass'))\" mysql\;");
! 	system("$mysqldir/bin/mysql -u$mysqluser -e \"insert into db (Host,Db,User,Select_priv,Insert_priv,Update_priv,Delete_priv,Create_priv,Drop_priv, index_priv, alter_priv) values ('%','$database','$user','Y','Y','Y','Y','Y','Y','Y','Y')\" mysql");
  	system("$mysqldir/bin/mysqladmin -u$mysqluser reload");
  	# Change to admin user login
***************
*** 1845,1848 ****
--- 1880,1884 ----
      if (! -e $ENV{"KOHA_CONF"}) { $ENV{"KOHA_CONF"}=$etcdir.'/koha.conf.tmp'; }
  	startsysout();	
+ 	setmysqlclipass($pass);
  	my $result=system ("perl -I $intranetdir/modules scripts/updater/updatedatabase -s");
  	if ($result) {
***************
*** 1916,1922 ****
  
  		startsysout();
! 		system("$mysqldir/bin/mysql -u$user $database -e \"insert into branches (branchcode,branchname,issuing) values ('$branchcode', '$branch', 1)\"");
! 		system("$mysqldir/bin/mysql -u$user $database -e \"insert into branchrelations (branchcode,categorycode) values ('MAIN', 'IS')\"");
! 		system("$mysqldir/bin/mysql -u$user $database -e \"insert into branchrelations (branchcode,categorycode) values ('MAIN', 'CU')\"");
  
  		my $printername='lp';
--- 1952,1958 ----
  
  		startsysout();
! 		system("$mysqldir/bin/mysql -u$user -e \"insert into branches (branchcode,branchname,issuing) values ('$branchcode', '$branch', 1)\" $database");
! 		system("$mysqldir/bin/mysql -u$user -e \"insert into branchrelations (branchcode,categorycode) values ('MAIN', 'IS')\" $database");
! 		system("$mysqldir/bin/mysql -u$user -e \"insert into branchrelations (branchcode,categorycode) values ('MAIN', 'CU')\" $database");
  
  		my $printername='lp';
***************
*** 1937,1941 ****
  		}
  		startsysout();	
! 		system("$mysqldir/bin/mysql -u$user $database -e \"insert into printers (printername,printqueue,printtype) values ('$printername', '$printerqueue', '')\"");
  	}
  	my $language;
--- 1973,1977 ----
  		}
  		startsysout();	
! 		system("$mysqldir/bin/mysql -u$user -e \"insert into printers (printername,printqueue,printtype) values ('$printername', '$printerqueue', '')\" $database");
  	}
  	my $language;
***************
*** 1947,1951 ****
  	}
  	startsysout();	
! 	system("$mysqldir/bin/mysql -u$user $database -e \"update systempreferences set value='$language' where variable='opaclanguages'\"");
  	my @dirs;
  	if (-d "scripts/misc/sql-datas") {
--- 1983,1987 ----
  	}
  	startsysout();	
! 	system("$mysqldir/bin/mysql -u$user -e \"update systempreferences set value='$language' where variable='opaclanguages'\" $database");
  	my @dirs;
  	if (-d "scripts/misc/sql-datas") {
***************
*** 2117,2121 ****
  my $date= sprintf "%4d-%02d-%02d_%02d:%02d:%02d", $year, $month, $day,$hr,$min,$sec;
  
! open (MD, "$mysqldir/bin/mysqldump --user=$user --password=$pass --host=$hostname $database|");
  
  (open BF, ">$backupdir/Koha.backup_$date") || (die "Error opening up backup file $backupdir/Koha.backup_$date: $!\n");
--- 2153,2158 ----
  my $date= sprintf "%4d-%02d-%02d_%02d:%02d:%02d", $year, $month, $day,$hr,$min,$sec;
  
! setmysqlclipass($pass); 
! open (MD, "$mysqldir/bin/mysqldump --user=$user --host=$hostname $database|");
  
  (open BF, ">$backupdir/Koha.backup_$date") || (die "Error opening up backup file $backupdir/Koha.backup_$date: $!\n");

Index: buildrelease
===================================================================
RCS file: /cvsroot/koha/koha/misc/buildrelease,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -r1.23 -r1.24
*** buildrelease	5 Jan 2005 14:31:06 -0000	1.23
--- buildrelease	1 Mar 2005 13:41:26 -0000	1.24
***************
*** 1,4 ****
--- 1,60 ----
  #!/usr/bin/perl
+ # This script uses standard 8-space tabs with 4-space indents
+ # vi users can :set sw=4 ai sm
  
+ use Getopt::Long;
+ use vars qw( $verbose_p );
+ 
+ GetOptions(
+     'verbose|v' => \$verbose_p,
+ ) || exit(1);
+ 
+ print <<EOM;
+ ***************************************
+ * Welcome to the Koha Release Builder *
+ ***************************************
+ EOM
+ 
+ #----------------------------------------------------------
+ # To guess the version, we need to first guess where this
+ # script itself is Otherwise we will have different results
+ # depending on whether the script is called as ./buildrelease
+ # or misc/buildrelease. If we run the script from misc, we
+ # will also get errors from "cvs update" later, so this is
+ # rather important information
+ #----------------------------------------------------------
+ print STDERR "Perl reports that buildrelease is $0\n" if $verbose_p;
+ my $self_path;
+ if ($0 =~ /^(\.\/)*buildrelease$/) {
+     $self_path = 'buildrelease';
+ } elsif ($0 =~ /^(?:(\.\/)*\/)?misc\/buildrelease$/) {
+     $self_path = 'misc/buildrelease';
+ } else {
+     print <<EOM;
+ 
+ WARNING: Unable to determine where the buildrelease script is located.
+          The version number guessed by the next step might be wrong.
+ EOM
+     $self_path = (-f 'buildrelease')? 'buildrelease': 'misc/buildrelease';
+ }
+ print STDERR "Assuming buildrelease is $self_path\n" if $verbose_p;
+ 
+ #----------------------------------------------------------
+ # Fixup the current directory
+ #----------------------------------------------------------
+ if ($self_path eq 'buildrelease') {
+     print <<EOM;
+ 
+ WARNING: You should run the buildrelease script from the top of the koha
+          CVS module.  I will try to change to the correct directory, but
+          it is better if you had ran this script there in the first place.
+ EOM
+     chdir ".." || die "..: chdir: $!\n";
+     $self_path = 'misc/buildrelease';
+ }
+ 
+ #----------------------------------------------------------
+ # Start the release builder
+ #----------------------------------------------------------
  #sub guess_kohahtmldir ($;$);
  #----------------------------------------------------------
***************
*** 14,17 ****
--- 70,74 ----
  
  if (-e "$roothomedir/.kohaautobuild.conf") {
+     print STDERR "$roothomedir/.kohaautobuild.conf found\n" if $verbose_p;
      open C, "<$roothomedir/.kohaautobuild.conf";
      while (<C>) {
***************
*** 30,37 ****
  
  print qq |
- ***************************************
- * Welcome to the Koha Release Builder *
- ***************************************
- 
  This script will automatically build a release tarball.
  
--- 87,90 ----
***************
*** 39,45 ****
  out for the release that you want to build, although it will update the modules
  before building.
- 
  |;
! print "\nWhere is the 'koha' cvs module located [$kohadir]: ";
  chomp($input = <STDIN>);
  if ($input) {
--- 92,97 ----
  out for the release that you want to build, although it will update the modules
  before building.
  |;
! print "\nWhere is the 'koha' cvs module located? [$kohadir]: ";
  chomp($input = <STDIN>);
  if ($input) {
***************
*** 62,72 ****
  #kohahtmldir=$kohahtmldir
  |;
  
  #----------------------------------------------------------
  # which VERSION are we building ?
  #----------------------------------------------------------
! print "\n\nGuessing at next release version.  You may need to enter your SourceForge password...\n";
  chdir $kohadir;
! open (CVSLOG, "cvs log misc/buildrelease|");
  my $symbolicnamessection=0;
  my $symbolicnames;
--- 114,128 ----
  #kohahtmldir=$kohahtmldir
  |;
+ print STDERR "$roothomedir/.kohaautobuild.conf written\n" if $verbose_p;
  
  #----------------------------------------------------------
  # which VERSION are we building ?
  #----------------------------------------------------------
! print <<EOM;
! 
! Guessing the next release version. You may need to enter your SourceForge password.
! EOM
  chdir $kohadir;
! open (CVSLOG, "cvs log $self_path|");
  my $symbolicnamessection=0;
  my $symbolicnames;
***************
*** 79,97 ****
      if (/^symbolic names:/) {
  	$symbolicnamessection=1;
      }
      if ($symbolicnamessection && (/^\s+([^:]*):/)) {
  	my $tag=$1;
! 	if ($tag=~/R_(.*)/) {
  	    my $version='';
  	    my $rc=0;
  	    my $id=$1;
! 	    $id=~s/-/\./g;
  	    if ($id =~/(.*)RC(.*)/) {
  		$version=$1;
  		$rc=$2;
! 		$version=~m#(\d+\.\d+)\.#;
  		if (versioncompare($version, $majorversion->{$1})) {
  		    $majorversion->{$1}=$version;
  		    $majorversionrc->{$1}=$rc;
  		}
  		if (versioncompare($version, $highestversion)) {
--- 135,156 ----
      if (/^symbolic names:/) {
  	$symbolicnamessection=1;
+ 	print STDERR "Scanning symbolic names from cvs output\n" if $verbose_p;
      }
      if ($symbolicnamessection && (/^\s+([^:]*):/)) {
  	my $tag=$1;
! 	if ($tag=~/(?:R|rel)_(.*)/) {
  	    my $version='';
  	    my $rc=0;
  	    my $id=$1;
! 	    $id =~ s/[-_]/\./g;
! 	    print STDERR "Found a tag for release $id\n" if $verbose_p;
  	    if ($id =~/(.*)RC(.*)/) {
  		$version=$1;
  		$rc=$2;
! 		$version =~ /^(\d+\.\d+)(?:\.|[RC]|$)/;
  		if (versioncompare($version, $majorversion->{$1})) {
  		    $majorversion->{$1}=$version;
  		    $majorversionrc->{$1}=$rc;
+ 		    print STDERR "Setting major version for $1 to $version $rc\n" if $verbose_p;
  		}
  		if (versioncompare($version, $highestversion)) {
***************
*** 99,109 ****
  		    $released=0;
  		    $highestrc=$rc;
  		}
  	    } else {
  		$version=$id;
! 		$version=~m#(\d+\.\d+)\.#;
  		if (versioncompare($version, $majorversion->{$1})) {
  		    $majorversion->{$1}=$version;
  		    $majorversionrc->{$1}=0;
  		}
  		if (versioncompare($version, $highestversion)) {
--- 158,170 ----
  		    $released=0;
  		    $highestrc=$rc;
+ 		    print STDERR "Setting highest version to $highestversion $highestrc\n" if $verbose_p;
  		}
  	    } else {
  		$version=$id;
! 		$version =~ /^(\d+\.\d+)(?:\.|[RC]|$)/;
  		if (versioncompare($version, $majorversion->{$1})) {
  		    $majorversion->{$1}=$version;
  		    $majorversionrc->{$1}=0;
+ 		    print STDERR "Setting major version for $1 to $version $rc\n" if $verbose_p;
  		}
  		if (versioncompare($version, $highestversion)) {
***************
*** 111,117 ****
--- 172,180 ----
  		    $released=1;
  		    $highestrc=0;
+ 		    print STDERR "Setting highest version to $highestversion $highestrc\n" if $verbose_p;
  		}
  	    }
  	    $symbolicnames->{$version}->{$rc}=1;
+ 	    print STDERR "Setting symbolic name mapping for version $version $rc to 1\n" if $verbose_p;
  	}
      }
***************
*** 121,143 ****
  my $currentversion='';
  
! my $branchdata=`grep buildrelease CVS/Entries`;
  chomp $branchdata;
  my $branch=(split(m#/#, $branchdata))[5];
! 
! if ($branch eq 'Trel-1-2') {
!     $highestversion=$majorversion->{'1.2'};
!     $highestrc=$majorversionrc->{'1.2'};
      ($highestrc) ? ($released=0) : ($released=1);
  }
  
  if ($released) {
      my @components=split(/\./, $highestversion);
!     $components[$#components]++;
!     $nexthighestversion=join '.', @components;
!     my $minornumber=(split(/\./, $highestversion))[1];
!     if ($minornumber/2 == int($minornumber/2)) {
! 	$releaseversion=$nexthighestversion."RC1";
      } else {
! 	$releaseversion=$nexthighestversion;
      }
      $currentversion=$highestversion;
--- 184,219 ----
  my $currentversion='';
  
! my $cvs_entries_path = $self_path;
! $cvs_entries_path =~ s/[^\/]+$/CVS\/Entries/;
! print STDERR "Assuming CVS/Entries is $cvs_entries_path\n" if $verbose_p;
! 
! my $branchdata=`grep buildrelease $cvs_entries_path`;
  chomp $branchdata;
  my $branch=(split(m#/#, $branchdata))[5];
! $branch =~ s/^T//;
! $branch =~ s/^(?:R|rel)_//;
! $branch =~ s/[-_]/./g;
! print STDERR "Detected branch $branch\n" if $verbose_p;
! 
! if ($branch =~ /\S/ && defined $majorversion->{$branch}) {
!     $highestversion=$majorversion->{$branch};
!     $highestrc=$majorversionrc->{$branch};
      ($highestrc) ? ($released=0) : ($released=1);
+     print STDERR "Using highest version for branch $branch\n" if $verbose_p;
  }
  
  if ($released) {
      my @components=split(/\./, $highestversion);
!     if (@components < 3) { # if it's something like just 2.2 or 2.4
! 	$releaseversion = $highestversion.".1RC1";
      } else {
! 	$components[$#components]++;
! 	$nexthighestversion=join '.', @components;
! 	my $minornumber=(split(/\./, $highestversion))[1];
! 	if ($minornumber/2 == int($minornumber/2)) {
! 	    $releaseversion=$nexthighestversion."RC1";
! 	} else {
! 	    $releaseversion=$nexthighestversion;
! 	}
      }
      $currentversion=$highestversion;
***************
*** 155,159 ****
      print "\nWould you like to rebuild the $currentversion tarball?  Y/[N]: ";
      chomp($input = <STDIN>);
-     print STDERR "releaseversion=($releaseversion), currentversion=($currentversion)\n";#XXXZZZ
      if ($input =~ /^y/i) {
  	$releaseversion=$currentversion;
--- 231,234 ----
***************
*** 178,185 ****
  chomp ($input=<STDIN>);
  my $cvstag=0;
- # FIXME: This means anything other than n will tag; too dangerous?
  if ($input=~/^y/i) {
      $cvstag=1;
  }
  
  
--- 253,260 ----
  chomp ($input=<STDIN>);
  my $cvstag=0;
  if ($input=~/^y/i) {
      $cvstag=1;
  }
+ print "The CVS repository ",($cvstag?"WILL BE TAGGED\n":"will not be tagged\n");
  
  
***************
*** 329,332 ****
--- 404,408 ----
  
  
+ # Given two version numbers (v1, v2), returns 0 if v1 <= v2, or 1 if v1 > v2
  sub versioncompare {
      my $v1=shift;

Index: koha.upgrade
===================================================================
RCS file: /cvsroot/koha/koha/misc/koha.upgrade,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -r1.17 -r1.18
*** koha.upgrade	5 Jan 2005 14:31:17 -0000	1.17
--- koha.upgrade	1 Mar 2005 13:41:26 -0000	1.18
***************
*** 15,18 ****
--- 15,19 ----
  loadconfigfile();
  
+ my $curr_ver = Install::getkohaversion();
  $::newversion=`cat koha.version`;
  chomp $::newversion;
***************
*** 24,28 ****
  }
  
! my $answer = showmessage(getmessage('WelcomeToUpgrader',[$::newversion]),'yn','n');
  if ($answer eq "Y" || $answer eq "y") {
  	print "Great! continuing upgrade... \n";
--- 25,29 ----
  }
  
! my $answer = showmessage(getmessage('WelcomeToUpgrader',[$curr_ver,$::newversion]),'yn','n');
  if ($answer eq "Y" || $answer eq "y") {
  	print "Great! continuing upgrade... \n";
***************
*** 34,37 ****
--- 35,39 ----
  Install::setkohaversion($::newversion);
  checkperlmodules();
+ backupmycnf();
  backupkoha();
  getapacheinfo();
***************
*** 39,42 ****
--- 41,45 ----
  # custom templates warning added to installfiles();
  updatedatabase();
+ restoremycnf();
  finalizeconfigfile();
  

Index: overduenotices.pl
===================================================================
RCS file: /cvsroot/koha/koha/misc/overduenotices.pl,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** overduenotices.pl	11 Sep 2003 22:37:07 -0000	1.1
--- overduenotices.pl	1 Mar 2005 13:41:27 -0000	1.2
***************
*** 5,8 ****
--- 5,9 ----
  # Date:  2003/9/7
  # Author:  Stephen Hedges (shedges at skemotah.com)
+ # modified by Paul Poulain (paul at koha-fr.org)
  # Description: 
  #	This script runs a Koha report of items that
***************
*** 35,38 ****
--- 36,42 ----
  
  use strict;
+ use C4::Context;
+ use C4::Date;
+ use Mail::Sendmail;  # comment out if not doing e-mail notices
  
  print "This script will send overdue notices by e-mail and prepare a file of\nnotices for printing if the borrower does not have e-mail.\nYou MUST edit this script for your library BEFORE you run it for the first time!\nSee the comments in the script for directions on changing the script.\n\nDo you wish to continue? (y/n) ";
***************
*** 40,55 ****
  die unless (/^y/i);  # comment these lines out once you've made the changes
  
  open OUTFILE, ">overdues" or die "Cannot open file overdues: $!";
  
- use C4::Context;
- use Mail::Sendmail;  # comment out if not doing e-mail notices
- 
  # set the e-mail server -- comment out if not doing e-mail notices
! unshift @{$Mail::Sendmail::mailcfg{'smtp'}} , 'alma.athenscounty.lib.oh.us';
  #                                         set your own mail server name here
  
  my $dbh = C4::Context->dbh;
! my $sth = $dbh->prepare ("SELECT issues.borrowernumber,firstname,surname,streetaddress,physstreet,city,zipcode,emailaddress FROM issues,borrowers WHERE returndate IS NULL AND TO_DAYS(NOW())-TO_DAYS(date_due) BETWEEN 7 and 30 AND issues.borrowernumber=borrowers.borrowernumber ORDER BY issues.borrowernumber");
! my $first_borrno = $dbh->prepare ("SELECT borrowernumber FROM issues WHERE returndate IS NULL AND TO_DAYS(NOW())-TO_DAYS(date_due) BETWEEN 7 and 30 ORDER BY borrowernumber");
  my $get_date = $dbh->prepare ("SELECT CURDATE()");
  
--- 44,73 ----
  die unless (/^y/i);  # comment these lines out once you've made the changes
  
+ #
+ # BEGINNING OF PARAMETERS
+ #
+ my $mindays = 7 # the notice will be sent after mindays days (grace period)
+ my $maxdays = 30 # issues being more than maxdays late are managed somewhere else. (borrower probably suspended)
+ my $smtpserver = 'smtp.yourserver.com'; # your smtp server (the server who sent mails)
+ my $from = 'library at yourname.org';
+ my $mailtitle = 'Overdue library items';
+ my $librarymail = 'library at yourname.org'; # all notices without mail are sent (in 1 mail) to this mail address. They must then be managed manually.
+ # this parameter (the last) is the text of the mail that is sent.
+ # this text contains fields that are replaced by their value. Those fields must be written between brackets
+ # The following fields are available :
+ # <date> <itemcount> <firstname> <lastname> <address1> <address2> <address3> <city> <postcode>
+ my $mailtext = "\n\n\nDear library borrower\n\n\n       <date>\n\n       According to our records, you have <itemcount> items that are at\n       least a week overdue for return to the library or renewal.\n       If you have registered a password with the library, you may use it\n       and your library card to login at http://XXX.org\n       to check the status of your account, or you may call any of our branch\n       Please be advised that all library services will be blocked\n       if items are allowed to go more than 30 days overdue.\n\n       Thank you for using your public libraries.\n\n\n                                             <firstname> <lastname>\n                                             <address1>\n                                             <address2>\n                                             <city>  <postcode>\n\n\n\n\n\n";
+ #
+ # END OF PARAMETERS
+ #
  open OUTFILE, ">overdues" or die "Cannot open file overdues: $!";
  
  # set the e-mail server -- comment out if not doing e-mail notices
! unshift @{$Mail::Sendmail::mailcfg{'smtp'}} , $smtpserver;
  #                                         set your own mail server name here
  
  my $dbh = C4::Context->dbh;
! my $sth = $dbh->prepare ("SELECT issues.borrowernumber,firstname,surname,streetaddress,physstreet,city,zipcode,emailaddress FROM issues,borrowers,categorie WHERE returndate IS NULL AND TO_DAYS(NOW())-TO_DAYS(date_due) BETWEEN $mindays and $maxdays AND issues.borrowernumber=borrowers.borrowernumber and borrowers.categorycode=categories.categorycode and categories.overduenoticerequired=1 ORDER BY issues.borrowernumber");
! my $first_borrno = $dbh->prepare ("SELECT borrowernumber FROM issues WHERE returndate IS NULL AND TO_DAYS(NOW())-TO_DAYS(date_due) BETWEEN $mindays and $maxdays ORDER BY borrowernumber");
  my $get_date = $dbh->prepare ("SELECT CURDATE()");
  
***************
*** 57,64 ****
  my $daydate = $get_date->fetchrow_arrayref;
  my $rawdate = $daydate->[0];
! my @dates = split /-/, $rawdate;              # split and reformat date
! my $date = "$dates[1]/$dates[2]/$dates[0]";
! $get_date->finish;
! 
  $first_borrno->execute;               # get first borrowernumber
  my $firstborr = $first_borrno->fetchrow_arrayref;
--- 75,79 ----
  my $daydate = $get_date->fetchrow_arrayref;
  my $rawdate = $daydate->[0];
! my $date = format_date($rawdate);
  $first_borrno->execute;               # get first borrowernumber
  my $firstborr = $first_borrno->fetchrow_arrayref;
***************
*** 77,143 ****
      my $borrno = $row->[0];
      if ($itemcount==0) {    # store values for first borrower
! 	$firstname = $row->[1];
! 	$lastname = $row->[2];
! 	$address1 = $row->[3];
! 	$address2 = $row->[4];
! 	unless ($address2) {
! 	    $address2 = '';
! 	}
! 	$city = $row->[5];
! 	unless ($city) {
! 	    $city = '';
! 	}
! 	$postcode = $row->[6];
! 	unless ($postcode) {
! 	    $postcode = '';
! 	}
! 	$email = $row->[7];
      }
      if ($borrno == $borrowernumber) {     # next borrower yet?
! 	$itemcount++;
! 	next;
      } else {
! 	$borrowernumber = $borrno;
! 	my $notice = "\n\n\n       Athens County Library Services\n       95 W. Washington Street\n       Nelsonville, OH  45674\n\n\n       $date\n\n       According to our records, you have $itemcount items that are at\n       least a week overdue for return to the library or renewal.\n       If you have registered a password with the library, you may use it\n       and your library card to login at http://koha.athenscounty.lib.oh.us\n       to check the status of your account, or you may call any of the\n       Athens County public libraries.  (Athens: 592-4272;\n       Nelsonville: 753-2118; The Plains: 797-4579; Albany: 698-3059;\n       Glouster: 767-3670; Coolville: 667-3354; and Chauncey: 797-2512)\n       Please be advised that all library services will be blocked\n       if items are allowed to go more than 30 days overdue.\n\n       Thank you for using your public libraries.\n\n\n                                             $firstname $lastname\n                                             $address1\n                                             $address2\n                                             $city  $postcode\n\n\n\n\n\n";
  
! # if not using e-mail notices, comment out the following lines
! 	if ($email) {   # or you might check for borrowers.preferredcont 
  	    my %mail = ( To      => $email,
!                          From    => 'nelpl at athenscounty.lib.oh.us',
!                          Subject => 'Overdue library items',
                           Message => $notice,
  			 );
  	    sendmail(%mail);
- 	    $e_count++
- 	} else {
- # if not using e-mail notices, comment out the above lines
- 
- 	    print $notice;
- 	    print OUTFILE $notice;
- 	    $count++;
- 	}    # and comment this one out, too, if not using e-mail
- 
- 	$itemcount = 1;   #start the count for next notice
- 	$firstname = $row->[1]; # and store the new values
- 	$lastname = $row->[2];
- 	$address1 = $row->[3];
- 	$address2 = $row->[4];
- 	unless ($address2) {
- 	    $address2 = '';
- 	}
- 	$city = $row->[5];
- 	unless ($city) {
- 	    $city = '';
- 	}
- 	$postcode = $row->[6];
- 	unless ($postcode) {
- 	    $postcode = '';
- 	}
- 	$email = $row->[7];
-     }
- }
- $sth->finish;
- close OUTFILE;
  
- print "$e_count overdue notices e-mailed\n";
- print "$count overdue notices in file for printing\n\n";
--- 92,177 ----
      my $borrno = $row->[0];
      if ($itemcount==0) {    # store values for first borrower
! 		$firstname = $row->[1];
! 		$lastname = $row->[2];
! 		$address1 = $row->[3];
! 		$address2 = $row->[4];
! 		unless ($address2) {
! 			$address2 = '';
! 		}
! 		$city = $row->[5];
! 		unless ($city) {
! 			$city = '';
! 		}
! 		$postcode = $row->[6];
! 		unless ($postcode) {
! 			$postcode = '';
! 		}
! 		$email = $row->[7];
      }
      if ($borrno == $borrowernumber) {     # next borrower yet?
! 		$itemcount++;
! 		next;
      } else {
! 		$borrowernumber = $borrno;
! 		my $notice = $mailtext;
! 		$notice =~ s/\<date\>/$date/g;
! 		$notice =~ s/\<itemcount\>/$itemcount/g;
! 		$notice =~ s/\<firstname\>/$firstname/g;
! 		$notice =~ s/\<lastname\>/$lastname/g;
! 		$notice =~ s/\<address1\>/$address1/g;
! 		$notice =~ s/\<address2\>/$address2/g;
! 		$notice =~ s/\<address3\>/$address3/g;
! 		$notice =~ s/\<city\>/$city/g;
! 		$notice =~ s/\<postcode\>/$postcode/g;
! 	
! 	# if not using e-mail notices, comment out the following lines
! 		if ($email) {   # or you might check for borrowers.preferredcont 
! 			my %mail = ( To      => $email,
! 							From    => $from,
! 							Subject => $mailtitle,
! 							Message => $notice,
! 				);
! 			sendmail(%mail);
! 			$e_count++
! 		} else {
! 		# if not using e-mail notices, comment out the above lines
! 			print $notice;
! 			print OUTFILE $notice;
! 			$count++;
! 		}    # and comment this one out, too, if not using e-mail
! 
! 		$itemcount = 1;   #start the count for next notice
! 		$firstname = $row->[1]; # and store the new values
! 		$lastname = $row->[2];
! 		$address1 = $row->[3];
! 		$address2 = $row->[4];
! 		unless ($address2) {
! 			$address2 = '';
! 		}
! 		$city = $row->[5];
! 		unless ($city) {
! 			$city = '';
! 		}
! 		$postcode = $row->[6];
! 		unless ($postcode) {
! 			$postcode = '';
! 		}
! 		$email = $row->[7];
! 	}
! }
! $sth->finish;
! close OUTFILE;
! # if some notices have to be printed & managed by the library, send them to library mail address.
! if ($count) {
! 		open ODUES, "overdues" or die "Cannot open file overdues: $!";
! 		my $notice = "$e_count overdue notices e-mailed\n";
! 		my $notice .= "$count overdue notices in file for printing\n\n";
  
! 		my $notice .= <ODUES>;
  	    my %mail = ( To      => $email,
!                          From    => $from,
!                          Subject => 'Koha overdues',
                           Message => $notice,
  			 );
  	    sendmail(%mail);
  

Index: rebuildnonmarc.pl
===================================================================
RCS file: /cvsroot/koha/koha/misc/rebuildnonmarc.pl,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** rebuildnonmarc.pl	23 Sep 2004 16:23:55 -0000	1.4
--- rebuildnonmarc.pl	1 Mar 2005 13:41:27 -0000	1.5
***************
*** 96,99 ****
--- 96,100 ----
  	my ($tagfield,$tagsubfield) = MARCfind_marc_from_kohafield($dbh,"additionalauthors.author",$frameworkcode);
  	my @addiauthfields = $record->field($tagfield);
+ 	$dbh->do("delete from bibliosubtitle where biblionumber=$oldbiblionumber");
  	foreach my $addiauthfield (@addiauthfields) {
  		my @addiauthsubfields = $addiauthfield->subfield($tagsubfield);





More information about the Koha-cvs mailing list