From aeff11b6d37d3ffed518481c9000e5988b7b622e Mon Sep 17 00:00:00 2001 From: miker Date: Thu, 7 Jul 2005 13:37:54 +0000 Subject: [PATCH] syncing cvs with the real world git-svn-id: svn://svn.open-ils.org/ILS/trunk@1089 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Evergreen/src/extras/import/import_clean_marc.pl | 15 +++--------- Evergreen/src/extras/import/import_holdings.pl | 27 ++++++++++++++++++---- Evergreen/src/extras/import/pg-drop-create.sh | 4 ++-- Evergreen/src/extras/import/pines_libs.txt | 8 +++---- Open-ILS/src/extras/import/build-oils-db.sh | 4 ++-- Open-ILS/src/extras/import/cleanse-usmarc.sh | 2 +- Open-ILS/src/extras/import/extract-holdings.sh | 2 +- .../src/extras/import/generate-srfsh-wormer.pl | 4 ++-- Open-ILS/src/sql/Postgres/build-db-Postgres.sh | 4 ++-- 9 files changed, 40 insertions(+), 30 deletions(-) diff --git a/Evergreen/src/extras/import/import_clean_marc.pl b/Evergreen/src/extras/import/import_clean_marc.pl index ac06eeb87b..2c45eb2ef4 100755 --- a/Evergreen/src/extras/import/import_clean_marc.pl +++ b/Evergreen/src/extras/import/import_clean_marc.pl @@ -9,12 +9,11 @@ use open qw/:utf8/; $|=1; -my ($userid, $sourceid, $rec_id, $entry_file, $marc_file, $map_file) = (1, 2, 1, 'record_entry.sql','record_marc.sql','record_id_map.pl'); +my ($userid, $sourceid, $rec_id, $entry_file, $map_file) = (1, 2, 1, 'record_entry.sql','record_id_map.pl'); GetOptions ( "sourceid" => \$sourceid, "entry_file=s" => \$entry_file, - "marc_file=s" => \$marc_file, "tcn_map_file=s" => \$map_file, "userid=i" => \$userid, "first=i" => \$rec_id, @@ -23,16 +22,10 @@ GetOptions ( my $tcn_map; open RE, ">$entry_file" or die "Can't open $entry_file! $!\n"; -open RM, ">$marc_file" or die "Can't open $marc_file! $!\n"; print RE < ) { print "."; $$tcn_map{$tcn} = $rec_id; - print RE join("\t", ($rec_id,$userid,$userid,$sourceid,$tcn,$xact_id))."\n"; - print RM join("\t", ($rec_id,$xml,$xact_id))."\n"; + print RE join("\t", ($rec_id,$userid,$userid,$sourceid,$tcn,$xml,$xact_id))."\n"; $rec_id++; $xml = ''; @@ -87,7 +79,6 @@ while ( $xml .= ) { print RE "\\.\n"; print RE "SELECT setval('biblio.record_entry_id_seq'::TEXT, $rec_id);\n"; -print RM "\\.\n"; open MAP, ">$map_file" or die "Can't open $map_file! $!\n"; print MAP Data::Dumper->Dump([$tcn_map],['tcn_map']); diff --git a/Evergreen/src/extras/import/import_holdings.pl b/Evergreen/src/extras/import/import_holdings.pl index 10e8d9befe..f76f88b490 100755 --- a/Evergreen/src/extras/import/import_holdings.pl +++ b/Evergreen/src/extras/import/import_holdings.pl @@ -32,10 +32,27 @@ eval `cat $lib_map_file`; open CP, ">$cp_file" or die "Can't open $cp_file! $!\n"; open CN, ">$cn_file" or die "Can't open $cn_file! $!\n"; +my %status_map = ( + '' => 0, + CHECKEDOUT => 1, + BINDERY => 2, + LOST => 3, + MISSING => 4, + INPROCESS => 5, + INTRANSIT => 6, + RESHELVING => 7, + 'ON HOLDS SHELF' => 8, + 'ON-ORDER' => 9, + ILL => 10, + CATALOGING => 11, + RESERVES => 12, + DISCARD => 13, +); + print CP < ) { my $owning_lib = $$lib_map{ $node->findvalue( '*[@code="m"]' ) }; my $price = $node->findvalue( '*[@code="p"]' ); my $copy_number = $node->findvalue( '*[@code="c"]' ); - my $available = $node->findvalue( '*[@code="k"]' ) ? 1 : 0; + my $available = $node->findvalue( '*[@code="k"]' ) || ''; + + my $status = $status_map{$available} || 0; next unless $barcode; next unless $owning_lib; @@ -112,9 +131,9 @@ while ( $xml .= ) { # id,editor,creator,barcode,call_number,copy_number,available,loan_duration,fine_level,circulate,deposit,deposit_amount,price,ref,opac_visible - print CP join("\t", ( $cp_id,$userid,$userid,$barcode, + print CP join("\t", ( $cp_id,$owning_lib,$userid,$userid,$barcode, $$cn_map{"$rec_id/$owning_lib/$label"}, - $copy_number,$available,2,2,1,0,'0.00', + $copy_number,$status,2,2,1,0,'0.00', $price,0,1 ) )."\n"; print 'c'; diff --git a/Evergreen/src/extras/import/pg-drop-create.sh b/Evergreen/src/extras/import/pg-drop-create.sh index 71ac9ad53b..2e4cd553e1 100755 --- a/Evergreen/src/extras/import/pg-drop-create.sh +++ b/Evergreen/src/extras/import/pg-drop-create.sh @@ -1,3 +1,3 @@ #!/bin/sh -dropdb open-ils-utf8-dev -createdb -E UNICODE open-ils-utf8-dev +dropdb demo-dev +createdb -E UNICODE demo-dev diff --git a/Evergreen/src/extras/import/pines_libs.txt b/Evergreen/src/extras/import/pines_libs.txt index d749eb0b01..a27cfde972 100644 --- a/Evergreen/src/extras/import/pines_libs.txt +++ b/Evergreen/src/extras/import/pines_libs.txt @@ -54,14 +54,14 @@ ECGR-BKM Bookmobile East Central Georgia Regional Library ECGR-BURKE Burke County Library East Central Georgia Regional Library ECGR-EUCHE Euchee Creek Library East Central Georgia Regional Library ECGR-FRMAN Friedman Branch Library East Central Georgia Regional Library -ECGR-GIBBS Columbia County Libraries/Gibbs Memorial East Central Georgia Regional Library +ECGR-GIBBS Gibbs Memorial East Central Georgia Regional Library ECGR-GLSCK Glascock County Library East Central Georgia Regional Library ECGR-HARLM Harlem Branch Library East Central Georgia Regional Library ECGR-LINCN Lincoln County Library East Central Georgia Regional Library ECGR-MAIN Augusta-Richmond County Public Library East Central Georgia Regional Library ECGR-MIDVL Midville Branch Library East Central Georgia Regional Library ECGR-MXWLL Maxwell Branch Library East Central Georgia Regional Library -ECGR-SOAUG South Augusta Branch Library/ Diamond Lakes Branch Library East Central Georgia Regional Library +ECGR-SOAUG Diamond Lakes Branch Library East Central Georgia Regional Library ECGR-SRDIS Sardis Branch Library East Central Georgia Regional Library ECGR-WALLC Wallace Branch Library East Central Georgia Regional Library ECGR-WARRN Warren County Library East Central Georgia Regional Library @@ -135,9 +135,9 @@ MRLS-UCPL Union County Public Library Mountain Regional Library NCLS-COVTN Newton County Library Headqtrs. Newton County Library System NEG-BKMB Bookmobile--See Clarkesville-Habersham Co. Northeast Georgia Regional Library NEG-CLRKVL Clarkesville-Habersham County Library Northeast Georgia Regional Library -NEG-CLVLND "White County Library, Cleveland Branch" Northeast Georgia Regional Library +NEG-CLVLND White County Library, Cleveland Branch Northeast Georgia Regional Library NEG-CORNEL Cornelia-Habersham Library Northeast Georgia Regional Library -NEG-HELEN "White County Library, Helen Branch" Northeast Georgia Regional Library +NEG-HELEN White County Library, Helen Branch Northeast Georgia Regional Library NEG-RABUN Rabun County Library Northeast Georgia Regional Library NEG-TOCCOA Toccoa-Stephens County Library Northeast Georgia Regional Library OCRL-DUBLN Oconee Regional Library Oconee Regional Library diff --git a/Open-ILS/src/extras/import/build-oils-db.sh b/Open-ILS/src/extras/import/build-oils-db.sh index c4f291ad2a..844f5b3a03 100755 --- a/Open-ILS/src/extras/import/build-oils-db.sh +++ b/Open-ILS/src/extras/import/build-oils-db.sh @@ -9,8 +9,8 @@ PWD=`pwd` WD=`dirname $0` ( - echo "cd $PWD/$WD/../../sql/$2/;" - cd $PWD/$WD/../../sql/$2/; + echo "cd $WD/../../sql/$2/;" + cd $WD/../../sql/$2/; pwd ./build-db-$2.sh $1 $3 $4 ) diff --git a/Open-ILS/src/extras/import/cleanse-usmarc.sh b/Open-ILS/src/extras/import/cleanse-usmarc.sh index 1ab608f499..631901b42d 100755 --- a/Open-ILS/src/extras/import/cleanse-usmarc.sh +++ b/Open-ILS/src/extras/import/cleanse-usmarc.sh @@ -1,6 +1,6 @@ #!/bin/bash -DUMPER=../marcdumper/marcdumper +DUMPER=/home/miker/cvs/ILS/Open-ILS/src/extras/import/../marcdumper/marcdumper $DUMPER -X -f MARC8 -t UTF8 -r '/*/*[@tag="999"]' $* diff --git a/Open-ILS/src/extras/import/extract-holdings.sh b/Open-ILS/src/extras/import/extract-holdings.sh index 09204db472..d270748ba2 100755 --- a/Open-ILS/src/extras/import/extract-holdings.sh +++ b/Open-ILS/src/extras/import/extract-holdings.sh @@ -1,6 +1,6 @@ #!/bin/bash -DUMPER=../marcdumper/marcdumper +DUMPER=/home/miker/cvs/ILS/Open-ILS/src/extras/import/../marcdumper/marcdumper $DUMPER -X -f MARC8 -t UTF8 -r '/*/*[(local-name()="datafield" and (@tag!="035" and @tag!="999")) or local-name()!="datafield"]' $* diff --git a/Open-ILS/src/extras/import/generate-srfsh-wormer.pl b/Open-ILS/src/extras/import/generate-srfsh-wormer.pl index e3d4120e2d..16f76b7b7a 100755 --- a/Open-ILS/src/extras/import/generate-srfsh-wormer.pl +++ b/Open-ILS/src/extras/import/generate-srfsh-wormer.pl @@ -20,7 +20,7 @@ for my $i ( $start .. $stop ) { push @list, $i; next; } - print SFSH "request open-ils.storage open-ils.worm.wormize.batch ".join(',', @list)."\n" if (@list); + print SFSH "request open-ils.storage open-ils.worm.wormize.no_map.batch ".join(',', @list)."\n" if (@list); @list = ($i); } -print SFSH "request open-ils.storage open-ils.worm.wormize.batch ".join(',', @list)."\n" if (@list); +print SFSH "request open-ils.storage open-ils.worm.wormize.no_map.no_map.batch ".join(',', @list)."\n" if (@list); diff --git a/Open-ILS/src/sql/Postgres/build-db-Postgres.sh b/Open-ILS/src/sql/Postgres/build-db-Postgres.sh index 74a63f9072..1bd2daf4d7 100755 --- a/Open-ILS/src/sql/Postgres/build-db-Postgres.sh +++ b/Open-ILS/src/sql/Postgres/build-db-Postgres.sh @@ -9,5 +9,5 @@ psql -U $1 -d $2 -f 040.schema.asset.sql psql -U $1 -d $2 -f 080.schema.money.sql psql -U $1 -d $2 -f 090.schema.action.sql -psql -U $1 -d $2 -f 800.fkeys.sql -psql -U $1 -d $2 -f 900.audit-tables.sql +#psql -U $1 -d $2 -f 800.fkeys.sql +#psql -U $1 -d $2 -f 900.audit-tables.sql -- 2.11.0