Skip to content
Browse files

Two fixes to speed up (a little bit) installation process

Add a explanation on DBD::mysql installation without test suite.
Add /misc/translator/install-code.pl script that creates templates
for specified language codes.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
  • Loading branch information...
1 parent 9b47b82 commit e7bf746d6c0524eb9fd8b620558ab84466d60bf4 @fredericd fredericd committed with Joshua Ferraro
Showing with 63 additions and 2 deletions.
  1. +17 −2 INSTALL.debian
  2. +46 −0 misc/translator/install-code.pl
View
19 INSTALL.debian 100644 → 100755
@@ -171,11 +171,26 @@ When the configuration is completed CPAN will install the Perl modules.
/etc/perl/XML/SAX/ParserDetails.ini
-2.4 Create test database in order to install DBD::mysql
+2.4 Install DBD::mysql Perl module
In order to handle UTF-8 correctly, Koha requires at least version 4.004
-of the DBD::mysql Perl module. However, Debian Etch has a stable package
+of the DBD::mysql Perl module. However, Debian Etch has a stable package
only for version 3.0008, so it is necessary to install the module from CPAN.
+DBD::mysql's test suite needs to use a MySQL 'test' DB which doesn't exist
+anymore. So there are two options to install DBD::mysql:
+
+ (1) install without test suite,
+ (2) install with test suite requiring a test MySQL DB creation.
+
+2.4.1 Install without test suite
+
+Force install DBD::mysql:
+
+ $ sudo cpan
+ cpan> force install DBD::mysql
+
+2.4.2 Create test database in order to install DBD::mysql
+
Because of DBD::mysql's test suite, it is necessary to temporarily create a
test database and user:
View
46 misc/translator/install-code.pl
@@ -0,0 +1,46 @@
+#!/usr/bin/perl
+
+use strict;
+
+=head1 NAME
+
+install-code.pl
+
+=head1 USAGE
+
+Install templates for given language codes.
+
+For example:
+
+ ./install-code fr-FR en-ES
+
+creates templates for languages: fr-FR and en-ES
+
+=cut
+
+
+
+sub install_code {
+ my $code = shift;
+ opendir(PO_DIR, "po") or die "Unable to open po directory";
+ my @po_files = grep { /^$code-i-opac|^$code-i-staff/ } readdir PO_DIR;
+ closedir PO_DIR;
+
+ foreach ( @po_files ) {
+ my ($interface) = /(staff|opac)/;
+ $interface =~ s/staff/intranet/;
+ mkdir "../../koha-tmpl/$interface-tmpl/prog/$code";
+ print $_, " : ", $interface, "\n";
+ my $cmd = "./tmpl_process3.pl install -r " .
+ "-i ../../koha-tmpl/$interface-tmpl/prog/en/ " .
+ "-o ../../koha-tmpl/$interface-tmpl/prog/$code/ " .
+ "-s po/$_";
+ system $cmd;
+ }
+}
+
+
+# Main
+
+install_code ( $_ ) foreach ( @ARGV );
+

0 comments on commit e7bf746

Please sign in to comment.
Something went wrong with that request. Please try again.