[open-ils-commits] r15341 - in trunk: . Open-ILS/src Open-ILS/src/extras (dbs)
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue Jan 19 14:34:50 EST 2010
Author: dbs
Date: 2010-01-19 14:34:46 -0500 (Tue, 19 Jan 2010)
New Revision: 15341
Added:
trunk/Open-ILS/src/extras/fast-extract.in
Removed:
trunk/Open-ILS/src/extras/fast-extract
Modified:
trunk/Open-ILS/src/Makefile.am
trunk/Open-ILS/src/extras/
trunk/configure.ac
Log:
Substitute configure variables appropriately in fast-extract
Modified: trunk/Open-ILS/src/Makefile.am
===================================================================
--- trunk/Open-ILS/src/Makefile.am 2010-01-19 17:02:13 UTC (rev 15340)
+++ trunk/Open-ILS/src/Makefile.am 2010-01-19 19:34:46 UTC (rev 15341)
@@ -75,7 +75,6 @@
$(supportscr)/long-overdue-status-update.pl \
$(supportscr)/action_trigger_runner.pl \
$(srcdir)/extras/openurl_map.pl \
- $(srcdir)/extras/fast-extract \
$(srcdir)/extras/import/marc_add_ids
installautojs = $(autojsbinscripts)
@@ -135,7 +134,7 @@
OILSJAVA_DIR = java
endif
-bin_SCRIPTS = $(core_scripts) $(reporter_scripts) $(installautojs) @srcdir@/extras/eg_config
+bin_SCRIPTS = $(core_scripts) $(reporter_scripts) $(installautojs) @srcdir@/extras/eg_config @srcdir@/extras/fast-extract
data_DATA = $(core_data) $(reporter_data)
# Take care of which subdirectories to build, and which extra files to include in a distribution.
Property changes on: trunk/Open-ILS/src/extras
___________________________________________________________________
Name: svn:ignore
- .deps
.libs
eg_config
Makefile
Makefile.in
oils_requestor
+ .deps
.libs
eg_config
fast_extract
Makefile
Makefile.in
oils_requestor
Deleted: trunk/Open-ILS/src/extras/fast-extract
===================================================================
--- trunk/Open-ILS/src/extras/fast-extract 2010-01-19 17:02:13 UTC (rev 15340)
+++ trunk/Open-ILS/src/extras/fast-extract 2010-01-19 19:34:46 UTC (rev 15341)
@@ -1,71 +0,0 @@
-#!/usr/bin/perl
-# vim:ts=4:noet:
-
-use strict;
-use DBI;
-use FileHandle;
-use Getopt::Long;
-use OpenSRF::EX qw/:try/;
-use OpenSRF::Utils::Logger qw/$logger/;
-use OpenSRF::System;
-use OpenSRF::AppSession;
-use OpenSRF::Utils::SettingsClient;
-
-use open ':utf8';
-
-binmode(STDIN, ':utf8');
-binmode(STDOUT, ':utf8');
-
-$| = 1;
-
-my ($config, $delim, $after,$deleted) = ('SYSCONFDIR/opensrf_core.xml', ' | ');
-
-GetOptions(
- "after=s" => \$after,
- "bootstrap=s" => \$config,
- "delimiter=s" => \$delim,
- "include-deleted" => \$deleted,
-);
-
-OpenSRF::System->bootstrap_client( config_file => $config );
-
-# XXX Get this stuff from the settings server
-my $sc = OpenSRF::Utils::SettingsClient->new;
-my $db_driver = $sc->config_value( reporter => setup => database => 'driver' );
-my $db_host = $sc->config_value( reporter => setup => database => 'host' );
-my $db_port = $sc->config_value( reporter => setup => database => 'port' );
-my $db_name = $sc->config_value( reporter => setup => database => 'db' );
-if (!$db_name) {
- $db_name = $sc->config_value( reporter => setup => database => 'name' );
- print STDERR "WARN: <database><name> is a deprecated setting for database name. For future compatibility, you should use <database><db> instead." if $db_name;
-}
-my $db_user = $sc->config_value( reporter => setup => database => 'user' );
-my $db_pw = $sc->config_value( reporter => setup => database => 'pw' );
-
-die "Unable to retrieve database connection information from the settings server" unless ($db_driver && $db_host && $db_port && $db_name && $db_user);
-
-my $dsn = "dbi:" . $db_driver . ":dbname=" . $db_name .';host=' . $db_host . ';port=' . $db_port;
-
-my $dbh = DBI->connect($dsn,$db_user,$db_pw, {AutoCommit => 1, pg_enable_utf8 => 1, RaiseError => 1});
-
-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);
-
-$SQL = <<'SQL';
-SELECT id,
- tcn_source,
- tcn_value,
- deleted,
- REGEXP_REPLACE(marc, E'\\n','','g') AS marc
- FROM biblio.record_entry
- WHERE id = ?
-SQL
-
-for my $id ( @$ids ) {
- my $row = $dbh->selectrow_hashref( $SQL, {}, $id );
- print "$$row{deleted}$delim$$row{id}$delim$$row{tcn_source}$delim$$row{tcn_value}$delim$$row{marc}\n";
-}
-
Copied: trunk/Open-ILS/src/extras/fast-extract.in (from rev 15338, trunk/Open-ILS/src/extras/fast-extract)
===================================================================
--- trunk/Open-ILS/src/extras/fast-extract.in (rev 0)
+++ trunk/Open-ILS/src/extras/fast-extract.in 2010-01-19 19:34:46 UTC (rev 15341)
@@ -0,0 +1,71 @@
+#!/usr/bin/perl
+# vim:ts=4:noet:
+
+use strict;
+use DBI;
+use FileHandle;
+use Getopt::Long;
+use OpenSRF::EX qw/:try/;
+use OpenSRF::Utils::Logger qw/$logger/;
+use OpenSRF::System;
+use OpenSRF::AppSession;
+use OpenSRF::Utils::SettingsClient;
+
+use open ':utf8';
+
+binmode(STDIN, ':utf8');
+binmode(STDOUT, ':utf8');
+
+$| = 1;
+
+my ($config, $delim, $after,$deleted) = ('@sysconfdir@/opensrf_core.xml', ' | ');
+
+GetOptions(
+ "after=s" => \$after,
+ "bootstrap=s" => \$config,
+ "delimiter=s" => \$delim,
+ "include-deleted" => \$deleted,
+);
+
+OpenSRF::System->bootstrap_client( config_file => $config );
+
+# XXX Get this stuff from the settings server
+my $sc = OpenSRF::Utils::SettingsClient->new;
+my $db_driver = $sc->config_value( reporter => setup => database => 'driver' );
+my $db_host = $sc->config_value( reporter => setup => database => 'host' );
+my $db_port = $sc->config_value( reporter => setup => database => 'port' );
+my $db_name = $sc->config_value( reporter => setup => database => 'db' );
+if (!$db_name) {
+ $db_name = $sc->config_value( reporter => setup => database => 'name' );
+ print STDERR "WARN: <database><name> is a deprecated setting for database name. For future compatibility, you should use <database><db> instead." if $db_name;
+}
+my $db_user = $sc->config_value( reporter => setup => database => 'user' );
+my $db_pw = $sc->config_value( reporter => setup => database => 'pw' );
+
+die "Unable to retrieve database connection information from the settings server" unless ($db_driver && $db_host && $db_port && $db_name && $db_user);
+
+my $dsn = "dbi:" . $db_driver . ":dbname=" . $db_name .';host=' . $db_host . ';port=' . $db_port;
+
+my $dbh = DBI->connect($dsn,$db_user,$db_pw, {AutoCommit => 1, pg_enable_utf8 => 1, RaiseError => 1});
+
+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);
+
+$SQL = <<'SQL';
+SELECT id,
+ tcn_source,
+ tcn_value,
+ deleted,
+ REGEXP_REPLACE(marc, E'\\n','','g') AS marc
+ FROM biblio.record_entry
+ WHERE id = ?
+SQL
+
+for my $id ( @$ids ) {
+ my $row = $dbh->selectrow_hashref( $SQL, {}, $id );
+ print "$$row{deleted}$delim$$row{id}$delim$$row{tcn_source}$delim$$row{tcn_value}$delim$$row{marc}\n";
+}
+
Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac 2010-01-19 17:02:13 UTC (rev 15340)
+++ trunk/configure.ac 2010-01-19 19:34:46 UTC (rev 15341)
@@ -322,7 +322,12 @@
Open-ILS/src/Makefile
Open-ILS/web/Makefile
Open-ILS/xul/staff_client/Makefile
- Open-ILS/src/extras/eg_config], [if test -e "./Open-ILS/src/extras/eg_config"; then chmod 755 Open-ILS/src/extras/eg_config; fi])
+ Open-ILS/src/extras/eg_config
+ Open-ILS/src/extras/fast-extract],
+ [
+ if test -e "./Open-ILS/src/extras/eg_config"; then chmod 755 Open-ILS/src/extras/eg_config; fi;
+ if test -e "./Open-ILS/src/extras/fast-extract"; then chmod 755 Open-ILS/src/extras/fast-extract; fi;
+ ])
AC_OUTPUT
#-------------------------------------------------
More information about the open-ils-commits
mailing list