LP1856906: remove unused OpenILS::Utils::ISBN perl module
authorJane Sandberg <sandbej@linnbenton.edu>
Thu, 15 Jul 2021 20:58:43 +0000 (13:58 -0700)
committerGalen Charlton <gmc@equinoxOLI.org>
Thu, 11 Nov 2021 15:06:29 +0000 (10:06 -0500)
Signed-off-by: Jane Sandberg <sandbej@linnbenton.edu>
Signed-off-by: blake <blake@mobiusconsortium.org>
Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>

Open-ILS/src/perlmods/lib/OpenILS/Utils/ISBN.pm [deleted file]
Open-ILS/src/perlmods/t/14-OpenILS-Utils.t
docs/RELEASE_NOTES_NEXT/API/remove_utils_isbn.adoc [new file with mode: 0644]

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Utils/ISBN.pm b/Open-ILS/src/perlmods/lib/OpenILS/Utils/ISBN.pm
deleted file mode 100644 (file)
index 34eed66..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-package OpenILS::Utils::ISBN;
-
-# ---------------------------------------------------------------
-# Copyright (C) 2010 Equinox Software, Inc
-# Author: Joe Atzberger <jatzberger@esilibrary.com>
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-# ---------------------------------------------------------------
-
-use strict;
-use warnings;
-
-use Business::ISBN;
-
-use base qw/Exporter/;
-our $VERSION = '0.01';
-our @EXPORT_OK = qw/isbn_upconvert/;
-
-# Jason Stephenson <jstephenson@mvlc.org> at Merrimack Valley Library Consortium
-# Dan Scott <dscott@laurentian.ca> at Laurentian University
-
-sub isbn_upconvert {
-    my $in     = @_ ? shift : return;
-    my $pretty = @_ ? shift : 0;
-    $in =~ s/\s*//g;
-    $in =~ s/-//g;
-    length($in) or return;
-    my $isbn = Business::ISBN->new($in) or return;
-    $isbn->fix_checksum() if $isbn->is_valid_checksum() == Business::ISBN::BAD_CHECKSUM;
-    $isbn->is_valid() or return;
-    return $pretty ? $isbn->as_isbn13->as_string : $isbn->as_isbn13->isbn;
-}
-
-1;
-__END__
-
-For example, if you have a file isbns.txt with these lines:
-
-1598884093
- 1598884093
- 15  988  840 93     
-0446357197
-  0 446 3 5  7 1 9        7
-  0 446 3 5  7 1 9        1
-0596526857
-0786222735
-0446360015
-0446350109
-0446314129
-0439139597
-0743294394
-159143047X
-1590203097
-075480965X
-0393048799
-0446831832
-0446310069
-1598883275
-0446313033
-0446360279
-
-And you run:
-    perl -pe 'use OpenILS::Utils::ISBN qw/isbn_upconvert/; $_ = isbn_upconvert($_) . "\n";' <isbns.txt
-
-You get this output:
-9781598884098
-9781598884098
-9781598884098
-9780446357197
-9780446357197
-9780446357197
-9780596526856
-9780786222735
-9780446360012
-9780446350105
-9780446314121
-9780439139595
-9780743294393
-9781591430476
-9781590203095
-9780754809654
-9780393048797
-9780446831833
-9780446310062
-9781598883275
-9780446313032
-9780446360272
-
index 2aa2afb..d9c2119 100644 (file)
@@ -24,7 +24,6 @@ use_ok( 'OpenILS::Utils::Configure' );
 use_ok( 'OpenILS::Utils::Cronscript' );
 use_ok( 'OpenILS::Utils::CStoreEditor' );
 use_ok( 'OpenILS::Utils::Fieldmapper' );
-use_ok( 'OpenILS::Utils::ISBN' );
 use_ok( 'OpenILS::Utils::Lockfile' );
 use_ok( 'OpenILS::Utils::MFHDParser' );
 use_ok( 'OpenILS::Utils::MFHD' );
diff --git a/docs/RELEASE_NOTES_NEXT/API/remove_utils_isbn.adoc b/docs/RELEASE_NOTES_NEXT/API/remove_utils_isbn.adoc
new file mode 100644 (file)
index 0000000..23d6cd3
--- /dev/null
@@ -0,0 +1,9 @@
+== Removal of OpenILS::Utils::ISBN ==
+
+Evergreen used to include a perl module called OpenILS::Utils::ISBN.
+This module provided a single subroutine, `isbn_upconvert`, which
+wrapped some behavior from the Business::ISBN module.  The module
+is no longer used in Evergreen code.  Any custom code that used it
+should be migrated to use Business::ISBN directly.
+
+