File:  [LON-CAPA] / loncom / build / Attic / loncapaverifypackages
Revision 1.2: download - view: text, annotated - select for diffs
Wed Oct 25 20:37:01 2000 UTC (23 years, 8 months ago) by harris41
Branches: MAIN
CVS tags: HEAD
first mainly complete version

    1: #!/usr/bin/perl
    2: 
    3: # loncapaverifypackages
    4: 
    5: # This tool helps with system verification.  It looks at the
    6: # RPM packages on the system.  It downloads a list of expected
    7: # RPMs from install.lon-capa.org.  It makes two comparisons.
    8: # Which packages are missing?  Which packages are unexpected?
    9: 
   10: # Scott Harrison, 10/25/2000
   11: 
   12: use strict;
   13: 
   14: my @current_rpms=`/bin/rpm -qa`;
   15: my %chash=map {($_,1)} @current_rpms;
   16: my @ideal_rpms=`/usr/bin/lynx -source http://install.lon-capa.org/3.1/otherfiles/rpm_list.txt`;
   17: my %ihash=map {($_,1)} @ideal_rpms;
   18: 
   19: @not_current_but_ideal=map {"- $_"} grep {$chash{$_}} @ideal_rpms;
   20: @not_ideal_but_current=map {"+ $_"} grep {$ihash{$_}} @current_rpms;
   21: 
   22: print <<END;
   23: These packages are missing and should be on your system.
   24: END
   25: print join("\n",@not_current_but_ideal);
   26: print <<END;
   27: 
   28: 
   29: END
   30: print <<END;
   31: These packages below are on your system but, according to install.lon-capa.org,
   32: should not be.  This may be due to not having an upgraded package, a package added
   33: by the administrator of this machine to enhance functionality, changes in the
   34: LON-CAPA system, or malicious activity.  You may want to remove or upgrade these.
   35: END
   36: print join("\n",@not_ideal_but_current);
   37: print <<END;
   38: END
   39: 

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