Annotation of loncom/build/system_dependencies/perltest.pl, revision 1.5
1.1 harris41 1: #!/usr/bin/perl
2:
3: # The LearningOnline Network with CAPA
4: #
5: # Testing to see if all needed perl components are on
6: # a system
7: #
8: # YEAR=2001
9: # 9/30 Scott Harrison
10: #
11: # I wish there were a more straightforward way to do this. But I can't
12: # seem to find the right internals in the perl programming language.
13: # Also, this program is only a "modest" effort to LOOK and see whether
14: # necessary perl system dependencies are present. I do not yet
15: # try to actually run tests against each needed perl module.
16:
17: # --------------------------------- Make sure the perl version is suitably high
18: my $ret=system("find --version 1>/dev/null");
19: if ($]<5.005) {
20: die "DEPENDENCY FAILURE: LON-CAPA requires perl version >= 5.005.\n";
21: }
22:
23: # ------------------------------------------ Make sure we have the find command
24: my $ret=system("find --version 1>/dev/null");
25: if ($ret) {
26: die "DEPENDENCY FAILURE: A test program requires the GNU ".
27: "'find' utility.\n";
28: }
29:
30: # ----------------------------------------- Read in all the system perl modules
31: print "Scanning for perl modules...\n";
32: my $modules;
33: foreach my $inc (@INC) {
34: my @m=`find $inc -type f -name '*.pm'`;
35: foreach my $mod (@m) {
36: $modules.=$mod;
37: }
38: }
39:
40: # --------------- Seeing if dependencies are in our "full" list of perl modules
41: my %dependencies=qw(
42: GD/Barcode.pm 1
43: GD/Barcode/COOP2of5.pm 1
44: GD/Barcode/Code39.pm 1
45: GD/Barcode/EAN13.pm 1
46: GD/Barcode/EAN8.pm 1
47: GD/Barcode/IATA2of5.pm 1
48: GD/Barcode/ITF.pm 1
49: GD/Barcode/Industrial2of5.pm 1
50: GD/Barcode/Matrix2of5.pm 1
51: GD/Barcode/NW7.pm 1
52: GD/Barcode/UPCA.pm 1
53: GD/Barcode/UPCE.pm 1
54: IO/Dir.pm 1
55: IO/Poll.pm 1
56: IO/Socket/INET.pm 1
57: IO/Socket/UNIX.pm 1
58: Algorithm/Diff.pm 1
59: Algorithm/DiffOld.pm 1
60: Bundle/LWP.pm 1
61: File/Listing.pm 1
62: HTML/AsSubs.pm 1
63: HTML/Element.pm 1
64: HTML/Element/traverse.pm 1
65: HTML/Form.pm 1
66: HTML/Parse.pm 1
67: HTML/Tagset.pm 1
68: HTML/Tree.pm 1
69: HTML/TreeBuilder.pm 1
70: HTTP/Cookies.pm 1
71: HTTP/Daemon.pm 1
72: HTTP/Date.pm 1
73: HTTP/Headers.pm 1
74: HTTP/Headers/Auth.pm 1
75: HTTP/Headers/ETag.pm 1
76: HTTP/Headers/Util.pm 1
77: HTTP/Message.pm 1
78: HTTP/Negotiate.pm 1
79: HTTP/Request.pm 1
80: HTTP/Request/Common.pm 1
81: HTTP/Response.pm 1
82: HTTP/Status.pm 1
83: LWP.pm 1
84: LWP/Authen/Basic.pm 1
85: LWP/Authen/Digest.pm 1
86: LWP/Debug.pm 1
87: LWP/MediaTypes.pm 1
88: LWP/MemberMixin.pm 1
89: LWP/Protocol.pm 1
90: LWP/Protocol/data.pm 1
91: LWP/Protocol/file.pm 1
92: LWP/Protocol/ftp.pm 1
93: LWP/Protocol/gopher.pm 1
94: LWP/Protocol/http.pm 1
95: LWP/Protocol/https.pm 1
96: LWP/Protocol/mailto.pm 1
97: LWP/Protocol/nntp.pm 1
98: LWP/RobotUA.pm 1
99: LWP/Simple.pm 1
100: LWP/UserAgent.pm 1
101: MIME/Body.pm 1
102: MIME/Decoder.pm 1
103: MIME/Decoder/Base64.pm 1
104: MIME/Decoder/Binary.pm 1
105: MIME/Decoder/Gzip64.pm 1
106: MIME/Decoder/NBit.pm 1
107: MIME/Decoder/QuotedPrint.pm 1
108: MIME/Decoder/UU.pm 1
109: MIME/Entity.pm 1
110: MIME/Field/ConTraEnc.pm 1
111: MIME/Field/ContDisp.pm 1
112: MIME/Field/ContType.pm 1
113: MIME/Field/ParamVal.pm 1
114: MIME/Head.pm 1
115: MIME/Parser.pm 1
116: MIME/Parser/Filer.pm 1
117: MIME/Parser/Reader.pm 1
118: MIME/Parser/Results.pm 1
119: MIME/Tools.pm 1
120: MIME/Words.pm 1
121: Net/Cmd.pm 1
122: Net/Config.pm 1
123: Net/Domain.pm 1
124: Net/FTP.pm 1
125: Net/FTP/A.pm 1
126: Net/FTP/E.pm 1
127: Net/FTP/I.pm 1
128: Net/FTP/L.pm 1
129: Net/FTP/dataconn.pm 1
130: Net/NNTP.pm 1
131: Net/Netrc.pm 1
132: Net/PH.pm 1
133: Net/POP3.pm 1
134: Net/SMTP.pm 1
135: Net/SNPP.pm 1
136: Net/Time.pm 1
137: Text/Query.pm 1
138: Text/Query/Advanced.pm 1
139: Text/Query/Build.pm 1
140: Text/Query/BuildAdvancedString.pm 1
141: Text/Query/BuildSimpleString.pm 1
142: Text/Query/Optimize.pm 1
143: Text/Query/Parse.pm 1
144: Text/Query/ParseAdvanced.pm 1
145: Text/Query/ParseSimple.pm 1
146: Text/Query/Simple.pm 1
147: Text/Query/Solve.pm 1
148: Text/Query/SolveAdvancedString.pm 1
149: Text/Query/SolveSimpleString.pm 1
150: URI.pm 1
151: URI/Escape.pm 1
152: URI/Heuristic.pm 1
153: URI/URL.pm 1
154: URI/WithBase.pm 1
155: URI/_foreign.pm 1
156: URI/_generic.pm 1
157: URI/_login.pm 1
158: URI/_query.pm 1
159: URI/_segment.pm 1
160: URI/_server.pm 1
161: URI/_userpass.pm 1
162: URI/data.pm 1
163: URI/file.pm 1
164: URI/file/Base.pm 1
165: URI/file/FAT.pm 1
166: URI/file/Mac.pm 1
167: URI/file/OS2.pm 1
168: URI/file/QNX.pm 1
169: URI/file/Unix.pm 1
170: URI/file/Win32.pm 1
171: URI/ftp.pm 1
172: URI/gopher.pm 1
173: URI/http.pm 1
174: URI/https.pm 1
175: URI/ldap.pm 1
176: URI/mailto.pm 1
177: URI/news.pm 1
178: URI/nntp.pm 1
179: URI/pop.pm 1
180: URI/rlogin.pm 1
181: URI/rsync.pm 1
182: URI/snews.pm 1
183: URI/telnet.pm 1
184: WWW/RobotRules.pm 1
185: WWW/RobotRules/AnyDBM_File.pm 1
186: Authen/Krb4.pm 1
187: Bundle/DBD/mysql.pm 1
188: Bundle/DBI.pm 1
189: Crypt/DES.pm 1
190: Crypt/IDEA.pm 1
191: DBD/ExampleP.pm 1
192: DBD/NullP.pm 1
193: DBD/Proxy.pm 1
194: DBD/Sponge.pm 1
195: DBD/mysql.pm 1
196: DBI.pm 1
197: DBI/DBD.pm 1
198: DBI/FAQ.pm 1
199: DBI/Format.pm 1
200: DBI/ProxyServer.pm 1
201: DBI/Shell.pm 1
202: DBI/W32ODBC.pm 1
203: Digest.pm 1
204: HTML/Entities.pm 1
205: HTML/Filter.pm 1
206: HTML/HeadParser.pm 1
207: HTML/LinkExtor.pm 1
208: HTML/Parser.pm 1
209: HTML/TokeParser.pm 1
210: MIME/Base64.pm 1
211: MIME/QuotedPrint.pm 1
212: Math/Cephes.pm 1
213: Math/Cephes/Complex.pm 1
214: Math/Cephes/Fraction.pm 1
215: Mysql.pm 1
216: Mysql/Statement.pm 1
217: Safe/Hole.pm 1
218: Win32/DBIODBC.pm 1
219: Algorithm/Diff.pm 1
220: Apache/Constants.pm 1
221: Apache/File.pm 1
222: capa.pm 1
223: CGI.pm 1
224: CGI/Cookie.pm 1
225: Crypt/DES.pm 1
226: DBI.pm 1
227: Fcntl.pm 1
228: File/Copy.pm 1
229: FileHandle.pm 1
230: GDBM_File.pm 1
231: HTML/TokeParser.pm 1
232: HTML/TreeBuilder.pm 1
233: HTTP/Headers.pm 1
234: IO/Socket.pm 1
235: LWP/UserAgent.pm 1
236: Math/Cephes.pm 1
237: Math/Random.pm 1
238: Opcode.pm 1
239: POSIX.pm 1
240: Safe.pm 1
241: Safe/Hole.pm 1
242: Socket.pm 1
243: strict.pm 1
244: Text/Query.pm 1
245: tth.pm 1
246: vars.pm 1
247: );
248:
249: my $errorflag=0;
250: foreach my $dep (keys %dependencies) {
251: unless ($modules=~/$dep/) {
252: print "MISSING $dep\n";
253: $errorflag++;
254: }
255: }
256:
1.2 harris41 257: unless ($errorflag) {
258: print "All perl modules needed by LON-CAPA appear to be present.\n";
259: }
1.5 ! harris41 260: else {
! 261: print "You are missing perl modules on your system.\n";
! 262: if (-e '/etc/redhat-release') {
! 263: $RHversion = (split /\s/, `cat /etc/redhat-release`)[4];
! 264: if ($RHversion=~/^7\./) {
! 265: print(<<END);
! 266: Please visit: http://install.lon-capa.org/3.1/latestRPMS/
! 267: Download an RPM looking like: LON-CAPA-systemperl-*.*-rh72.i386.rpm
! 268: Upgrade: rpm -Uvh --force LON-CAPA-systemperl-*.*-rh72.i386.rpm
! 269: (Note that you will need to replace the '*' asterisks with
! 270: the most up to date version number present within the latestRPMS
! 271: directory.)
! 272: END
! 273: }
! 274: elsif ($RHversion=~/^6\./) {
! 275: print(<<END);
! 276: Please visit: http://install.lon-capa.org/3.1/latestRPMS/
! 277: Download an RPM looking like: LON-CAPA-systemperl-*.*-1.i386.rpm
! 278: Upgrade: rpm -Uvh --force LON-CAPA-systemperl-*.*-1.i386.rpm
! 279: (Note that you will need to replace the '*' asterisks with
! 280: the most up to date version number present within the latestRPMS
! 281: directory.)
! 282: END
! 283: }
! 284: else {
! 285: print(<<END);
! 286: You are running a version of RedHat that appears to be neither
! 287: version 6.* or version 7.*.
! 288: Please consult CVS:doc/otherfiles/perl_modules.txt for a detailed
! 289: description of all the perl modules that should be on your system.
! 290: You may also want to look at the contents of this script
! 291: (CVS:loncom/build/system_dependencies/perltest.pl).
! 292: You can retrieve needed perl modules from http://www.cpan.org/.
! 293: END
! 294: }
! 295: }
! 296: else {
! 297: print(<<END);
! 298: You appear to be running a non-RedHat system. Please consult
! 299: CVS:doc/otherfiles/perl_modules.txt for a detailed description of
! 300: all the perl modules that should be on your system. You
! 301: may also want to look at the contents of this script
! 302: (CVS:loncom/build/system_dependencies/perltest.pl).
! 303: You can retrieve needed perl modules from http://www.cpan.org/.
! 304: END
! 305: }
! 306: }
1.1 harris41 307: exit $errorflag;
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>