From 6157c1eea900d2bb90b4ffb73309890c7b9cd4c6 Mon Sep 17 00:00:00 2001 From: sboyette Date: Tue, 25 Aug 2009 15:45:01 +0000 Subject: [PATCH] removed $VERSION construct which caused undef warnings when not under svn, and only occurred in 2 modules git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1752 9efc2488-bf62-4759-914b-345cdb29e865 --- src/perl/lib/OpenSRF/Utils.pm | 49 +++++++++++++--------------- src/perl/lib/OpenSRF/Utils/Config.pm | 9 ++--- src/perl/t/09-Utils.t | 10 +----- 3 files changed, 26 insertions(+), 42 deletions(-) diff --git a/src/perl/lib/OpenSRF/Utils.pm b/src/perl/lib/OpenSRF/Utils.pm index 01ced81..d527521 100644 --- a/src/perl/lib/OpenSRF/Utils.pm +++ b/src/perl/lib/OpenSRF/Utils.pm @@ -1,51 +1,48 @@ package OpenSRF::Utils; -=head1 NAME +use Time::Local; +use Errno; +use POSIX; +use FileHandle; +use Digest::MD5 qw(md5 md5_hex md5_base64); +use Exporter; +use DateTime; +use DateTime::Format::ISO8601; +use DateTime::TimeZone; + +=head1 NAME OpenSRF::Utils -=head1 DESCRIPTION +=head1 DESCRIPTION This is a container package for methods that are useful to derived modules. It has no constructor, and is generally not useful by itself... but this is where most of the generic methods live. - - -=head1 METHODS +=head1 VERSION =cut -use vars qw/@ISA $AUTOLOAD %EXPORT_TAGS @EXPORT_OK @EXPORT $VERSION/; -push @ISA, 'Exporter'; - -$VERSION = do { my @r=(q$Revision$=~/\d+/g); sprintf "%d."."%02d"x$#r,@r }; +our $VERSION = 1.000; -use Time::Local; -use Errno; -use POSIX; -use FileHandle; -#use Cache::FileCache; -#use Storable qw(dclone); -use Digest::MD5 qw(md5 md5_hex md5_base64); -use Exporter; -use DateTime; -use DateTime::Format::ISO8601; -use DateTime::TimeZone; - -our $date_parser = DateTime::Format::ISO8601->new; - -# This turns errors into warnings, so daemons don't die. -#$Storable::forgive_me = 1; +use vars qw/@ISA $AUTOLOAD %EXPORT_TAGS @EXPORT_OK @EXPORT/; +push @ISA, 'Exporter'; %EXPORT_TAGS = ( common => [qw(interval_to_seconds seconds_to_interval sendmail tree_filter)], daemon => [qw(safe_fork set_psname daemonize)], datetime => [qw(clense_ISO8601 gmtime_ISO8601 interval_to_seconds seconds_to_interval)], ); - Exporter::export_ok_tags('common','daemon','datetime'); # add aa, cc and dd to @EXPORT_OK +our $date_parser = DateTime::Format::ISO8601->new; + +=head1 METHODS + + +=cut + sub AUTOLOAD { my $self = shift; my $type = ref($self) or return undef; diff --git a/src/perl/lib/OpenSRF/Utils/Config.pm b/src/perl/lib/OpenSRF/Utils/Config.pm index ca400f7..9ecfc0e 100755 --- a/src/perl/lib/OpenSRF/Utils/Config.pm +++ b/src/perl/lib/OpenSRF/Utils/Config.pm @@ -2,13 +2,13 @@ package OpenSRF::Utils::Config::Section; no strict 'refs'; -use vars qw/@ISA $AUTOLOAD $VERSION/; +use vars qw/@ISA $AUTOLOAD/; push @ISA, qw/OpenSRF::Utils/; use OpenSRF::Utils (':common'); use Net::Domain qw/hostfqdn/; -$VERSION = do { my @r=(q$Revision$=~/\d+/g); sprintf "%d."."%02d"x$#r,@r }; +our $VERSION = "1.000"; my %SECTIONCACHE; my %SUBSECTION_FIXUP; @@ -190,11 +190,6 @@ though. =head1 METHODS -=cut - - -$VERSION = do { my @r=(q$Revision$=~/\d+/g); sprintf "%d."."%02d"x$#r,@r }; - =head2 OpenSRF::Utils::Config->load( config_file => '/some/config/file.cnf' ) diff --git a/src/perl/t/09-Utils.t b/src/perl/t/09-Utils.t index ddbf43a..235f1c7 100644 --- a/src/perl/t/09-Utils.t +++ b/src/perl/t/09-Utils.t @@ -1,15 +1,7 @@ #!perl -T -use Test::More tests => 8; +use Test::More tests => 1; BEGIN { use_ok( 'OpenSRF::Utils' ); } - -use_ok( 'OpenSRF::Utils::Cache' ); -use_ok( 'OpenSRF::Utils::Config' ); -use_ok( 'OpenSRF::Utils::JSON' ); -use_ok( 'OpenSRF::Utils::Logger' ); -use_ok( 'OpenSRF::Utils::LogServer' ); -use_ok( 'OpenSRF::Utils::SettingsClient' ); -use_ok( 'OpenSRF::Utils::SettingsParser' ); -- 2.43.2