From ea9a4bb420fef4b66e8b04ea8efba84b44271f1d Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Wed, 21 Apr 2010 08:17:32 +0000 Subject: [PATCH] Neues Script: check-modules.pl --- bin/check-modules.pl | 95 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100755 bin/check-modules.pl diff --git a/bin/check-modules.pl b/bin/check-modules.pl new file mode 100755 index 0000000..54b6609 --- /dev/null +++ b/bin/check-modules.pl @@ -0,0 +1,95 @@ +#!/usr/bin/perl + +# $Id$ +# $URL$ + +use strict; +use 5.8.0; +use warnings; + +use utf8; + +use Encode qw( decode_utf8 encode_utf8 ); +#use Module::CoreList; + +my @Modules = ( + 'FindBin' => undef, + 'MIME::Base64' => undef, + 'Storable' => undef, + 'Data::Dumper' => undef, + 'Catalyst::Runtime' => '5.70', + 'Catalyst::ScriptRunner' => undef, + 'Catalyst::Utils' => undef, + 'Catalyst::Plugin::ConfigLoader' => undef, + 'Catalyst::Log::Log4perl' => undef, + 'Catalyst::Plugin::Scheduler' => undef, + 'Catalyst::Plugin::Static::Simple' => undef, + 'Catalyst::Plugin::StackTrace' => undef, + 'Catalyst::Plugin::Authentication' => undef, + 'Catalyst::Plugin::Session' => undef, + 'Catalyst::Plugin::Session::Store::DBIC' => undef, + 'Catalyst::Plugin::Session::State::Cookie' => undef, + 'Catalyst::Model::DBIC::Schema' => undef, + 'Catalyst::View::TT' => undef, + 'Config::Any' => undef, + 'Cwd' => undef, + 'DBIx::Class' => undef, + 'DBIx::Class::Schema' => undef, + 'File::Spec' => undef, + 'Moose' => undef, + 'URI' => undef, + 'Config::General' => undef, + 'Config::Tiny' => undef, + 'JSON::XS' => undef, + 'XML::Simple' => undef, + 'Readonly' => undef, + 'YAML' => undef, + 'YAML::XS' => undef, + 'Sys::Hostname' => undef, + 'File::Basename' => undef, + 'namespace::autoclean' => undef, +); + + +my $max = 1; +for ( my $i = 0; $i < @Modules; $i += 2 ) { + my $m = $Modules[$i]; + $m .= " " . $Modules[ $i + 1 ] if defined $Modules[ $i + 1 ]; + $max = length($m) if length($m) > $max; +} + + +my $ret = 0; + +print encode_utf8( "\nChecke Verfügbarkeit der Module:\n\n" ); + +while ( @Modules ) { + + my $module = shift @Modules; + my $version = shift @Modules; + + my $use = $module; + $use .= ' ' . $version if defined $version; + + printf ' - %-*s - ', $max, $use; + + $use = "use " . $use; + $use .= ";"; + eval $use; + if ( $@ ) { + print "NICHT OK\n"; + $ret = 5; + } + else { + print "OK\n"; + } + +} + +exit $ret; + +#-------------------------------------------------------------------------------- + +__END__ + +# vim: noai : ts=4 fenc=utf-8 filetype=perl expandtab : -- 2.39.5