From: Peter Rabbitson Date: Sun, 18 Jan 2015 22:22:39 +0000 (+0100) Subject: Minor streamline of optdeps usage (no functional changes) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c9a26f7462ed569adb136f731edae492b5961807;p=dbsrgits%2FDBIx-Class-Historic.git Minor streamline of optdeps usage (no functional changes) --- diff --git a/Makefile.PL b/Makefile.PL index b3ac93a..08a48fa 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -109,9 +109,9 @@ my $test_requires = { if ($ENV{DBICTEST_SQLT_DEPLOY}) { local @INC = ('lib', @INC); require DBIx::Class::Optional::Dependencies; - my $dep_req = DBIx::Class::Optional::Dependencies->req_list_for('deploy'); - for (keys %$dep_req) { - test_requires ($_ => $dep_req->{$_}) + my $deploy_req = DBIx::Class::Optional::Dependencies->req_list_for('deploy'); + for (keys %$deploy_req) { + test_requires ($_ => $deploy_req->{$_}) } } diff --git a/script/dbicadmin b/script/dbicadmin index e6066fb..bdd618c 100755 --- a/script/dbicadmin +++ b/script/dbicadmin @@ -4,11 +4,10 @@ use strict; use warnings; BEGIN { - use DBIx::Class; - die ( 'The following modules are required for the dbicadmin utility: ' - . DBIx::Class::Optional::Dependencies->req_missing_for ('admin_script') - . "\n" - ) unless DBIx::Class::Optional::Dependencies->req_ok_for ('admin_script'); + require DBIx::Class::Optional::Dependencies; + if (my $missing = DBIx::Class::Optional::Dependencies->req_missing_for ('admin_script') ) { + die "The following modules are required for the dbicadmin utility: $missing\n"; + } } use DBIx::Class::Admin::Descriptive;