File:  [LON-CAPA] / loncom / build / Attic / CHECKRPMS.default
Revision 1.1: download - view: text, annotated - select for diffs
Wed May 1 17:01:18 2002 UTC (22 years, 8 months ago) by harris41
Branches: MAIN
CVS tags: version_0_4, stable_2002_july, stable_2002_april, STABLE, HEAD
a top-level vanilla wrapper script

#!/usr/bin/perl

my $RHversion = (split /\s/, `cat /etc/redhat-release`)[4];
my $FTPSERVER;
`ping -q -c 1 mirror.pa.msu.edu 2>/dev/null`;
if (!$FTPSERVER and $?==0) {
    `ncftpls ftp://mirror.pa.msu.edu`;
    if ($?==0) {
	$FTPSERVER="mirror.pa.msu.edu";
   $FTPUPDATES="mirror.pa.msu.edu/linux/redhat/linux/updates/$RHversion/en/os";
    }
}
`ping -q -c 1 rufus.w3.org 2>/dev/null`;
if (!$FTPSERVER and $?==0) {
    `ncftpls ftp://rufus.w3.org`;
    if ($?==0) {
	$FTPSERVER="rufus.w3.org";
	$FTPUPDATES="rufus.w3.org/linux/redhat/updates/$RHversion/en/os";
    }
}
if (!$FTPSERVER) {
    print "Cannot find a working ftp server.\n";
}
print "Using $FTPSERVER for ftp transaction...(please be patient)\n";
my @rpms=`perl loncom/build/check-rpms -ftp $FTPUPDATES`;
if (@rpms) {
    my $rpm_count=scalar(@rpms);
    print(<<END);
**** WARNING **** You need to update at least $rpm_count RPMS shown in 
the list below.  THIS IS IMPORTANT FOR SECURITY.

END
    print join("\n",map {chomp;$_} @rpms)."\n";
    print(<<END);

Please visit ftp://$FTPUPDATES
and download the RPMS you need.
For instructions on working with (and upgrading) RPMS, please
visit http://www.rpm.org/max-rpm/.
END
}
else {
    print(<<END);
**** NOTE **** All RPMS on your system appear to be up to date.
END
}

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>