File:
[LON-CAPA] /
loncom /
build /
rpmparse.pl
Revision
1.10:
download - view:
text,
annotated -
select for diffs
Thu Nov 8 00:17:09 2001 UTC (22 years, 9 months ago) by
harris41
Branches:
MAIN
CVS tags:
version_2_9_X,
version_2_9_99_0,
version_2_9_1,
version_2_9_0,
version_2_8_X,
version_2_8_99_1,
version_2_8_99_0,
version_2_8_2,
version_2_8_1,
version_2_8_0,
version_2_7_X,
version_2_7_99_1,
version_2_7_99_0,
version_2_7_1,
version_2_7_0,
version_2_6_X,
version_2_6_99_1,
version_2_6_99_0,
version_2_6_3,
version_2_6_2,
version_2_6_1,
version_2_6_0,
version_2_5_X,
version_2_5_99_1,
version_2_5_99_0,
version_2_5_2,
version_2_5_1,
version_2_5_0,
version_2_4_X,
version_2_4_99_0,
version_2_4_2,
version_2_4_1,
version_2_4_0,
version_2_3_X,
version_2_3_99_0,
version_2_3_2,
version_2_3_1,
version_2_3_0,
version_2_2_X,
version_2_2_99_1,
version_2_2_99_0,
version_2_2_2,
version_2_2_1,
version_2_2_0,
version_2_1_X,
version_2_1_99_3,
version_2_1_99_2,
version_2_1_99_1,
version_2_1_99_0,
version_2_1_3,
version_2_1_2,
version_2_1_1,
version_2_1_0,
version_2_12_X,
version_2_11_X,
version_2_11_5_msu,
version_2_11_5,
version_2_11_4_uiuc,
version_2_11_4_msu,
version_2_11_4,
version_2_11_3_uiuc,
version_2_11_3_msu,
version_2_11_3,
version_2_11_2_uiuc,
version_2_11_2_msu,
version_2_11_2_educog,
version_2_11_2,
version_2_11_1,
version_2_11_0_RC3,
version_2_11_0_RC2,
version_2_11_0_RC1,
version_2_11_0,
version_2_10_X,
version_2_10_1,
version_2_10_0_RC2,
version_2_10_0_RC1,
version_2_10_0,
version_2_0_X,
version_2_0_99_1,
version_2_0_2,
version_2_0_1,
version_2_0_0,
version_1_99_3,
version_1_99_2,
version_1_99_1_tmcc,
version_1_99_1,
version_1_99_0_tmcc,
version_1_99_0,
version_1_3_X,
version_1_3_3,
version_1_3_2,
version_1_3_1,
version_1_3_0,
version_1_2_X,
version_1_2_99_1,
version_1_2_99_0,
version_1_2_1,
version_1_2_0,
version_1_1_X,
version_1_1_99_5,
version_1_1_99_4,
version_1_1_99_3,
version_1_1_99_2,
version_1_1_99_1,
version_1_1_99_0,
version_1_1_3,
version_1_1_2,
version_1_1_1,
version_1_1_0,
version_1_0_99_3,
version_1_0_99_2,
version_1_0_99_1,
version_1_0_99,
version_1_0_3,
version_1_0_2,
version_1_0_1,
version_1_0_0,
version_0_99_5,
version_0_99_4,
version_0_99_3,
version_0_99_2,
version_0_99_1,
version_0_99_0,
version_0_6_2,
version_0_6,
version_0_5_1,
version_0_5,
version_0_4,
stable_2002_spring,
stable_2002_july,
stable_2002_april,
stable_2001_fall,
loncapaMITrelate_1,
language_hyphenation_merge,
language_hyphenation,
conference_2003,
bz6209-base,
bz6209,
bz5969,
bz5610,
bz2851,
STABLE,
PRINT_INCOMPLETE_base,
PRINT_INCOMPLETE,
HEAD,
GCI_3,
GCI_2,
GCI_1,
Before_rewrite,
BZ5971-printing-apage,
BZ5434-fox,
BZ4492-merge,
BZ4492-feature_horizontal_radioresponse,
BZ4492-feature_Support_horizontal_radioresponse,
BZ4492-Support_horizontal_radioresponse
improving rpm output and comparison
1: #!/usr/bin/perl
2:
3: my ($standard,$current,$expected)=@ARGV;
4:
5: $standard=~s/[^\/\w\.]//g; # cd_rpms.txt
6: $current=~s/[^\/\w\.]//g; # rpm -qa --queryformat \
7: # '%{NAME}\t%{VERSION}\t%{RELEASE}\t%{BUILDTIME}'
8: $expected=~s/[^\/\w\.]//g; # rpm_list.txt
9: my %svhash;
10: my %sbhash;
11: my %chash;
12:
13: my @oldrpms;
14: my @badversionrpms;
15: my @newrpms;
16: my @externalrpms;
17: my @barerpms;
18: my @developrpms;
19:
20: my %ignore=(
21: 'LON-CAPA-setup' => 1,
22: 'LON-CAPA-base' => 1,
23: );
24:
25: open IN, "<$standard";
26: while(<IN>) {
27: chop;
28: my ($name,$version,$release,$buildtime,$arch)=split(/\s+/);
29: next if $ignore{$name};
30: $download='<a href="'.
31: 'http://install.lon-capa.org/3.1/latestRPMS/'.$name.'-'.
32: $version.'-'.$release.'.'.$arch.'.rpm'.'">[download]</a>';
33: $version="$version-$release";
34: $svhash{$name}=$version;
35: $sbhash{$name}=$buildtime;
36: $dhash{$name}=$download;
37: }
38: close IN;
39:
40: open IN, "<$current";
41: while(<IN>) {
42: chop;
43: my ($name,$version,$release,$buildtime)=split(/\s+/);
44: next if $ignore{$name};
45: $version="$version-$release";
46: $chash{$name}=1;
47: if ($svhash{$name}) {
48: unless ($svhash{$name} eq $version) {
49: push @badversionrpms,sprintf("$dhash{$name} %-25s %s",($name,"is version $version, should be $svhash{$name}"))."\n";
50: }
51: if ($sbhash{$name}<$buildtime) {
52: push @newrpms,sprintf("$dhash{$name} %-25s %s",($name,"was built ".localtime($buildtime)." when the expected build time was ".localtime($sbhash{$name})))."\n";
53: }
54: if ($sbhash{$name}>$buildtime) {
55: push @oldrpms,sprintf("$dhash{$name} %-25s %s",($name,"was built ".localtime($buildtime)." when the expected build time was ".localtime($sbhash{$name})))."\n";
56: }
57: }
58: else {
59: push @externalrpms,sprintf("$dhash{$name} %-25s %s",($name,"(built ".localtime($buildtime).") is an RPM not expected to ever be on a LON-CAPA system"))."\n";
60: }
61: }
62: close IN;
63:
64: open IN,"<$expected";
65: while(<IN>) {
66: chop;
67: next unless /^[YN] \w/;
68: /(.).(.*)/;
69: my $type=$1;
70: my $package=$2;
71: $package=~s/\-[^\-]*\-[^\-]*$//;
72: next if $ignore{$package};
73: if (!$chash{$package}) {
74: push @barerpms,sprintf("$dhash{$package} %-25s %s",($package,"is missing and is of basic necessity to a LON-CAPA system"))."\n" if $type eq 'Y';
75: push @developrpms,sprintf("$dhash{$package} %-25s %s",($package,"is missing and may be useful for a LON-CAPA system"))."\n" if $type eq 'N';
76: }
77: }
78: close IN;
79:
80: my $date=`date`; chop $date;
81: my $hostname=`hostname`; chop $hostname;
82: print <<END;
83: <html>
84: <head>
85: <title>LON-CAPA Software RPM Status Page</title>
86: </head>
87: <body>
88: <font size="+2">LON-CAPA Software RPM Status Page
89: (done on $date for $hostname)</font>
90: <br />Michigan State University
91: <br />Learning Online with CAPA
92: <br />Contact korte\@lon-capa.org
93: <ul>
94: <li>Important warnings</li>
95: <li>About this file</li>
96: <li>Bad RPM Versions</li>
97: <li>Out-of-date RPMS</li>
98: <li>Newer than expected RPMS</li>
99: <li>RPMS external to LON-CAPA</li>
100: <li>RPMS from the "bare minimum" set that you are missing</li>
101: <li>RPMS from the "development" set that you are missing</li>
102: </ul>
103: <font size="+2">Important warnings</font>
104: <p>
105: <b>Never install LON-CAPA-setup</b> on a running LON-CAPA machine.
106: This RPM package contains pre-installation files such as
107: /etc/group and /etc/passwd. You will lose all access to your
108: machine if you install this RPM.
109: </p>
110: <p>
111: If you are doing CVS-based upgrades of your LON-CAPA
112: software, then you do not need to upgrade your LON-CAPA-base
113: RPM. Upgrading with the LON-CAPA-base RPM
114: will cause you to lose many of your system-specific
115: configuration settings.
116: </p>
117: <p>
118: DO NOT UPGRADE YOUR KERNEL UNLESS YOU KNOW WHAT YOU ARE DOING.
119: Kernel upgrading involves packages beginning with the word
120: "kernel".
121: </p>
122: <font size="+2">About this file</font>
123: <p>
124: This file is generated dynamically by <tt>make rpmstatuspost</tt>
125: when this command is entered in the CVS:loncom/build directory.
126: </p>
127: <p>
128: Managing software packages on any system, testing different
129: sets of software packages, tracking their dependencies, and maintaining
130: configuration information is an inexact science. While the LON-CAPA
131: recommended set of RPMs is a tested set with no missing dependencies,
132: we still highly recommend that RPM upgrades are only performed
133: by those with significant knowledge about standard Linux operating
134: systems.
135: </p>
136: END
137: print <<END;
138: <font size="+2">Differing RPM Versions</font>
139: <pre>
140: END
141: foreach my $rpminfo (@badversionrpms) {
142: print $rpminfo;
143: }
144: print <<END;
145: </pre>
146: END
147: print <<END;
148: <font size="+2">Out-of-date RPMS</font>
149: <pre>
150: END
151: foreach my $rpminfo (@oldrpms) {
152: print $rpminfo;
153: }
154: print <<END;
155: </pre>
156: END
157: print <<END;
158: <font size="+2">Newer than expected RPMS</font>
159: <pre>
160: END
161: foreach my $rpminfo (@newrpms) {
162: print $rpminfo;
163: }
164: print <<END;
165: </pre>
166: END
167: print <<END;
168: <font size="+2">RPMS external to LON-CAPA</font>
169: <pre>
170: END
171: foreach my $rpminfo (@externalrpms) {
172: print $rpminfo;
173: }
174: print <<END;
175: </pre>
176: END
177: print <<END;
178: <font size="+2">RPMS from the "bare minimum" set that you are missing</font>
179: <pre>
180: END
181: foreach my $rpminfo (@barerpms) {
182: print $rpminfo;
183: }
184: print <<END;
185: </pre>
186: END
187: print <<END;
188: <font size="+2">RPMS from the "development" set that you are missing</font>
189: <pre>
190: END
191: foreach my $rpminfo (@developrpms) {
192: print $rpminfo;
193: }
194: print <<END;
195: </pre>
196: END
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>