DB_MODULE
ROOT_USER
ON_WINDOWS
+ ON_ACTIVESTATE
MAX_TOKEN_AGE
MAX_LOGINCOOKIE_AGE
# True if we're on Win32.
use constant ON_WINDOWS => ($^O =~ /MSWin32/i);
+# True if we're using ActiveState Perl (as opposed to Strawberry) on Windows.
+use constant ON_ACTIVESTATE => eval { &Win32::BuildNumber };
# The user who should be considered "root" when we're giving
# instructions to Bugzilla administrators.
return \@missing;
}
-# Returns the build ID of ActivePerl. If several versions of
-# ActivePerl are installed, it won't be able to know which one
-# you are currently running. But that's our best guess.
-sub _get_activestate_build_id {
- eval 'use Win32::TieRegistry';
- return 0 if $@;
- my $key = Win32::TieRegistry->new('LMachine\Software\ActiveState\ActivePerl')
- or return 0;
- return $key->GetValue("CurrentVersion");
-}
-
sub print_module_instructions {
my ($check_results, $output) = @_;
if ((!$output && @{$check_results->{missing}})
|| ($output && $check_results->{any_missing}))
{
- if (ON_WINDOWS) {
+ if (ON_ACTIVESTATE) {
my $perl_ver = sprintf('%vd', $^V);
# URL when running Perl 5.8.x.
print colored(install_string('ppm_repo_add',
{ theory_url => $url_to_theory58S }), 'red');
# ActivePerls older than revision 819 require an additional command.
- if (_get_activestate_build_id() < 819) {
+ if (ON_ACTIVESTATE < 819) {
print install_string('ppm_repo_up');
}
}
}
}
- if ($output && $check_results->{any_missing} && !ON_WINDOWS
+ if ($output && $check_results->{any_missing} && !ON_ACTIVESTATE
&& !$check_results->{hide_all})
{
print install_string('install_all', { perl => $^X });
my $module = shift;
my ($command, $package);
- if (ON_WINDOWS) {
+ if (ON_ACTIVESTATE) {
$command = 'ppm install %s';
$package = $module->{package};
}
pod2usage({ -verbose => 1 }) if $switch{'help'};
-if (ON_WINDOWS) {
- print "\nYou cannot run this script on Windows. Please follow instructions\n";
- print "given by checksetup.pl to install missing Perl modules.\n\n";
+if (ON_ACTIVESTATE) {
+ print <<END;
+You cannot run this script when using ActiveState Perl. Please follow
+the instructions given by checksetup.pl to install missing Perl modules.
+
+END
exit;
}