[Koha-cvs] koha/misc/migration_tools rebuild_zebra.pl [rel_3_0]

paul poulain paul at koha-fr.org
Wed Dec 6 18:36:44 CET 2006


CVSROOT:	/sources/koha
Module name:	koha
Branch:		rel_3_0
Changes by:	paul poulain <tipaul>	06/12/06 17:36:44

Modified files:
	misc/migration_tools: rebuild_zebra.pl 

Log message:
	some fixes from hdl previous commit...
	
	NOTE : p -f $kohadir/misc/zebra/ccl.properties ".C4::Context->zebraconfig('authorityserver')->{ccl2rpn} don't work because the ccl2rpn is NOT in the scope of the zebraconfig sub (it's in serverinfo and not in server)

CVSWeb URLs:
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.9&r2=1.4.2.10

Patches:
Index: rebuild_zebra.pl
===================================================================
RCS file: /sources/koha/koha/misc/migration_tools/rebuild_zebra.pl,v
retrieving revision 1.4.2.9
retrieving revision 1.4.2.10
diff -u -b -r1.4.2.9 -r1.4.2.10
--- rebuild_zebra.pl	6 Dec 2006 14:19:59 -0000	1.4.2.9
+++ rebuild_zebra.pl	6 Dec 2006 17:36:44 -0000	1.4.2.10
@@ -14,7 +14,7 @@
 $|=1; # flushes output
 
 # limit for database dumping
-my $limit = "LIMIT 1000";
+my $limit;# = "LIMIT 10";
 my $directory;
 my $skip_export;
 my $keep_export;
@@ -158,11 +158,11 @@
     $created_dir_or_file++;
 }
 
-# unless (-d "$authorityserverdir/etc" || C4::Context->zebraconfig('authorityserver')->{config}) {
-#     mkdir "$authorityserverdir/etc";
-#     print "Info: created $authorityserverdir/etc\n";
-#     $created_dir_or_file++;
-# }
+unless (-d "$authorityserverdir/etc") {
+    mkdir "$authorityserverdir/etc";
+    print "Info: created $authorityserverdir/etc\n";
+    $created_dir_or_file++;
+}
 
 #
 # AUTHORITIES : copying mandatory files
@@ -199,8 +199,9 @@
     $created_dir_or_file++;
 }
 
-unless (-f C4::Context->zebraoptions('authorityserver')->{ccl2rpn}) {
-    system("cp -f $kohadir/misc/zebra/ccl.properties ".C4::Context->zebraconfig('authorityserver')->{ccl2rpn});
+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");
     print "Info: copied ccl.properties\n";
     $created_dir_or_file++;
 }
@@ -214,7 +215,7 @@
 # AUTHORITIES : copying mandatory files
 #
 unless (-f C4::Context->zebraconfig('authorityserver')->{config}) {
-open ZD,">:utf8 ".C4::Context->zebraconfig('authorityserver')->{config};
+open ZD,">:utf8 ",C4::Context->zebraconfig('authorityserver')->{config};
 print ZD "
 # generated by KOHA/misc/migration_tools/rebuild_zebra.pl 
 profilePath:\${srcdir:-.}:$authorityserverdir/tab/:$tabdir/tab/:\${srcdir:-.}/tab/
@@ -298,9 +299,9 @@
 print "====================\n";
 print "REINDEXING zebra\n";
 print "====================\n";
-system("zebraidx -g iso2709 -c ".C4::Context->zebraconfig('biblioserver')->{config}." -d authorities init") if ($reset);
-system("zebraidx -g iso2709 -c ".C4::Context->zebraconfig('biblioserver')->{config}." -d authorities update $directory/authorities");
-system("zebraidx -g iso2709 -c ".C4::Context->zebraconfig('biblioserver')->{config}." -d authorities commit");
+system("zebraidx -g iso2709 -c ".C4::Context->zebraconfig('authorityserver')->{config}." -d authorities init") if ($reset);
+system("zebraidx -g iso2709 -c ".C4::Context->zebraconfig('authorityserver')->{config}." -d authorities update $directory/authorities");
+system("zebraidx -g iso2709 -c ".C4::Context->zebraconfig('authorityserver')->{config}." -d authorities commit");
 
 #################################################################################################################
 #                        BIBLIOS 
@@ -343,11 +344,11 @@
     print "Info: created $biblioserverdir/key\n";
     $created_dir_or_file++;
 }
-# unless (-d "$biblioserverdir/etc" || C4::Context->zebraconfig('authorityserver')->{config}) {
-#     mkdir "$biblioserverdir/etc";
-#     print "Info: created $biblioserverdir/etc\n";
-#     $created_dir_or_file++;
-# }
+unless (-d "$biblioserverdir/etc") {
+    mkdir "$biblioserverdir/etc";
+    print "Info: created $biblioserverdir/etc\n";
+    $created_dir_or_file++;
+}
 
 #
 # BIBLIOS : copying mandatory files
@@ -383,8 +384,9 @@
     print "Info: copied default.idx\n";
     $created_dir_or_file++;
 }
-unless (-f C4::Context->zebraoptions('biblioserver')->{ccl2rpn}) {
-    system("cp -f $kohadir/misc/zebra/ccl.properties ".C4::Context->zebraconfig('authorityserver')->{ccl2rpn});
+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");
     print "Info: copied ccl.properties\n";
     $created_dir_or_file++;
 }
@@ -398,7 +400,7 @@
 # BIBLIOS : copying mandatory files
 #
 unless (-f C4::Context->zebraconfig('biblioserver')->{config}) {
-open ZD,">:utf8".C4::Context->zebraconfig('biblioserver')->{config};
+open ZD,">:utf8 ",C4::Context->zebraconfig('biblioserver')->{config};
 print ZD "
 # generated by KOHA/misc/migrtion_tools/rebuild_zebra.pl 
 profilePath:\${srcdir:-.}:$biblioserverdir/tab/:$tabdir/tab/:\${srcdir:-.}/tab/





More information about the Koha-cvs mailing list