[Koha-cvs] koha C4/Context.pm misc/migration_tools/rebuild... [rel_3_0]
Henri-Damien LAURENT
laurenthdl at alinto.com
Wed Dec 6 22:55:39 CET 2006
CVSROOT: /cvsroot/koha
Module name: koha
Branch: rel_3_0
Changes by: Henri-Damien LAURENT <hdl> 06/12/06 21:55:39
Modified files:
C4 : Context.pm
misc/migration_tools: rebuild_zebra.pl
Log message:
Adding zebraoptions for servers to get serverinfos in Context.pm
Using this function in rebuild_zebra.pl
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Context.pm?cvsroot=koha&only_with_tag=rel_3_0&r1=1.43.2.6&r2=1.43.2.7
http://cvs.savannah.gnu.org/viewcvs/koha/misc/migration_tools/rebuild_zebra.pl?cvsroot=koha&only_with_tag=rel_3_0&r1=1.4.2.11&r2=1.4.2.12
Patches:
Index: C4/Context.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Context.pm,v
retrieving revision 1.43.2.6
retrieving revision 1.43.2.7
diff -u -b -r1.43.2.6 -r1.43.2.7
--- C4/Context.pm 24 Nov 2006 21:18:31 -0000 1.43.2.6
+++ C4/Context.pm 6 Dec 2006 21:55:38 -0000 1.43.2.7
@@ -16,7 +16,7 @@
# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
# Suite 330, Boston, MA 02111-1307 USA
-# $Id: Context.pm,v 1.43.2.6 2006/11/24 21:18:31 kados Exp $
+# $Id: Context.pm,v 1.43.2.7 2006/12/06 21:55:38 hdl Exp $
use strict;
use DBI;
use ZOOM;
@@ -28,7 +28,7 @@
qw($context),
qw(@context_stack);
-$VERSION = do { my @v = '$Revision: 1.43.2.6 $' =~ /\d+/g;
+$VERSION = do { my @v = '$Revision: 1.43.2.7 $' =~ /\d+/g;
shift(@v) . "." . join("_", map {sprintf "%03d", $_ } @v); };
=head1 NAME
@@ -338,6 +338,20 @@
# Return the value of the requested config variable
return $context->{"server"}->{$var};
}
+sub zebraoptions
+{
+ my $self = shift;
+ my $var = shift; # The config variable to return
+
+ return undef if !defined($context->{"serverinfo"});
+ # Presumably $self->{config} might be
+ # undefined if the config file given to &new
+ # didn't exist, and the caller didn't bother
+ # to check the return value.
+
+ # Return the value of the requested config variable
+ return $context->{"serverinfo"}->{$var};
+}
=item preference
$sys_preference = C4::Context->preference("some_variable");
@@ -843,6 +857,10 @@
=cut
# $Log: Context.pm,v $
+# Revision 1.43.2.7 2006/12/06 21:55:38 hdl
+# Adding zebraoptions for servers to get serverinfos in Context.pm
+# Using this function in rebuild_zebra.pl
+#
# Revision 1.43.2.6 2006/11/24 21:18:31 kados
# very minor changes, no functional ones, just comments, etc.
#
Index: misc/migration_tools/rebuild_zebra.pl
===================================================================
RCS file: /cvsroot/koha/koha/misc/migration_tools/rebuild_zebra.pl,v
retrieving revision 1.4.2.11
retrieving revision 1.4.2.12
diff -u -b -r1.4.2.11 -r1.4.2.12
--- misc/migration_tools/rebuild_zebra.pl 6 Dec 2006 18:12:21 -0000 1.4.2.11
+++ misc/migration_tools/rebuild_zebra.pl 6 Dec 2006 21:55:38 -0000 1.4.2.12
@@ -199,9 +199,9 @@
$created_dir_or_file++;
}
-unless (-f C4::Context->zebraconfig('authorityserver')->{ccl2rpn}) {
-# system("cp -f $kohadir/misc/zebra/ccl.properties ".C4::Context->zebraconfig('authorityserver')->{ccl2rpn});
- system("cp -f $kohadir/misc/zebra/ccl.properties $authorityserverdir/etc/ccl.properties");
+unless (-f C4::Context->zebraoptions('authorityserver')->{ccl2rpn}) {
+ system("cp -f $kohadir/misc/zebra/ccl.properties ".C4::Context->zebraoptions('authorityserver')->{ccl2rpn});
+# system("cp -f $kohadir/misc/zebra/ccl.properties $authorityserverdir/etc/ccl.properties");
print "Info: copied ccl.properties\n";
$created_dir_or_file++;
}
@@ -384,9 +384,9 @@
print "Info: copied default.idx\n";
$created_dir_or_file++;
}
-unless (-f C4::Context->zebraconfig('biblioserver')->{ccl2rpn}) {
-# system("cp -f $kohadir/misc/zebra/ccl.properties ".C4::Context->zebraconfig('biblioserver')->{ccl2rpn});
- system("cp -f $kohadir/misc/zebra/ccl.properties $biblioserverdir/etc/ccl.properties");
+unless (-f C4::Context->zebraoptions('biblioserver')->{ccl2rpn}) {
+ system("cp -f $kohadir/misc/zebra/ccl.properties ".C4::Context->zebraoptions('biblioserver')->{ccl2rpn});
+# system("cp -f $kohadir/misc/zebra/ccl.properties $biblioserverdir/etc/ccl.properties");
print "Info: copied ccl.properties\n";
$created_dir_or_file++;
}
More information about the Koha-cvs
mailing list