]> git.evergreen-ils.org Git - Evergreen.git/commit
Clean up marc_export and teach it how to export (all) authority records
authordbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 4 Jan 2011 19:23:20 +0000 (19:23 +0000)
committerdbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 4 Jan 2011 19:23:20 +0000 (19:23 +0000)
commitc42668a59690699af0a72a4dc3c5e15cb12b220c
treea1a7e57931b8859ef5000ad85f3c1da1c65455cd
parentb0efbc588d502acf9f812abc80305fedc6131a5a
Clean up marc_export and teach it how to export (all) authority records

The new "--type" parameter enables users to specify "authority"
and have the expected result.

Add an "--all" option to marc_export and silence some warnings

Rather than forcing users to generate a set of record IDs using a
separate process, the --all option enables to to export all records
of the specified type. Note that the approach is basic: grab the
record with the highest ID, then start at ID 0 and count up by 1
while trying to retrieve each record along the way. While this will
undoubtedly generate plenty of warnings for deleted records or gaps
in the ID sequences, the alternative of retrieving an ID list for
potentially millions of records in large Evergreen instances wasn't
appealing.

Some other refactoring and fixes:

Three large chunks of code were factored out into subroutines to
make it a little easier to read the main flow of the code.

As we explicitly call uc() on the $format input parameter
to begin with, we don't have to call it subsequently.

If a requested ID did not exist in the database, then
the script would die; now we trap and flag that error but
continue to fulfill subsequent requests.

The --money parameter is now documented in the help, and
the help has a brief overview that describes (poorly) the
expected format for the list of IDs.

An uninitialized variable error when exporting BRE format
records was squashed.

Also, $count{did} and $count{bib} resulted in uninitialized variable
warnings if no records were actually exported, so initialize them to 0.

git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_2_0@19114 dcc99617-32d9-48b4-a31d-7c20da2025e4
Open-ILS/src/support-scripts/marc_export