[open-ils-commits] [GIT] Evergreen ILS branch master updated. a9d80dc4111a760bfb9d8cb94876a41ec40cb0d9

Evergreen Git git at git.evergreen-ils.org
Wed Nov 4 16:47:24 EST 2015


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  a9d80dc4111a760bfb9d8cb94876a41ec40cb0d9 (commit)
       via  cf4410e4e6678e374ef716f708d6b6ac3567d0ab (commit)
      from  ab512d7bf135ebdf7888217bf5b04377398f00ec (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit a9d80dc4111a760bfb9d8cb94876a41ec40cb0d9
Author: Galen Charlton <gmc at esilibrary.com>
Date:   Wed Nov 4 21:51:02 2015 +0000

    LP#1502152: (follow-up) fix a typo
    
    Signed-off-by: Galen Charlton <gmc at esilibrary.com>

diff --git a/Open-ILS/src/support-scripts/marc_export.in b/Open-ILS/src/support-scripts/marc_export.in
index ef841e1..5b5ff9c 100755
--- a/Open-ILS/src/support-scripts/marc_export.in
+++ b/Open-ILS/src/support-scripts/marc_export.in
@@ -451,7 +451,7 @@ sub next {
                                                        $Marque::config->option_value('format'));
                 };
                 if ($@) {
-                    warn("Error in bibliograpic record " . $r->id() . ": $@");
+                    warn("Error in bibliographic record " . $r->id() . ": $@");
                     import MARC::File::XML; # Reset SAX Parser.
                     return $self->next();
                 }
@@ -527,7 +527,7 @@ sub next {
                 $output =~ s/^<\?.+?\?>$//mo;
             };
             if ($@) {
-                warn("Error in bibliograpic record " . $r->id() . ": $@");
+                warn("Error in bibliographic record " . $r->id() . ": $@");
                 return $self->next();
             }
         } else {
@@ -540,7 +540,7 @@ sub next {
                 $output = $marc->as_usmarc;
             };
             if ($@) {
-                warn("Error in bibliograpic record " . $r->id() . ": $@");
+                warn("Error in bibliographic record " . $r->id() . ": $@");
                 return $self->next();
             }
         }

commit cf4410e4e6678e374ef716f708d6b6ac3567d0ab
Author: Jason Stephenson <jstephenson at mvlc.org>
Date:   Mon Oct 5 12:35:37 2015 -0400

    LP 1502152: Improve marc_export warnings.
    
    Trap warnings from MARC libraries in marc_export so we can report the
    id of the record that triggered the warning.
    
    Use warn to print our warnings, instead of print STDERR.  This includes
    the existing errors, trapped by eval, that were being printed to STDERR.
    
    To test
    -------
    [1] Ensure that a record has an error that would become apparent
        during export.  An easy way to do this is to insert the "‡"
        character in the contents of a subfield, then use
        --encoding MARC8 when exporting the record.
    [2] Run the MARC export, e.g.,
    
        cat id_list | marc_export -i > /tmp/bibs.mrc
    [3] Verify that a warning is reported, e.g.,
    
    Warning from bibliographic record 1: no mapping found at position 0...
    
    Signed-off-by: Jason Stephenson <jstephenson at mvlc.org>
    Signed-off-by: Galen Charlton <gmc at esilibrary.com>

diff --git a/Open-ILS/src/support-scripts/marc_export.in b/Open-ILS/src/support-scripts/marc_export.in
index 70a659f..ef841e1 100755
--- a/Open-ILS/src/support-scripts/marc_export.in
+++ b/Open-ILS/src/support-scripts/marc_export.in
@@ -419,13 +419,17 @@ sub next {
     if ($Marque::config->option_value('mfhd') && $self->{mfhds} && @{$self->{mfhds}}) {
         $r = shift(@{$self->{mfhds}});
         eval {
+            local $SIG{__WARN__} = sub {
+                my $message = "Warning from serial record " . $r->id() . ": "
+                    . shift;
+                warn($message);
+            };
             $marc = MARC::Record->new_from_xml($r->marc(),
                                                $Marque::config->option_value('encoding'),
                                                $Marque::config->option_value('format'));
         };
         if ($@) {
-            print STDERR "Error in serial record " . $r->id() . "\n";
-            print STDERR "$@\n";
+            warn("Error in serial record " . $r->id() . ": $@");
             import MARC::File::XML; # Reset SAX Parser.
             return $self->next();
         }
@@ -437,13 +441,17 @@ sub next {
                 $output = OpenSRF::Utils::JSON->perl2JSON($r);
             } else {
                 eval {
+                    local $SIG{__WARN__} = sub {
+                        my $message = "Warning from bibliographic record " . $r->id() . ": "
+                            . shift;
+                        warn($message);
+                    };
                     $marc = MARC::Record->new_from_xml($r->marc(),
                                                        $Marque::config->option_value('encoding'),
                                                        $Marque::config->option_value('format'));
                 };
                 if ($@) {
-                    print STDERR "Error in bibliograpic record " . $r->id() . "\n";
-                    print STDERR "$@\n";
+                    warn("Error in bibliograpic record " . $r->id() . ": $@");
                     import MARC::File::XML; # Reset SAX Parser.
                     return $self->next();
                 }
@@ -510,21 +518,29 @@ sub next {
         }
         if ($Marque::config->option_value('format') eq 'XML') {
             eval {
+                local $SIG{__WARN__} = sub {
+                    my $message = "Warning from bibliographic record " . $r->id() . ": "
+                        . shift;
+                    warn($message);
+                };
                 $output = $marc->as_xml_record;
                 $output =~ s/^<\?.+?\?>$//mo;
             };
             if ($@) {
-                print STDERR "Error in bibliograpic record " . $r->id() . "\n";
-                print STDERR "$@\n";
+                warn("Error in bibliograpic record " . $r->id() . ": $@");
                 return $self->next();
             }
         } else {
             eval {
+                local $SIG{__WARN__} = sub {
+                    my $message = "Warning from bibliographic record " . $r->id() . ": "
+                        . shift;
+                    warn($message);
+                };
                 $output = $marc->as_usmarc;
             };
             if ($@) {
-                print STDERR "Error in bibliograpic record " . $r->id() . "\n";
-                print STDERR "$@\n";
+                warn("Error in bibliograpic record " . $r->id() . ": $@");
                 return $self->next();
             }
         }
@@ -730,13 +746,17 @@ sub next {
         } else {
             my $marc;
             eval {
+                local $SIG{__WARN__} = sub {
+                    my $message = "Warning from authority record " . $r->id() . ": "
+                        . shift;
+                    warn($message);
+                };
                 $marc = MARC::Record->new_from_xml($r->marc(),
                                                 $Marque::config->option_value('encoding'),
                                                 $Marque::config->option_value('format'));
             };
             if ($@) {
-                print STDERR "Error in authority record " . $r->id() . "\n";
-                print STDERR "$@\n";
+                warn("Error in authority record " . $r->id() . ": $@");
                 import MARC::File::XML; # Reset SAX Parser.
                 return $self->next();
             }
@@ -770,21 +790,29 @@ sub next {
             }
             if ($Marque::config->option_value('format') eq 'XML') {
                 eval {
+                    local $SIG{__WARN__} = sub {
+                        my $message = "Warning from authority record " . $r->id() . ": "
+                            . shift;
+                        warn($message);
+                    };
                     $output = $marc->as_xml_record;
                     $output =~ s/^<\?.+?\?>$//mo;
                 };
                 if ($@) {
-                    print STDERR "Error in authority record " . $r->id() . "\n";
-                    print STDERR "$@\n";
+                    warn("Error in authority record " . $r->id() . ": $@");
                     return $self->next();
                 }
             } else {
                 eval {
+                    local $SIG{__WARN__} = sub {
+                        my $message = "Warning from authority record " . $r->id() . ": "
+                            . shift;
+                        warn($message);
+                    };
                     $output = $marc->as_usmarc;
                 };
                 if ($@) {
-                    print STDERR "Error in authority record " . $r->id() . "\n";
-                    print STDERR "$@\n";
+                    warn("Error in authority record " . $r->id() . ": $@");
                     return $self->next();
                 }
             }

-----------------------------------------------------------------------

Summary of changes:
 Open-ILS/src/support-scripts/marc_export.in |   56 ++++++++++++++++++++-------
 1 files changed, 42 insertions(+), 14 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list