[LON-CAPA-cvs] cvs: modules /sharrison/autocpan check_for_RPM-tools.pl
harris41
lon-capa-cvs@mail.lon-capa.org
Sun, 11 Aug 2002 23:09:02 -0000
harris41 Sun Aug 11 19:09:02 2002 EDT
Added files:
/modules/sharrison/autocpan check_for_RPM-tools.pl
Log:
is RPM Tools on the system?
Index: modules/sharrison/autocpan/check_for_RPM-tools.pl
+++ modules/sharrison/autocpan/check_for_RPM-tools.pl
# check_for_RPM-Tools.pl - do we have RPM-Tools installed?
# Scott Harrison, sharrison@users.sourceforge.net, 2002
# $Id: check_for_RPM-tools.pl,v 1.1 2002/08/11 23:09:02 harris41 Exp $
# RPM-Tools needs to be installed (snippet from perltest.pl).
# Check for the correct version.
my $pkg="RPM::Make";
eval { my $p; ($p = $pkg . ".pm") =~ s!::!/!g; require $p; };
$vnum = ${"${pkg}::VERSION"} || ${"${pkg}::Version"} || 0;
$vnum = -1 if $@;
if ($vnum == -1) {
print '**** ERROR **** RPM-Tools is not installed.'."\n";
print 'To manually install, please visit ';
print 'http://search.cpan.org/dist/RPM-Tools/'."\n";
print 'To automatically install, please run ./install_RPM-Tools.sh'."\n";
exit(1);
}
if ($vnum<0.5) {
print "**** ERROR **** Your RPM-Tools is out of date.\n";
print 'To manually install, please visit ';
print 'http://search.cpan.org/dist/RPM-Tools/'."\n";
print 'To automatically install, please run ./install_RPM-Tools.sh'."\n";
exit(1);
}