[open-ils-commits] r8830 - trunk/Open-ILS/src/extras/import
svn at svn.open-ils.org
svn at svn.open-ils.org
Fri Feb 22 21:05:34 EST 2008
Author: dbs
Date: 2008-02-22 20:34:49 -0500 (Fri, 22 Feb 2008)
New Revision: 8830
Modified:
trunk/Open-ILS/src/extras/import/marc2bre.pl
Log:
And check for duplicate IDs in the main loop, just like miker asked
Modified: trunk/Open-ILS/src/extras/import/marc2bre.pl
===================================================================
--- trunk/Open-ILS/src/extras/import/marc2bre.pl 2008-02-23 00:32:45 UTC (rev 8829)
+++ trunk/Open-ILS/src/extras/import/marc2bre.pl 2008-02-23 01:34:49 UTC (rev 8830)
@@ -149,6 +149,7 @@
$id =~ s/\D+//gso;
}
+ $id = '' if (exists $dontuse_id{$id});
}
if (!$id) {
@@ -168,7 +169,7 @@
my $tcn;
($rec, $tcn) = preprocess($rec, $id);
- $tcn->add_subfields(c => $id);
+ $tcn->add_subfields(c => $id);
$rec->delete_field( $_ ) for ($rec->field($id_field));
$rec->append_fields( $tcn );
@@ -214,12 +215,14 @@
my $rec = shift;
my $id = shift;
- my ($source, $value) = ('','','');
+ my ($source, $value) = ('','');
+ $id = '' if (exists $dontuse_id{$id});
+
if (!$id) {
my $f = $rec->field('001');
$id = $f->data if ($f);
- $id = '' if (exists $dontuse_id{$id});
+ $id = '' if (exists $dontuse_id{$id});
}
if (!$id || exists $dontuse_id{$source.$id}) {
More information about the open-ils-commits
mailing list