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, 2 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

    1: #!/usr/bin/perl
    2: 
    3: my $RHversion = (split /\s/, `cat /etc/redhat-release`)[4];
    4: my $FTPSERVER;
    5: `ping -q -c 1 mirror.pa.msu.edu 2>/dev/null`;
    6: if (!$FTPSERVER and $?==0) {
    7:     `ncftpls ftp://mirror.pa.msu.edu`;
    8:     if ($?==0) {
    9: 	$FTPSERVER="mirror.pa.msu.edu";
   10:    $FTPUPDATES="mirror.pa.msu.edu/linux/redhat/linux/updates/$RHversion/en/os";
   11:     }
   12: }
   13: `ping -q -c 1 rufus.w3.org 2>/dev/null`;
   14: if (!$FTPSERVER and $?==0) {
   15:     `ncftpls ftp://rufus.w3.org`;
   16:     if ($?==0) {
   17: 	$FTPSERVER="rufus.w3.org";
   18: 	$FTPUPDATES="rufus.w3.org/linux/redhat/updates/$RHversion/en/os";
   19:     }
   20: }
   21: if (!$FTPSERVER) {
   22:     print "Cannot find a working ftp server.\n";
   23: }
   24: print "Using $FTPSERVER for ftp transaction...(please be patient)\n";
   25: my @rpms=`perl loncom/build/check-rpms -ftp $FTPUPDATES`;
   26: if (@rpms) {
   27:     my $rpm_count=scalar(@rpms);
   28:     print(<<END);
   29: **** WARNING **** You need to update at least $rpm_count RPMS shown in 
   30: the list below.  THIS IS IMPORTANT FOR SECURITY.
   31: 
   32: END
   33:     print join("\n",map {chomp;$_} @rpms)."\n";
   34:     print(<<END);
   35: 
   36: Please visit ftp://$FTPUPDATES
   37: and download the RPMS you need.
   38: For instructions on working with (and upgrading) RPMS, please
   39: visit http://www.rpm.org/max-rpm/.
   40: END
   41: }
   42: else {
   43:     print(<<END);
   44: **** NOTE **** All RPMS on your system appear to be up to date.
   45: END
   46: }

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