[libcatmandu-marc-perl] 11/26: Fixing ^ to space conversions in ALEPHSEQ imports

Jonas Smedegaard dr at jones.dk
Tue Dec 19 12:17:04 UTC 2017


This is an automated email from the git hooks/post-receive script.

js pushed a commit to annotated tag upstream/1.23.1
in repository libcatmandu-marc-perl.

commit e007d14e1fa4287cea019cb8a8797ace70fbc24a
Author: Patrick Hochstenbach <patrick.hochstenbach at ugent.be>
Date:   Mon Nov 13 14:19:43 2017 +0100

    Fixing ^ to space conversions in ALEPHSEQ imports
---
 Changes                                | 1 +
 lib/Catmandu/Importer/MARC/ALEPHSEQ.pm | 2 +-
 t/Catmandu/Exporter/MARC/ALEPHSEQ.t    | 2 ++
 t/Catmandu/Exporter/MARC/ISO.t         | 3 ++-
 t/Catmandu/Importer/MARC/ALEPHSEQ.t    | 2 ++
 t/rug01.aleph                          | 1 +
 6 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/Changes b/Changes
index c9b3ee6..057fcdb 100644
--- a/Changes
+++ b/Changes
@@ -1,6 +1,7 @@
 Revision history for Catmandu-MARC
 
 {{$NEXT}}
+  - Fixing ^ to space conversion in ALEPHSEQ imports
 
 1.20  2017-11-08 10:29:27 CET
   - More stable ISO exports for bad records
diff --git a/lib/Catmandu/Importer/MARC/ALEPHSEQ.pm b/lib/Catmandu/Importer/MARC/ALEPHSEQ.pm
index 685e53d..6ccd5b2 100644
--- a/lib/Catmandu/Importer/MARC/ALEPHSEQ.pm
+++ b/lib/Catmandu/Importer/MARC/ALEPHSEQ.pm
@@ -95,7 +95,7 @@ sub generator {
                warn "skipping $sysid $tag unknown data";
                next;
            }
-           if ($tag eq 'LDR') {
+           if ($tag eq 'LDR' || $tag eq '008') {
                $data =~ s/\^/ /g;
            }
            my @parts = ('_' , split(/\$\$(.)/, $data) );
diff --git a/t/Catmandu/Exporter/MARC/ALEPHSEQ.t b/t/Catmandu/Exporter/MARC/ALEPHSEQ.t
index 6bd575e..5dae325 100644
--- a/t/Catmandu/Exporter/MARC/ALEPHSEQ.t
+++ b/t/Catmandu/Exporter/MARC/ALEPHSEQ.t
@@ -26,6 +26,7 @@ note("catmandu marc export");
           [ 'FMT', ' ', ' ' , '_', 'BK' ] ,
           [ 'LDR', ' ', ' ' , '_', '00000nam a2200301 i 4500' ] ,
           [ '001', ' ', ' ' , '_', '000000002' ] ,
+          [ '008', ' ', ' ' , '_', '050601s1921    xx |||||||||||||| ||dut  ' ],
           [ '245', '1', '0' , 'a', 'Catmandu Test' ] ,
           [ '650', ' ', '0' , 'a', 'Perl' ] ,
           [ '650', ' ', '0' , 'a', 'MARC' , 'a' , 'MARC2' ] ,
@@ -37,6 +38,7 @@ note("catmandu marc export");
 000000002 FMT   L BK
 000000002 LDR   L 00000nam^a2200301^i^4500
 000000002 001   L 000000002
+000000002 008   L 050601s1921^^^^xx^||||||||||||||^||dut^^
 000000002 24510 L $$aCatmandu Test
 000000002 650 0 L $$aPerl
 000000002 650 0 L $$aMARC$$aMARC2
diff --git a/t/Catmandu/Exporter/MARC/ISO.t b/t/Catmandu/Exporter/MARC/ISO.t
index 441f2e7..3be6cc1 100644
--- a/t/Catmandu/Exporter/MARC/ISO.t
+++ b/t/Catmandu/Exporter/MARC/ISO.t
@@ -22,8 +22,9 @@ my $marciso = undef;
 my $record = {
     _id => '000000002',
     record => [
-      [ 'LDR', ' ', ' ' , '_', '00156nam a2200085 i 4500' ] ,
+      [ 'LDR', ' ', ' ' , '_', '00209nam a2200097 i 4500' ] ,
       [ '001', ' ', ' ' , '_', '000000002' ] ,
+      [ '008', ' ', ' ' , '_', '050601s1921    xx |||||||||||||| ||dut  ' ],
       [ '245', '1', '0' , 'a', 'Catmandu Test' ] ,
       [ '650', ' ', '0' , 'a', 'Perl' ] ,
       [ '650', ' ', '0' , 'a', 'MARC' , 'a' , 'MARC2' ] ,
diff --git a/t/Catmandu/Importer/MARC/ALEPHSEQ.t b/t/Catmandu/Importer/MARC/ALEPHSEQ.t
index 767ebdb..8d6c172 100644
--- a/t/Catmandu/Importer/MARC/ALEPHSEQ.t
+++ b/t/Catmandu/Importer/MARC/ALEPHSEQ.t
@@ -20,6 +20,7 @@ my $record =<<'EOF';
 000000002 FMT   L BK
 000000002 LDR   L 00000nam^a2200301^i^4500
 000000002 001   L 000000002
+000000002 008   L 050601s1921^^^^xx^||||||||||||||^||dut^^
 000000002 24510 L $$aCatmandu Test
 000000002 650 0 L $$aPerl
 000000002 650 0 L $$aMARC$$aMARC2
@@ -32,6 +33,7 @@ my $expected = {
       [ 'FMT', ' ', ' ' , '_', 'BK' ] ,
       [ 'LDR', ' ', ' ' , '_', '00000nam a2200301 i 4500' ] ,
       [ '001', ' ', ' ' , '_', '000000002' ] ,
+      [ '008', ' ', ' ' , '_', '050601s1921    xx |||||||||||||| ||dut  ' ],
       [ '245', '1', '0' , 'a', 'Catmandu Test' ] ,
       [ '650', ' ', '0' , 'a', 'Perl' ] ,
       [ '650', ' ', '0' , 'a', 'MARC' , 'a' , 'MARC2' ] ,
diff --git a/t/rug01.aleph b/t/rug01.aleph
index 409a9c5..7e7d025 100644
--- a/t/rug01.aleph
+++ b/t/rug01.aleph
@@ -1,6 +1,7 @@
 000000002 FMT   L BK
 000000002 LDR   L 00000nam^a2200301^i^4500
 000000002 001   L 000000002
+000000002 008   L 050601s1921^^^^xx^||||||||||||||^||dut^^
 000000002 24510 L $$aCatmandu Test
 000000002 650 0 L $$aPerl
 000000002 650 0 L $$aMARC$$aMARC2

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libcatmandu-marc-perl.git



More information about the Pkg-perl-cvs-commits mailing list