Annotation of loncom/build/loncapaverifypackages, revision 1.3

1.1       harris41    1: #!/usr/bin/perl
                      2: 
                      3: # loncapaverifypackages
                      4: 
1.2       harris41    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: 
1.1       harris41   10: # Scott Harrison, 10/25/2000
1.2       harris41   11: 
                     12: use strict;
                     13: 
                     14: my @current_rpms=`/bin/rpm -qa`;
                     15: my %chash=map {($_,1)} @current_rpms;
1.3     ! harris41   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-`;
1.2       harris41   17: my %ihash=map {($_,1)} @ideal_rpms;
                     18: 
1.3     ! harris41   19: my @not_current_but_ideal=map {"- $_"} grep {!$chash{$_}} @ideal_rpms;
        !            20: my @not_ideal_but_current=map {"+ $_"} grep {!$ihash{$_}} @current_rpms;
1.2       harris41   21: 
1.3     ! harris41   22: print <<END if @not_current_but_ideal;
        !            23: These packages below are missing and should be on your system.
1.2       harris41   24: END
1.3     ! harris41   25: print join("",@not_current_but_ideal);
        !            26: print <<END if @not_ideal_but_current;
1.2       harris41   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
1.3     ! harris41   32: print join("",@not_ideal_but_current);

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