From 3014d0282b0edbe12f9b1ee797a3972095c62b82 Mon Sep 17 00:00:00 2001 From: miker Date: Fri, 4 Nov 2005 21:33:33 +0000 Subject: [PATCH] fixing up the import process -- using the perl dumper git-svn-id: svn://svn.open-ils.org/ILS/trunk@1962 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Evergreen/src/extras/import/import_holdings.pl | 3 ++- Open-ILS/src/extras/import/cleanse-usmarc.sh | 4 ++-- Open-ILS/src/extras/import/extract-holdings.sh | 4 ++-- Open-ILS/src/extras/import/marcFilterDump.pl | 6 +++--- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Evergreen/src/extras/import/import_holdings.pl b/Evergreen/src/extras/import/import_holdings.pl index da52f671a8..9428d7b38f 100755 --- a/Evergreen/src/extras/import/import_holdings.pl +++ b/Evergreen/src/extras/import/import_holdings.pl @@ -117,7 +117,7 @@ while ( $xml .= ) { my $success = 0; try { $doc = $parser->parse_string($xml);; - $tcn = $doc->documentElement->findvalue( '/*/*[@tag="035"][1]' ); + $tcn = $doc->documentElement->findvalue( '//*[@tag="035"][1]' ); $success = 1; } catch Error with { my $e = shift; @@ -133,6 +133,7 @@ while ( $xml .= ) { $xml = ''; next; } + $tcn = "_$tcn"; unless (exists($$tcn_map{$tcn})) { warn "\n !! TCN $tcn not in the map!\n"; diff --git a/Open-ILS/src/extras/import/cleanse-usmarc.sh b/Open-ILS/src/extras/import/cleanse-usmarc.sh index 631901b42d..f6c4a49538 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=/home/miker/cvs/ILS/Open-ILS/src/extras/import/../marcdumper/marcdumper +DUMPER=/home/miker/cvs/ILS/Open-ILS/src/extras/import/marcFilterDump.pl -$DUMPER -X -f MARC8 -t UTF8 -r '/*/*[@tag="999"]' $* +$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 d270748ba2..b96dd2e58c 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=/home/miker/cvs/ILS/Open-ILS/src/extras/import/../marcdumper/marcdumper +DUMPER=/home/miker/cvs/ILS/Open-ILS/src/extras/import/marcFilterDump.pl -$DUMPER -X -f MARC8 -t UTF8 -r '/*/*[(local-name()="datafield" and (@tag!="035" and @tag!="999")) or local-name()!="datafield"]' $* +$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/marcFilterDump.pl b/Open-ILS/src/extras/import/marcFilterDump.pl index ab138a651f..0ac05ac3ee 100755 --- a/Open-ILS/src/extras/import/marcFilterDump.pl +++ b/Open-ILS/src/extras/import/marcFilterDump.pl @@ -58,9 +58,9 @@ while ($marc) { } my $string = $doc->toStringC14N; - $string =~ s/>\n\s*\s+