r800@llin: dpavlin | 2006-07-04 13:11:42 +0200
authorDobrica Pavlinusic <dpavlin@rot13.org>
Tue, 4 Jul 2006 11:36:03 +0000 (11:36 +0000)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Tue, 4 Jul 2006 11:36:03 +0000 (11:36 +0000)
 marc_duplicate now creates duplicate MARC records

git-svn-id: svn+ssh://mjesec/home/dpavlin/svn/webpac2/trunk@580 07558da8-63fa-0310-ba24-9fe276d99e06

conf/normalize/mapping.pl
run.pl

index 2da0327..3a0d9fb 100644 (file)
@@ -229,6 +229,8 @@ if ( rec('230') ) {
 
 marc_duplicate();
 
+marc_remove('245');
+
 marc('245','a',
        rec('230','a')
 );
diff --git a/run.pl b/run.pl
index 6fca96e..923419d 100755 (executable)
--- a/run.pl
+++ b/run.pl
@@ -314,12 +314,21 @@ while (my ($database, $db_config) = each %{ $config->{databases} }) {
                                        type => $config->{$use_indexer}->{type},
                                ) if ($indexer && $ds);
 
-                               $marc->add(
-                                       id => $mfn,
-                                       fields => [ WebPAC::Normalize::_get_marc_fields() ],
-                                       leader => WebPAC::Normalize::marc_leader(),
-                                       row => $row,
-                               ) if ($marc);
+                               if ($marc) {
+                                       my $i = 0;
+
+                                       while (my $fields = WebPAC::Normalize::_get_marc_fields( fetch_next => 1 ) ) {
+                                               $marc->add(
+                                                       id => $mfn . ( $i ? "/$i" : '' ),
+                                                       fields => $fields,
+                                                       leader => WebPAC::Normalize::marc_leader(),
+                                                       row => $row,
+                                               );
+                                               $i++;
+                                       }
+
+                                       $log->info("Created $i instances of MFN $mfn\n") if ($i > 1);
+                               }
 
                                $total_rows++;
                        }