From e7bf746d6c0524eb9fd8b620558ab84466d60bf4 Mon Sep 17 00:00:00 2001 From: Frederic Demians Date: Tue, 15 Apr 2008 18:10:24 +0200 Subject: [PATCH] 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 --- INSTALL.debian | 19 ++++++++++++-- misc/translator/install-code.pl | 46 +++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+), 2 deletions(-) mode change 100644 => 100755 INSTALL.debian create mode 100755 misc/translator/install-code.pl diff --git a/INSTALL.debian b/INSTALL.debian old mode 100644 new mode 100755 index 86aa4ef94d..1c35e8098c --- a/INSTALL.debian +++ b/INSTALL.debian @@ -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: diff --git a/misc/translator/install-code.pl b/misc/translator/install-code.pl new file mode 100755 index 0000000000..2c49da9a4e --- /dev/null +++ b/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 ); + -- 2.39.5