From 49145b3cba2a353d163ec02678f873cf8d587d98 Mon Sep 17 00:00:00 2001 From: kados Date: Fri, 31 Mar 2006 18:42:10 +0000 Subject: [PATCH] A simple script that helps sync a rel_2_2 running repo with a head repo (ie, copies over the right files, creates some symlinks, etc.). It's not finished yet, but getting there (I'll be testing it extensively today and tomorrow). --- misc/sync_koha_plugin.pl | 141 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 141 insertions(+) create mode 100755 misc/sync_koha_plugin.pl diff --git a/misc/sync_koha_plugin.pl b/misc/sync_koha_plugin.pl new file mode 100755 index 0000000000..6108a29815 --- /dev/null +++ b/misc/sync_koha_plugin.pl @@ -0,0 +1,141 @@ +#!/usr/bin/perl -w + +use strict; +use Getopt::Long; + +my %opt = (); +GetOptions( + \%opt, + qw/head_dir=s rel_2_2_dir=s help/ +) or die "\nHouston, we got a problem\n"; + +if (exists $opt{help}) { + print < + --rel_2_2_dir= + [--help] + +--head_dir: is the directory where your Koha HEAD cvs is checked out. + +--rel_2_2_dir: is the directory where your Koha rel_2_2 cvs is checked +out and symlinked to your Koha install directories. + +--help: show this help + +FIN + + exit(0); +} +# Configurable Variables +foreach my $option (qw/head_dir rel_2_2_dir/) { + if (not exists $opt{$option}) { + die 'option "', $option, '" is mandatory', "\n"; + } + + if (not -d $opt{$option}) { + die '"', $opt{$option}, '" must be an existing directory', "\n"; + } + + if (not $opt{$option} =~ m{^/}) { + die '--', $option, ' must be an absolute path', "\n"; + } +} + +## Modules +system( + 'cp', + $opt{head_dir}.'/C4/Biblio.pm', + $opt{rel_2_2_dir}.'/C4/' +); +system( + 'cp', + $opt{head_dir}.'/C4/Context.pm', + $opt{rel_2_2_dir}.'/C4/' +); +system( + 'cp', + $opt{head_dir}.'/C4/SearchMarc.pm', + $opt{rel_2_2_dir}.'/C4/' +); +system( + 'cp', + $opt{head_dir}.'/C4/Amazon.pm', + $opt{rel_2_2_dir}.'/C4/' +); +system( + 'cp', + $opt{head_dir}.'/C4/Review.pm', + $opt{rel_2_2_dir}.'/C4/' +); +system( + 'cp', + $opt{head_dir}.'/C4/Search.pm', + $opt{rel_2_2_dir}.'/C4/' +); + +## Intranet +system( + 'cp', + $opt{head_dir}.'/cataloguing/addbiblio.pl', + $opt{rel_2_2_dir}.'/acqui.simple/addbiblio.pl' +); +system( + 'cp', + $opt{head_dir}.'/cataloguing/additem.pl', + $opt{rel_2_2_dir}.'/acqui.simple/' +); +system( + 'cp', + $opt{head_dir}.'/catalogue/detail.pl', + $opt{rel_2_2_dir}.'/' +); +system( + 'cp', + $opt{head_dir}.'/catalogue/MARCdetail.pl', + $opt{rel_2_2_dir}.'/' +); +system( + 'cp', + $opt{head_dir}.'/catalogue/ISBDdetail.pl', + $opt{rel_2_2_dir}.'/' +); + +# OPAC +system( + 'cp', + $opt{head_dir}.'/opac/opac-detail.pl', + $opt{rel_2_2_dir}.'/opac/' +); +system( + 'cp', + $opt{head_dir}.'/opac/opac-MARCdetail.pl', + $opt{rel_2_2_dir}.'/opac/' +); +system( + 'cp', + $opt{head_dir}.'/opac/opac-ISBDdetail.pl', + $opt{rel_2_2_dir}.'/opac/' +); + +## Add the symlink necessary due to changes in the dir structure +system( + 'ln', + '-s', + $opt{rel_2_2_dir}.'/acqui.simple', + $opt{rel_2_2_dir}.'/cataloguing' +); + +print "Finished\n\nRemember, you still need to: + +1. Edit moredetail.tmpl and detail.tmpl to allow for deletions +2. symlink your Koha directory's intranet/zebra dir to the zebra dir + where the pqf file is +3. add to the detail.tmpl + pages to sort by relevance by default + +\n"; + -- 2.39.2