[Rt-commit] [svn] r1029 - rt/branches/rt-3.1/sbin
alexmv at pallas.eruditorum.org
alexmv at pallas.eruditorum.org
Mon Jun 7 17:50:38 EDT 2004
Author: alexmv
Date: Mon Jun 7 17:50:37 2004
New Revision: 1029
Modified:
rt/branches/rt-3.1/sbin/rt-test-dependencies.in
Log:
RT-Ticket: 5619
RT-Action: correspond
RT-Status: resolved
* Re-indent
* Use getpwnam and getgrnam to check for existance of users and
groups that were chosen during configure; this might belong better
in configure.ac, but my perl-fu is better than my autoconf-fu
Modified: rt/branches/rt-3.1/sbin/rt-test-dependencies.in
==============================================================================
--- rt/branches/rt-3.1/sbin/rt-test-dependencies.in (original)
+++ rt/branches/rt-3.1/sbin/rt-test-dependencies.in Mon Jun 7 17:50:37 2004
@@ -198,21 +198,18 @@
my %modules;
foreach my $key (keys %deps) {
-
-
- my @deps = (@{$deps{$key}});
- while (@deps) {
- my $mod = shift @deps;
- my $ver = shift @deps;
- next if ($mod =~ /^(DBD-|Apache-Request)/);
- $modules{$mod} = $ver;
-
- }
+ my @deps = (@{$deps{$key}});
+ while (@deps) {
+ my $mod = shift @deps;
+ my $ver = shift @deps;
+ next if ($mod =~ /^(DBD-|Apache-Request)/);
+ $modules{$mod} = $ver;
+ }
}
my @mods = keys %modules;
CPAN::get();
- my $moddir = $args{'download'};
- foreach my $mod(@mods){
+ my $moddir = $args{'download'};
+ foreach my $mod (@mods) {
$CPAN::Config->{'build_dir'} = $moddir;
CPAN::get($mod);
}
@@ -239,63 +236,70 @@
print "\t5.8.3";
eval {require 5.008003};
if ($@) {
-print "...MISSING.\n";
- eval {require 5.008000};
- if ($@) {
- print "\nRT is known to be non-functional on versions of perl older than 5.8.3.\nPlease upgrade to 5.8.3 or newer\n\n";
- die;
- }
-
- eval {require 5.008003};
- if ($@) {
- print "\nRT is known to be non-functional on versions of perl older than 5.8.3.\nPlease upgrade to 5.8.3 or newer\n\n";
- }
+ print "...MISSING.\n";
+ eval {require 5.008000};
+ if ($@) {
+ print "\nRT is known to be non-functional on versions of perl older than 5.8.3.\nPlease upgrade to 5.8.3 or newer\n\n";
+ die;
+ }
+
+ eval {require 5.008003};
+ if ($@) {
+ print "\nRT is known to be non-functional on versions of perl older than 5.8.3.\nPlease upgrade to 5.8.3 or newer\n\n";
+ }
} else {
- print "...found\n";
+ print "...found\n";
}
+print "users:\n";
+print "\trt group (@RTGROUP@)...", (defined getgrnam("@RTGROUP@") ? "found" : "MISSING"), "\n";
+print "\tbin owner (@BIN_OWNER@)...", (defined getpwnam("@BIN_OWNER@") ? "found" : "MISSING"), "\n";
+print "\tlibs owner (@LIBS_OWNER@)...", (defined getpwnam("@LIBS_OWNER@") ? "found" : "MISSING"), "\n";
+print "\tlibs group (@LIBS_GROUP@)...", (defined getgrnam("@LIBS_GROUP@") ? "found" : "MISSING"), "\n";
+print "\tweb owner (@WEB_USER@)...", (defined getpwnam("@WEB_USER@") ? "found" : "MISSING"), "\n";
+print "\tweb group (@WEB_GROUP@)...", (defined getpwnam("@WEB_GROUP@") ? "found" : "MISSING"), "\n";
+
+foreach my $type (keys %args) {
+ next unless ($type =~ /^with-(.*?)$/);
+ my $type = $1;
+ print "$type dependencies:\n";
+ my @deps = (@{$deps{$type}});
+ while (@deps) {
+ my $module = shift @deps;
+ my $version = shift @deps;
+ my $ret;
+ $ret =test_dep($module, $version);
-foreach my $type (keys %args) {
-next unless ($type =~ /^with-(.*?)$/);
-my $type = $1;
-print "$type dependencies:\n";
- my @deps = (@{$deps{$type}});
- while (@deps) {
- my $module = shift @deps;
- my $version = shift @deps;
-my $ret;
- $ret =test_dep($module, $version);
-
-if ($args{'install'} && !$ret) {
- resolve_dep($module);
-}
-}
+ if ($args{'install'} && !$ret) {
+ resolve_dep($module);
+ }
+ }
}
+
sub test_dep {
- my $module = shift;
- my $version = shift;
+ my $module = shift;
+ my $version = shift;
+
+ print "\t$module $version";
+ eval "use $module $version ()";
+ if ($@) {
+ my $error = $@;
+ $error =~ s/\n(.*)$//s;
+ print "...MISSING\n";
+ print "\t\t$error\n" if $error =~ /this is only/;
- print "\t$module $version";
- eval "use $module $version ()";
- if ($@) {
- my $error = $@;
- $error =~ s/\n(.*)$//s;
- print "...MISSING\n";
- print "\t\t$error\n" if $error =~ /this is only/;
-
- return undef;
- } else {
- print "...found\n";
-return 1;
- }
+ return undef;
+ } else {
+ print "...found\n";
+ return 1;
+ }
}
sub resolve_dep {
- my $module = shift;
- use CPAN;
- CPAN::Shell->install($module);
-
+ my $module = shift;
+ use CPAN;
+ CPAN::Shell->install($module);
}
More information about the Rt-commit
mailing list