File:  [LON-CAPA] / loncom / build / Attic / loncapaverifybasepackage
Revision 1.2: download - view: text, annotated - select for diffs
Wed Oct 25 23:51:17 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
had to modify comment

    1: #!/usr/bin/perl
    2: 
    3: # loncapaverifybasepackage
    4: 
    5: # This tool helps with system verification.  It looks at essential
    6: # files on the system.  It downloads the base
    7: # RPM (LON-CAPA-base) from install.lon-capa.org (into /tmp
    8: # directory).  It compares file differences and generates a
    9: # pretty HTML report.
   10: 
   11: # This is an adapted shell script I wrote a while ago.  I need
   12: # to perlify many of the commands.
   13: 
   14: # Scott Harrison, 10/25/2000
   15: 
   16: use strict;
   17: 
   18: `/bin/rm -Rf /home/httpd/html/dev`;
   19: `/bin/mkdir -m 0755 /home/httpd/html/dev`;
   20: `/usr/bin/lynx -source http://install.lon-capa.org/3.1/loncapafiles/LON-CAPA-base-3.1-1.i386.rpm > /tmp/LON-CAPA-base-3.1-1.i386.rpm`;
   21: `/bin/rpm -Vp /tmp/LON-CAPA-base-3.1-1.i386.rpm > /home/httpd/html/dev/index.txt`;
   22: `/bin/echo "<H1>File Check: " > /home/httpd/html/dev/index.html`;
   23: `/bin/cat /etc/HOSTNAME >> /home/httpd/html/dev/index.html`;
   24: `/bin/echo "</H1><BR>DATE OF CHECK: " >> /home/httpd/html/dev/index.html`;
   25: `/bin/date >> /home/httpd/html/dev/index.html`;
   26: `/bin/echo "<BR>DATE OF MOST RECENT LON-CAPA RPM: " >> /home/httpd/html/dev/index.html`;
   27: `/bin/rpm -qp --queryformat '%{BUILDTIME}' /tmp/LON-CAPA-base-3.1-1.i386.rpm | /usr/bin/perl -e '\$t=<>; chop; print scalar localtime(\$t);' >> /home/httpd/html/dev/index.html`;
   28: `/bin/echo "<P>Inconsistencies with most recent LON-CAPA RPM (<B>bold</B> indicates the way it should be):<BR><HR>" >> /home/httpd/html/dev/index.html`;
   29: my @verifications=`/bin/rpm -Vp /tmp/LON-CAPA-base-3.1-1.i386.rpm | grep -v '\\.\\.\\.\\.\\.\\.\\.' | cut -b13-`;
   30: my @reports=();
   31: foreach (@verifications) {
   32:     chop;
   33:     my $a=$_;
   34:     my $d=`cd /tmp; rm -Rf /tmp/uncpio;mkdir uncpio;cd uncpio; rpm2cpio ../LON-CAPA-base-3.1-1.i386.rpm | cpio -iumd --quiet $a;diff $a /$a 2>&1;`;
   35:     $d=~s/\</\&lt;/g;
   36:     $d=~s/\>/\&gt;/g;
   37:     push @reports,(split(/\n/,"<P><B>$a</B><BR><TABLE BGCOLOR=\"#80FF80\"><TR><TD><PRE>$d</PRE></TD></TR></TABLE>")); 
   38:     `rm -Rf /tmp/uncpio`;
   39: } 
   40: open (OUT,">>/home/httpd/html/dev/index.html");
   41: foreach (@reports) {
   42:     my $a=$_;
   43:     $a="<B>$a</B>" if /^\&lt;/;
   44:     print OUT "$a\n";
   45: }
   46: close OUT;
   47: `/bin/rm -f /tmp/LON-CAPA-base-3.1-1.i386.rpm`;

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