From: Shawn Boyette Date: Wed, 24 Jun 2009 19:20:19 +0000 (+0000) Subject: tweaks X-Git-Url: http://git.equinoxoli.org/?p=migration-tools.git;a=commitdiff_plain;h=3bd5dd6ddf3857cf8c54cfe10df9fef27e2478d0 tweaks --- diff --git a/Equinox-Migration/lib/Equinox/Migration/MapDrivenMARCXMLProc.pm b/Equinox-Migration/lib/Equinox/Migration/MapDrivenMARCXMLProc.pm index 2e4a455..194a593 100644 --- a/Equinox-Migration/lib/Equinox/Migration/MapDrivenMARCXMLProc.pm +++ b/Equinox-Migration/lib/Equinox/Migration/MapDrivenMARCXMLProc.pm @@ -66,7 +66,8 @@ sub new { die "Datastore file 'EMMXSSTORAGE.dbmd' already exists. Exiting.\n" if (-e "EMMXSSTORAGE.dbmd"); $dstore = DBM::Deep->new( file => "EMMXSSTORAGE.dbmd", - data_sector_size => 256, + max_buckets => 64, + #data_sector_size => 256, autoflush => 0, ); $reccount = 0; # next record ptr diff --git a/extract_holdings b/extract_holdings index 78fbde5..fadcf8d 100755 --- a/extract_holdings +++ b/extract_holdings @@ -49,10 +49,13 @@ sub extract_holdings { while ( $m->{data}{recs}[$i] ) { print HOLDINGS "BEGIN;\n\negid\thseq\t" unless $j; my $rec = $m->{data}{recs}[$i]; + my $k = 0; # holding-within-record pointer # for each holdings tag in the record... - for my $holdidx ( @{$rec->{tmap}{ $c->{holdings} }} ) { + while ( $rec->{tmap}{ $c->{holdings} }[$k] ) { + my $holdidx = $rec->{tmap}{ $c->{holdings} }[$k]; my $tagid = $rec->{tags}[$holdidx]{tag}; + $k++; my @out = (); # clear the output buffer push @out, $rec->{egid}; # slug in the egid first thing @@ -79,8 +82,7 @@ sub extract_holdings { my $idx = $rec->{tmap}{$othertag}[0]; # get index into tags struct for my $sub ( sort keys %{$rec->{tags}[$idx]{uni}} ) { push @out, $rec->{tags}[$idx]{uni}{$sub}; - print "l_", $m->name($rec->{tags}[$idx]{tag}, $sub), "\t" - unless $j; + print "l_", $m->name($rec->{tags}[$idx]{tag}, $sub), "\t" unless $j; } } @@ -89,6 +91,8 @@ sub extract_holdings { print HOLDINGS join("\t", @out); print HOLDINGS "\n"; $j++; + + @out = undef; } $i++; print "\r$i";