[Rt-commit] [svn] r1918 - in rt/branches/3.3-TESTING: . sbin
jesse at pallas.eruditorum.org
jesse at pallas.eruditorum.org
Sun Nov 21 20:26:57 EST 2004
Author: jesse
Date: Sun Nov 21 20:26:56 2004
New Revision: 1918
Modified:
rt/branches/3.3-TESTING/ (props changed)
rt/branches/3.3-TESTING/sbin/rt-test-dependencies.in
Log:
r9310 at tinbook: jesse | 2004-11-22T01:26:40.004042Z
fixes for the perl module downloading bit
Modified: rt/branches/3.3-TESTING/sbin/rt-test-dependencies.in
==============================================================================
--- rt/branches/3.3-TESTING/sbin/rt-test-dependencies.in (original)
+++ rt/branches/3.3-TESTING/sbin/rt-test-dependencies.in Sun Nov 21 20:26:56 2004
@@ -55,9 +55,18 @@
use CPAN;
my %args;
my %deps;
-GetOptions(\%args, 'v|verbose', 'install', 'with-MYSQL', 'with-POSTGRESQL|with-pg|with-pgsql', 'with-SQLITE', 'with-ORACLE', 'with-FASTCGI', 'with-SPEEDYCGI', 'with-MODPERL1', 'with-MODPERL2' ,'with-DEV', 'download=s');
+GetOptions(
+ \%args, 'v|verbose',
+ 'install', 'with-MYSQL',
+ 'with-POSTGRESQL|with-pg|with-pgsql', 'with-SQLITE',
+ 'with-ORACLE', 'with-FASTCGI',
+ 'with-SPEEDYCGI', 'with-MODPERL1',
+ 'with-MODPERL2', 'with-DEV',
+ 'download=s',
+ 'repository=s'
+);
-if (!keys %args) {
+unless (keys %args) {
help();
exit(0);
}
@@ -65,21 +74,13 @@
warn_modperl2();
}
+# Set up defaults
$args{'with-MASON'} = 1;
$args{'with-CORE'} = 1;
$args{'with-DEV'} =1;
$args{'with-CLI'} =1;
$args{'with-MAILGATE'} =1;
-sub warn_modperl2 {
- print <<'.';
- NOTE: mod_perl 2.0 isn't quite ready for prime_time just yet;
- Best Practical Solutions strongly recommends that sites use
- Apache 1.3 or FastCGI. If you MUST use mod_perl 2.0 (or 1.99),
- please read the mailing list archives before asking for help.
-.
- sleep 5;
-}
sub help {
@@ -224,6 +225,57 @@
if ($args{'download'}) {
+ download_mods();
+}
+
+
+check_perl_version();
+
+check_users();
+
+
+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 = test_dep($module, $version);
+
+ if ($args{'install'} && !$ret) {
+ resolve_dep($module);
+ }
+ }
+}
+
+sub test_dep {
+ my $module = shift;
+ my $version = shift;
+
+ eval "use $module $version ()";
+ if ($@) {
+ my $error = $@;
+ $error =~ s/\n(.*)$//s;
+ print "\t$module $version";
+ print "...MISSING\n";
+ print "\t\t$error\n" if $error =~ /this is only/;
+
+ return undef;
+ } else {
+ print "\t$module $version...found\n" if $args{'v'};
+ return 1;
+ }
+}
+
+sub resolve_dep {
+ my $module = shift;
+ use CPAN;
+ CPAN::Shell->install($module);
+}
+
+sub download_mods {
my %modules;
foreach my $key (keys %deps) {
@@ -248,9 +300,12 @@
print "Dir is $dir\n";
next if ( $dir =~ /^\.\.?$/);
+ # Skip things we've previously tagged
+ my $out = `svn ls $args{'repository'}/tags/$dir`;
+ next if ($out);
+
if ($dir =~ /^(.*)-(.*?)$/) {
- print "$1 -- $2\n";
- `svn_load_dirs.pl file:///Users/jesse/mod-repo $1 $moddir/$dir`;
+ `svn_load_dirs -no_user_input -t tags/$dir -v $args{'repository'} dists/$1 $moddir/$dir`;
`rm -rf $moddir/$dir`;
}
@@ -260,6 +315,8 @@
exit;
}
+sub check_perl_version {
+
print "perl:\n";
print "\t5.8.3";
@@ -279,6 +336,9 @@
} else {
print "...found\n" if $args{'v'};
}
+}
+
+sub check_users {
print "users:\n";
print "\trt group (@RTGROUP@)...", (defined getgrnam("@RTGROUP@") ? "found" : "MISSING"), "\n";
@@ -288,70 +348,17 @@
print "\tweb owner (@WEB_USER@)...", (defined getpwnam("@WEB_USER@") ? "found" : "MISSING"), "\n";
print "\tweb group (@WEB_GROUP@)...", (defined getgrnam("@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 = test_dep($module, $version);
-
- if ($args{'install'} && !$ret) {
- resolve_dep($module);
- }
- }
}
-sub test_dep {
- my $module = shift;
- my $version = shift;
-
- eval "use $module $version ()";
- if ($@) {
- my $error = $@;
- $error =~ s/\n(.*)$//s;
- print "\t$module $version";
- print "...MISSING\n";
- print "\t\t$error\n" if $error =~ /this is only/;
-
- return undef;
- } else {
- print "\t$module $version...found\n" if $args{'v'};
- return 1;
- }
-}
-sub resolve_dep {
- my $module = shift;
- use CPAN;
- CPAN::Shell->install($module);
+sub warn_modperl2 {
+ print <<'.';
+ NOTE: mod_perl 2.0 isn't quite ready for prime_time just yet;
+ Best Practical Solutions strongly recommends that sites use
+ Apache 1.3 or FastCGI. If you MUST use mod_perl 2.0 (or 1.99),
+ please read the mailing list archives before asking for help.
+.
+ sleep 5;
}
-
-sub print_help {
- print << "EOF";
-
-$0 FLAG DBTYPE
-
-
-$0 is a tool for RT that will tell you if you've got all
-the modules RT depends on properly installed.
-
-Flags: (only one flag is valid for a given run)
-
--quiet will check to see if we've got everything we need
- and will exit with a return code of (1) if we don't.
-
--warn will tell you what isn't properly installed
-
--fix will use CPANPLUS.pm or CPAN.pm to magically make everything better
-
-DBTYPE is one of:
- oracle, pg, mysql
-
-EOF
-
- exit(0);
-}
+1;
More information about the Rt-commit
mailing list