File:  [LON-CAPA] / loncom / build / Attic / loncapaverifypackages
Revision 1.3: download - view: text, annotated - select for diffs
Wed Oct 25 23:50:21 2000 UTC (23 years, 8 months ago) by harris41
Branches: MAIN
CVS tags: version_0_4, stable_2002_spring, stable_2002_july, stable_2002_april, stable_2001_fall, STABLE, HEAD, Before_rewrite
can't remember

    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 | /bin/grep '^[[:alpha:]][[:space:]][[:alpha:]]' | /usr/bin/cut -b3-`;
   17: my %ihash=map {($_,1)} @ideal_rpms;
   18: 
   19: my @not_current_but_ideal=map {"- $_"} grep {!$chash{$_}} @ideal_rpms;
   20: my @not_ideal_but_current=map {"+ $_"} grep {!$ihash{$_}} @current_rpms;
   21: 
   22: print <<END if @not_current_but_ideal;
   23: These packages below are missing and should be on your system.
   24: END
   25: print join("",@not_current_but_ideal);
   26: print <<END if @not_ideal_but_current;
   27: These packages below are on your system but, according to install.lon-capa.org,
   28: should not be.  This may be due to not having an upgraded package, a package added
   29: by the administrator of this machine to enhance functionality, changes in the
   30: LON-CAPA system, or malicious activity.  You may want to remove or upgrade these.
   31: END
   32: print join("",@not_ideal_but_current);

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