--- isis2stream.pl 2002/06/16 14:37:43 1.3 +++ isis2stream.pl 2002/06/16 15:26:13 1.4 @@ -4,51 +4,29 @@ use OpenIsis; use Getopt::Std; #use Data::Dumper; -require "common.pl"; - -my $install_dir="/local/index"; -my $mpsindex="/local/mps-5.3/bin/mpsindex -l 9 -b"; -my $isis_data="/var/autofs/misc/isis_data/"; -#my $isis_data="/mnt/20020606/Isis/Data/"; # doma +use common; my %opts; -getopt('dD', \%opts); +getopt('dm', \%opts); -die "usage: $0 -d [database_dir] " if (! $opts{d}); +die "usage: $0 -d [database_dir] -m [database1,database2] " if (! %opts); my $db_dir = $opts{d}; -mkdir "$install_dir/$db_dir" if (!-e "$install_dir/$db_dir"); -mkdir "$install_dir/$db_dir/data" if (!-e "$install_dir/$db_dir/data"); +mkdir "$common::install_dir/$db_dir" if (!-e "$common::install_dir/$db_dir"); +mkdir "$common::install_dir/$db_dir/data" if (!-e "$common::install_dir/$db_dir/data"); -my $dir="$install_dir/$db_dir/data"; +my $dir="$common::install_dir/$db_dir/data"; -open(S,"> $dir/stream") || die "can't open output $dir/stram: $!"; +open(S,"> $dir/stream") || die "can't open output $dir/stream: $!"; open(R,"> $dir/bib") || die "can't open output $dir/bib: $!"; -open(MPS,"| $mpsindex -d $install_dir/$db_dir -autokey") || die "can't start MPS indexer $mpsindex: $!"; +open(MPS,"| $common::mpsindex -d $common::install_dir/$db_dir -autokey") || die "can't start MPS indexer $common::mpsindex: $!"; #open(MPS,"> /tmp/mpsindex") || die "mps: $!"; -my $s="V 5 3 -L hr-HR -F 700+ 1 Autor -F 200+ 2 Naslov -F 210 3 Izdavanje -F 225 4 Nakladnička cjelina -F 300+ 5 Napomene -F 330 6 Sadržaj -F 464 7 Analitički radovi -F 610 8 Ključne riječi -F 675 9 UDK -F 686 10 CC -F 990 11 Signatura -F 991 12 Inventarni broj -F 10 13 ISBN -"; - -print S $s; -print MPS $s; +print S $common::mps_header; +print MPS $common::mps_header; # # expand(nr,"space separated string"); @@ -366,7 +344,7 @@ my $last_tell=0; -my $db = OpenIsis::open( "$isis_data/$db_dir/LIBRI/LIBRI" ); +my $db = OpenIsis::open( "$common::isis_data/$db_dir/LIBRI/LIBRI" ); my $max_rowid = OpenIsis::maxRowid( $db );