[open-ils-commits] r12014 - in trunk/Open-ILS/src/extras: . import
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu Jan 29 15:02:20 EST 2009
Author: miker
Date: 2009-01-29 15:02:17 -0500 (Thu, 29 Jan 2009)
New Revision: 12014
Modified:
trunk/Open-ILS/src/extras/fast-extract
trunk/Open-ILS/src/extras/import/marc_add_ids
Log:
output the deleted column from fast-extract; use said column in marc_add_ids
Modified: trunk/Open-ILS/src/extras/fast-extract
===================================================================
--- trunk/Open-ILS/src/extras/fast-extract 2009-01-29 19:13:03 UTC (rev 12013)
+++ trunk/Open-ILS/src/extras/fast-extract 2009-01-29 20:02:17 UTC (rev 12014)
@@ -18,12 +18,13 @@
$| = 1;
-my ($config, $delim, $after) = ('SYSCONFDIR/opensrf_core.xml', ' | ');
+my ($config, $delim, $after,$deleted) = ('SYSCONFDIR/opensrf_core.xml', ' | ');
GetOptions(
"after=s" => \$after,
"boostrap=s" => \$config,
"delimiter=s" => \$delim,
+ "include-deleted" => \$deleted,
);
OpenSRF::System->bootstrap_client( config_file => $config );
@@ -49,6 +50,7 @@
my $SQL = 'SELECT id FROM biblio.record_entry WHERE id > 0';
$SQL .= " AND edit_date > '$after'" if ($after);
+$SQL .= " AND deleted IS FALSE" if (!$deleted);
my $ids = $dbh->selectcol_arrayref($SQL);
@@ -63,6 +65,6 @@
for my $id ( @$ids ) {
my $row = $dbh->selectrow_hashref( $SQL, {}, $id );
- print "$$row{id}$delim$$row{tnc_source}$delim$$row{tcn_value}$delim$$row{marc}\n";
+ print "$$row{deleted}$delim$$row{id}$delim$$row{tnc_source}$delim$$row{tcn_value}$delim$$row{marc}\n";
}
Modified: trunk/Open-ILS/src/extras/import/marc_add_ids
===================================================================
--- trunk/Open-ILS/src/extras/import/marc_add_ids 2009-01-29 19:13:03 UTC (rev 12013)
+++ trunk/Open-ILS/src/extras/import/marc_add_ids 2009-01-29 20:02:17 UTC (rev 12014)
@@ -48,6 +48,7 @@
($partlist{tcn_value} = $values[ $partmap{tcn_value}]) =~ s/^\s*//o if ($part eq 'tcn_value');
($partlist{tcn_source} = $values[ $partmap{tcn_source}]) =~ s/^\s*//o if ($part eq 'tcn_source');
($partlist{id} = $values[ $partmap{id}]) =~ s/^\s*//o if ($part eq 'id');
+ ($partlist{deleted} = $values[ $partmap{deleted}]) =~ s/^\s*//o if ($part eq 'deleted');
$partlist{marc} = $values[ $partmap{marc}] if ($part eq 'marc');
$partlist{tcn_value} =~ s/\s*$//o if ($part eq 'tcn_value');
@@ -88,7 +89,7 @@
}
}
- if ($set_as_deleted) {
+ if ($set_as_deleted && $partlist{deleted} eq 't') {
my $leader = $r->leader();
if (length($leader)>4) {
substr($leader,5,1,"d");
More information about the open-ils-commits
mailing list