home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume38 / lude / part07 < prev    next >
Encoding:
Text File  |  1993-07-11  |  65.5 KB  |  2,326 lines

  1. Newsgroups: comp.sources.misc
  2. From: laplante@crim.ca (Pierre Laplante)
  3. Subject: v38i039:  lude - A Distributed Software Library, Part07/12
  4. Message-ID: <1993Jul11.224646.16647@sparky.imd.sterling.com>
  5. X-Md4-Signature: 68711d7fb2994c7b51d7bd0d03ad6d7d
  6. Sender: kent@sparky.imd.sterling.com (Kent Landfield)
  7. Organization: Sterling Software
  8. Date: Sun, 11 Jul 1993 22:46:46 GMT
  9. Approved: kent@sparky.sterling.com
  10.  
  11. Submitted-by: laplante@crim.ca (Pierre Laplante)
  12. Posting-number: Volume 38, Issue 39
  13. Archive-name: lude/part07
  14. Environment: UNIX
  15.  
  16. #! /bin/sh
  17. # This is a shell archive.  Remove anything before this line, then feed it
  18. # into a shell via "sh file" or similar.  To overwrite existing files,
  19. # type "sh file -c".
  20. # Contents:  lude-1.1/run/crim/sun4.1_sparc/bin/ludeindex
  21. #   lude-1.1/run/crim/sun4.1_sparc/include/lude/ludeadminc
  22. #   lude-1.1/run/crim/sun4.1_sparc/lib/WWW/default.html
  23. #   lude-1.1/src/orig/src/ludeindex
  24. # Wrapped by kent@sparky on Sun Jul 11 15:49:14 1993
  25. PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
  26. echo If this archive is complete, you will see the following message:
  27. echo '          "shar: End of archive 7 (of 12)."'
  28. if test -f 'lude-1.1/run/crim/sun4.1_sparc/bin/ludeindex' -a "${1}" != "-c" ; then 
  29.   echo shar: Will not clobber existing file \"'lude-1.1/run/crim/sun4.1_sparc/bin/ludeindex'\"
  30. else
  31.   echo shar: Extracting \"'lude-1.1/run/crim/sun4.1_sparc/bin/ludeindex'\" \(25280 characters\)
  32.   sed "s/^X//" >'lude-1.1/run/crim/sun4.1_sparc/bin/ludeindex' <<'END_OF_FILE'
  33. X#! /usr/local/bin/perl
  34. X
  35. X# Program to index the man pages, info files and lude entries
  36. X# Copyright (C) 1992, 1993 Duong Thanh Long and Michel Dagenais
  37. X#
  38. X#
  39. X# This file is part of Lude
  40. X#
  41. X# Lude is free software; you can redistribute it and/or modify
  42. X# it under the terms of the GNU General Public License as published by
  43. X# the Free Software Foundation; either version 2, or (at your option)
  44. X# any later version.
  45. X#
  46. X# Lude is distributed in the hope that it will be useful,
  47. X# but WITHOUT ANY WARRANTY; without even the implied warranty of
  48. X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  49. X# GNU General Public License for more details.
  50. X#
  51. X# You should have received a copy of the GNU General Public License
  52. X# along with Lude; see the file COPYING.  If not, write to
  53. X# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  54. X#
  55. X#
  56. X##########################################################################
  57. X#
  58. X# A first prototype of Ludeindex was realised by Duong Thanh Long 
  59. X# as an undergraduate project under the supervision of Michel Dagenais, 
  60. X# in the department of electrical and computer engineering at Ecole 
  61. X# Polytechnique de Montreal.
  62. X#
  63. X# It was subsequently rewritten and integrated into Lude by Michel Dagenais.
  64. X# 26 january 1993
  65. X#
  66. X##########################################################################
  67. X
  68. X#-----------------------------------------------------------------------
  69. X#
  70. X#    Globals definitions
  71. X#
  72. X
  73. X$FULL_VERSION=
  74. X    "-- ludeindex --\n" .
  75. X    "This is part of LUDE (Logitheque Universitaire Distribuee et Extensible)\n\n";
  76. X
  77. X$FULL_VERSION.='$Id: ludeindex,v 1.5 1993/06/14 20:09:11 dagenais Exp $' . "\n";
  78. X
  79. X$VERSION='1.1';
  80. X
  81. X$PL_INCDIR="/usr/local/soft/lude-1.1/run/crim/sun4.1_sparc/include/lude:../include";
  82. X$LANG_PATH="/usr/local/soft/lude-1.1/run/crim/sun4.1_sparc/lib/lude/lang:../lib/lude/lang:../lang";
  83. X
  84. Xmain: {
  85. X    local($exitval)=0;        # Success by default
  86. X
  87. X    unshift(@INC, split(/:/, $PL_INCDIR));
  88. X
  89. X    require('config.pl');
  90. X
  91. X    # Load and initialise the language support immediatly so
  92. X    # that the messages are available the soonest possible.
  93. X    # If an error occure in this phase, the execution is 
  94. X    # immediatly aborted.
  95. X    require('ludelang.pl');
  96. X    &InitLang($CONF_LANG_DEFAULT, $LANG_PATH, 'ludeindex', @ARGV);
  97. X
  98. X    # Some useful definitions
  99. X    if (!defined($DEFAULTDEBUGLEVEL)) { $DEFAULTDEBUGLEVEL=9; }
  100. X    if (!defined($TRUE))              { $TRUE=1; }
  101. X    if (!defined($FALSE))             { $FALSE=0; }
  102. X    if (!defined($ERROR))             { $ERROR=STDERR; }
  103. X    if (!defined($OUT))               { $OUT=STDOUT; }
  104. X
  105. X    # Environnement
  106. X    
  107. X    $ENV{'SHELL'} = '/bin/sh' if $ENV{'SHELL'} ne '';
  108. X    
  109. X    # debug level
  110. X    
  111. X    if (!defined($Debugvalue)) { $Debugvalue=$DEFAULTDEBUGLEVEL; }
  112. X    
  113. X    $CatMan=$FALSE;
  114. X    $WAISMan=$FALSE;
  115. X    $Info=$FALSE;
  116. X    $WWWSoft=$FALSE;
  117. X    $WAISSoft=$FALSE;
  118. X    $RemoteLink=$FALSE;
  119. X    $NoWWWExt=$FALSE;
  120. X    $Show=$FALSE;
  121. X    $Verbose=$FALSE;
  122. X    $Help=$FALSE;
  123. X
  124. X    # Some useful definitions and default values
  125. X    #
  126. X    $LUDEWWW    = "$LOCAL_DIR/lib/WWW/lude";
  127. X    $LUDEWAIS   = "$LOCAL_DIR/lib/WAIS";
  128. X    $INSTALLDIR = "$LOCAL_DIR/doc";
  129. X    $MANDIR     = "$LOCAL_DIR/man";
  130. X
  131. X    $PathCatMan = "$CONF_SYS_MAN_PATH:$MANDIR";
  132. X    $PathWAISMan = $PathCatMan;
  133. X    $PathInfo   = "$LOCAL_DIR/info";
  134. X    $PathSoft   = "$LOCAL_DIR/soft";
  135. X    $HostWWW    = "localhost";
  136. X    $HostWAIS   = "localhost";
  137. X    $PortWWW    = 80;
  138. X    $PortWAIS   = 210;
  139. X
  140. X    $LocalSoft  = "$LOCAL_DIR/soft";
  141. X    $ServerSoft = "$SERVER_DIR";
  142. X    $IsLocal = $FALSE;
  143. X    $IsServer = '';
  144. X    
  145. X    #
  146. X    # commands that may change with various operating system flavors
  147. X    #
  148. X    $MAKEWHATIS = "catman -w -M";
  149. X    $MAKEINFO = "cat diri.top *.dir >dir";
  150. X    $MAKEWWW  = "cat dirh.top *.dir dirh.end >dir.html";
  151. X    $MAKEWAIS = "waisindex -d $LUDEWAIS/lude -T HTML -t para $LUDEWAIS/man/* $LUDEWAIS/soft/*";
  152. X
  153. X
  154. X    require("ludeindexinc");    # argument parsing
  155. X    require("fileutil.pl");
  156. X    require("BldRegexpMinRqr.pl");
  157. X
  158. X    # get progname
  159. X
  160. X    $PGM=&BaseName($0);
  161. X    
  162. X    #
  163. X    # Field names that change with the language
  164. X    #
  165. X
  166. X#    %No_field = ();
  167. X#    $No_field{$FIELD{$USAGE}} = 1;
  168. X#    $No_field{$FIELD{$INSTALL}} = 1;
  169. X#    $No_field{$FIELD{$DESCRIPTION}} = 1;
  170. X#    $No_field{$FIELD{$ABSTRACT}} = 1;
  171. X
  172. X    &Initialisation;
  173. X
  174. X    if($Help) { &Help; }
  175. X    if($CatMan) { &MakeManPagesIndex; }
  176. X    if($Info) { &MakeInfo; }
  177. X    if($WAISMan) { &MakeWAISMan; }
  178. X    if($WWWSoft) { &MakeWWWSoft; }
  179. X    if($WAISMan || $WAISSoft) { &MakeWAIS; }
  180. X
  181. X    exit($exitval);
  182. X}
  183. X
  184. X####################################################################
  185. X#
  186. X# First, index the man pages if one of the man directories is newer
  187. X# than the index in the whatis file and if the
  188. X# file whatis already exists.
  189. X#
  190. Xsub MakeManPagesIndex {
  191. X  #
  192. X  # list the components in the man path
  193. X  #
  194. X  local(@manpath) = split(/:/, $PathCatMan);
  195. X  local($thisdir)  = '';
  196. X  local(@allfiles) = '';
  197. X  local($newest);
  198. X  local($mandir);
  199. X
  200. X  foreach $mandir (@manpath) {
  201. X
  202. X    opendir(thisdir, "$mandir");
  203. X    # Note that the files '.' and '..' are not retained 
  204. X    @allfiles = grep(! /^\.{1,2}$/, readdir(thisdir));
  205. X    closedir(thisdir);                                 
  206. X
  207. X    $newest = $allfiles[0];
  208. X    $mtime = 0;
  209. X
  210. X    ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
  211. X     $atime,$mtime,$ctime,$blksize,$blocks) = stat("$mandir/$newest");
  212. X
  213. X    $newest_time = $mtime;
  214. X    $mtime = 0;
  215. X
  216. X    foreach $filename (@allfiles) {
  217. X      ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
  218. X       $atime,$mtime,$ctime,$blksize,$blocks) = stat("$mandir/$filename");
  219. X
  220. X      if($newest_time < $mtime) {
  221. X    $newest = $filename;
  222. X    $newest_time = $mtime;
  223. X      }
  224. X    }
  225. X
  226. X    #
  227. X    # If a subdirectory is newer than the whatis index, call
  228. X    # the catman indexing command.
  229. X    #
  230. X
  231. X    if ($newest eq '' ) {
  232. X      print "$PGM: ${mandir} $TEXT[$BAD_MAN_DIR]\n";
  233. X    }
  234. X    elsif ($newest eq "whatis") {
  235. X      if($Verbose) { print "$PGM: ${mandir}/whatis $TEXT[$MAN_TO_DATE]\n"; }
  236. X    }
  237. X    else {
  238. X      if($Verbose) { print sprintf("$PGM: $TEXT[$MAN_INDEXING]\n",
  239. X                                   $mandir,$newest); }
  240. X      if($Show) { print "$MAKEWHATIS $mandir\n"; }
  241. X      else { system "$MAKEWHATIS $mandir"; }
  242. X
  243. X      if($Verbose) { print "$TEXT[$IS_DONE]\n\n"; }
  244. X    }
  245. X  }
  246. X}
  247. X
  248. X#################################################################
  249. X#
  250. X# The main menu for the info files is rebuilt if the directory
  251. X# was modified (an entry added or removed) and if the top.dir
  252. X# file exists.
  253. X#
  254. Xsub MakeInfo {
  255. X
  256. X  local(@infopath) = split(/[:]/, $PathInfo);
  257. X  local($infodir);
  258. X
  259. X  foreach $infodir (@infopath) {
  260. X
  261. X    chdir $infodir;
  262. X
  263. X    $infomtime = 0;
  264. X    $dirmtime = 0;
  265. X
  266. X    ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
  267. X     $atime,$infomtime,$ctime,$blksize,$blocks) = stat("$infodir");
  268. X
  269. X    ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
  270. X     $atime,$dirmtime,$ctime,$blksize,$blocks) = stat("$infodir/dir");
  271. X
  272. X    if ($infomtime == 0) {
  273. X      print "$PGM: ${infodir} $TEXT[$BAD_MAN_DIR]\n";
  274. X    }
  275. X    elsif($infomtime > $dirmtime) {
  276. X
  277. X      if($Verbose) { print "$PGM: $TEXT[$INFO_UPDATE] ${infodir}/dir\n"; }
  278. X
  279. X      if($Show) { print "$MAKEINFO\n"; }
  280. X      else { system $MAKEINFO; }
  281. X
  282. X      if($Verbose) { print "$TEXT[$IS_DONE]\n\n"; }
  283. X    }
  284. X    else {
  285. X      if($Verbose) { print "$PGM: ${infodir}/dir $TEXT[$MAN_TO_DATE]\n"; }
  286. X    }
  287. X  }
  288. X}
  289. X
  290. X###############################################################
  291. X#
  292. X# Go through all the man pages in the path wais man and for
  293. X# each prepare a short summary for inclusion in the WAIS
  294. X# database.
  295. X#
  296. X
  297. Xsub MakeWAISMan {
  298. X  #
  299. X  # list the components in the man path
  300. X  #
  301. X  local(@manpath) = split(/:/, $PathWAISMan);
  302. X  local($waisfile);
  303. X  local($mandir);
  304. X  local($thisdir)  = '';
  305. X  local(@allfiles) = '';
  306. X  local($newest);
  307. X
  308. X  foreach $mandir (@manpath) {
  309. X
  310. X    #
  311. X    # each man tree gets its own WAIS file named after the
  312. X    # path with "/" replaced by "."
  313. X    #
  314. X    chdir $mandir;
  315. X    $waisfile = $mandir;
  316. X    $waisfile =~ s/\//./go;
  317. X    $waisfile = "$LUDEWAIS/man/wais$waisfile";
  318. X
  319. X    opendir(thisdir, "$mandir");
  320. X    # Note that the files '.' and '..' are not retained 
  321. X    @allfiles = grep(! /^whatis$/,grep(! /^\.{1,2}$/, readdir(thisdir)));
  322. X    closedir(thisdir);                                 
  323. X
  324. X    $newest_time = 0;
  325. X    $mtime = 0;
  326. X    $newest = '';
  327. X
  328. X    foreach $filename (@allfiles) {
  329. X      ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
  330. X       $atime,$mtime,$ctime,$blksize,$blocks) = stat("$mandir/$filename");
  331. X
  332. X      if($newest_time < $mtime) {
  333. X    $newest = $filename;
  334. X    $newest_time = $mtime;
  335. X      }
  336. X    }
  337. X
  338. X    $mtime = 0;
  339. X
  340. X    ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
  341. X     $atime,$mtime,$ctime,$blksize,$blocks) = stat("$waisfile");
  342. X
  343. X    #
  344. X    # If a subdirectory is newer than the WAIS database, 
  345. X    # recreate it.
  346. X    #
  347. X
  348. X    if ($newest eq '' ) {
  349. X      print "$PGM: ${mandir} $TEXT[$BAD_MAN_DIR]\n";
  350. X    }
  351. X    elsif($newest_time < $mtime) {
  352. X      if($Verbose) { print "$PGM: ${mandir}, $TEXT[$WAIS_TO_DATE]\n"; }
  353. X    }
  354. X
  355. X    elsif($Show) {
  356. X      if($Verbose) {print "$PGM: $TEXT[$WAIS_MAN_BASE] $mandir\n"; }
  357. X    }
  358. X
  359. X    elsif(open(WAISFILE,">$waisfile")) {
  360. X
  361. X      if($Verbose) {print "$PGM: $TEXT[$WAIS_MAN_BASE] $mandir\n"; }
  362. X
  363. X      $Man_too_small = 0;
  364. X
  365. X      &ExtractWAISMan("$mandir","");
  366. X
  367. X      if ( $Man_too_small > 0 ) {
  368. X        if($Verbose) { printf sprintf("$TEXT[$NB_MAN_TOO_SMALL]\n",
  369. X                                      $Man_too_small); }
  370. X      }
  371. X
  372. X      close(WAISFILE);
  373. X      if($Verbose) { print "$TEXT[$IS_DONE]\n\n"; }
  374. X    }
  375. X    else {
  376. X      print "$PGM: ${waisfile} $TEXT[$BAD_MAN_DIR]\n";
  377. X    }
  378. X  }
  379. X}
  380. X
  381. X
  382. X#######################################################################
  383. X#
  384. X# Recursive function to extract the WAIS database abstract for
  385. X# each man page
  386. X#
  387. Xsub ExtractWAISMan {
  388. X  local($manDirName)=$_[0];
  389. X
  390. X  local(@allfiles,$filename,$name,$description);
  391. X  local(*man_dir, *man_file);
  392. X  local($ext);
  393. X
  394. X  opendir(man_dir, $manDirName);
  395. X  @allfiles = grep(! /^\.{1,2}$/, readdir(man_dir));
  396. X  closedir(man_dir);
  397. X
  398. X  foreach $filename (sort @allfiles) {
  399. X    if (-d "$manDirName/$filename") {
  400. X      &ExtractWAISMan("$manDirName/$filename", "$_[1]$filename/");
  401. X    }
  402. X    elsif ("$manDirName/$filename" =~ /\.[0-9ln][a-z]*$/o) {
  403. X
  404. X      # Files of less than 80 characters are not worth pursuing
  405. X      # because they are only sourcing other man pages that will
  406. X      # get indexed anyhow.
  407. X
  408. X      ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
  409. X       $atime,$infomtime,$ctime,$blksize,$blocks) =
  410. X     stat("$manDirName/$filename");
  411. X
  412. X      if( $size <= 80 ) {
  413. X    $Man_too_small++;
  414. X    next; 
  415. X      }
  416. X
  417. X      open(man_file,"nroff -Tcrt -man $manDirName/$filename |");
  418. X
  419. X      $description = '';
  420. X      $name = '';
  421. X
  422. X      #
  423. X      # Find the summary and use the first line as header
  424. X      #
  425. X
  426. X      while($_ = <man_file>) {
  427. X    if( /^NAME/ ) {
  428. X      $name = <man_file>;
  429. X      last;
  430. X    }
  431. X      }
  432. X
  433. X      #
  434. X      # Get the rest of the NAME field if more than one line long
  435. X      #
  436. X
  437. X      $long_name = $name;
  438. X      while($_ = <man_file>) {
  439. X
  440. X    s/_\010//go;
  441. X    if( /^\s*$/ ) {
  442. X      last;
  443. X    }
  444. X    $long_name = $long_name . $_;
  445. X      }
  446. X
  447. X      #
  448. X      # Find the description heading
  449. X      #
  450. X
  451. X      while($_ = <man_file>) {
  452. X    if( /^DESCRIPTION/ ) {
  453. X      last;
  454. X    }
  455. X      }
  456. X
  457. X      #
  458. X      # keep the first paragraph of the description
  459. X      #
  460. X
  461. X      while($_ = <man_file>) {
  462. X
  463. X    s/_\010//go;
  464. X    if( /^\s*$/ ) {
  465. X      last;
  466. X    }
  467. X    $description = $description . $_;
  468. X      }
  469. X
  470. X      close(man_file);
  471. X
  472. X      #
  473. X      # write this in the database file
  474. X      #
  475. X
  476. X      if($NoWWWExt) { $ext = ""; }
  477. X      else { $ext = ".man"; }
  478. X
  479. X      print WAISFILE "$name<TITLE>$filename</TITLE>\n<H1>$filename</H1>\n";
  480. X      print WAISFILE "<H2>NAME</H2>\n$long_name<P>\n";
  481. X      print WAISFILE "<H2>DESCRIPTION</H2>\n$description<P>\n";
  482. X
  483. X      print WAISFILE "<A HREF=http://$HostWWW:$PortWWW$manDirName/$filename$ext>$_[1]$filename</A>\n\n";
  484. X
  485. X    }
  486. X    else {
  487. X      if($Verbose) { print "$TEXT[$IGNORING_FILE] $manDirName/$filename\n"; }
  488. X    }
  489. X  }
  490. X}
  491. X
  492. X###############################################################
  493. X#
  494. X# For each software package, insure that an up to date html
  495. X# file is available. Create a new status file that tells which
  496. X# software is available where.
  497. X#
  498. X
  499. Xsub MakeWWWSoft {
  500. X  
  501. X  local(@softpath) = split(/:/, $PathSoft);
  502. X  local($thisdir)  = '';
  503. X  local(@allfiles) = '';
  504. X  local($newest);
  505. X  local($softdir);
  506. X  local($subdir);
  507. X  local(@subfiles);
  508. X  local($filename);
  509. X  local($subname);
  510. X  local($classname);
  511. X  local(@classfiles);
  512. X  local($classdir);
  513. X  local($softtime);
  514. X  local($htmltime);
  515. X  local($waistime);
  516. X
  517. X  # Remove all status files since it is safer to recreate them
  518. X  # every time.  
  519. X    
  520. X  if($Show) { print "rm -f $LUDEWWW/*.status.html\n"; }
  521. X  else { system "rm -f $LUDEWWW/*.status.html"; }
  522. X
  523. X  # Loop over all components of the Software path.
  524. X  # It often contains /usr/local/soft and /usr/local/server/*
  525. X
  526. X  foreach $softdir (@softpath) {
  527. X
  528. X    chdir $softdir;
  529. X
  530. X    if (! -d $softdir) {
  531. X      print "$PGM: ${softdir} $TEXT[$BAD_MAN_DIR]\n";
  532. X      next;
  533. X    }
  534. X
  535. X    if($Verbose) { print "$PGM: $TEXT[$HTML_UPDATING] $softdir\n"; }
  536. X
  537. X    # determine the type of software directory (local or server)
  538. X
  539. X    $IsLocal = $FALSE;
  540. X    $IsServer = '';
  541. X
  542. X    if($softdir =~ /^$LocalSoft/) { 
  543. X      $IsLocal = $TRUE; 
  544. X    }
  545. X    elsif($softdir =~ /^$ServerSoft/) {
  546. X      ($IsServer) = /^$ServerSoft\/(.*)/;
  547. X    }
  548. X
  549. X    # look at each software package
  550. X
  551. X    opendir(thisdir, $softdir);
  552. X    # Note that the files '.' and '..' are not retained 
  553. X    @allfiles = grep(! /^\.{1,2}$/, readdir(thisdir));
  554. X    closedir(thisdir);                                 
  555. X
  556. X    foreach $filename (@allfiles) {
  557. X
  558. X      $softtime = 0;
  559. X
  560. X      ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
  561. X       $atime,$softtime,$ctime,$blksize,$blocks) = 
  562. X                             stat("$softdir/$filename/install/IAFA-PACKAGES");
  563. X
  564. X      # This cannot be a valid software package
  565. X
  566. X      if($softtime == 0) { next; }
  567. X
  568. X      # Verify if this package is linked in /usr/local/bin
  569. X
  570. X      if($IsLocal) {
  571. X        if(readlink("$INSTALLDIR/$filename/IAFA-PACKAGES") eq
  572. X           "$softdir/$filename/install/IAFA-PACKAGES") {
  573. X          $IsLinked = $TRUE;
  574. X        }
  575. X        else {
  576. X          $IsLinked = $FALSE;
  577. X        }
  578. X      }
  579. X      # Check if a status file exists for this package
  580. X
  581. X      $htmltime = 0;
  582. X
  583. X      ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
  584. X       $atime,$htmltime,$ctime,$blksize,$blocks) = 
  585. X                                 stat("$LUDEWWW/${filename}.status.html");
  586. X
  587. X      if($Show) { 
  588. X        print "\n"; 
  589. X      }
  590. X      elsif($htmltime == 0) {
  591. X        open(STATUSFILE,">$LUDEWWW/${filename}.status.html");
  592. X        print STATUSFILE "<TITLE>$filename</TITLE>\n<H1>$filename</H1>\n";
  593. X      }
  594. X      else {
  595. X        open(STATUSFILE,">>$LUDEWWW/${filename}.status.html");
  596. X      }
  597. X     
  598. X      # Now check the time of the html file
  599. X
  600. X      $htmltime = 0;
  601. X
  602. X      ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
  603. X       $atime,$htmltime,$ctime,$blksize,$blocks) = 
  604. X                                 stat("$LUDEWWW/${filename}.html");
  605. X
  606. X      # Check also the wais abstract if requested
  607. X
  608. X      if($WAISSoft) {
  609. X        $waistime = 0;
  610. X
  611. X        ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
  612. X         $atime,$waistime,$ctime,$blksize,$blocks) = 
  613. X                                   stat("$LUDEWAIS/soft/$filename");
  614. X        if($waistime < $htmltime) {
  615. X          $htmltime = $waistime;
  616. X        }
  617. X      }
  618. X
  619. X      # The html file for the software should be regenerated
  620. X      # the accompanying .dir and wais files are done at 
  621. X      # the same time
  622. X
  623. X      if($htmltime == 0 || $htmltime < $softtime) {
  624. X    if($Show) {
  625. X          print "MakeHTMLfile($softdir/$filename/install/IAFA-PACKAGES)\n";
  626. X        }
  627. X    else {
  628. X          &MakeHTMLfile("$softdir/$filename/install/IAFA-PACKAGES",
  629. X                      $filename,$TRUE);
  630. X        }
  631. X      }
  632. X
  633. X      # Check also the html file for the modifications,
  634. X      # loop over the modifications in the install dir.
  635. X
  636. X      opendir(subdir, "$softdir/$filename/install");
  637. X      # Note that the files '.' and '..' are not retained 
  638. X      @subfiles = grep(! /^IAFA-PACKAGES$/,
  639. X                         grep(! /^share$/,
  640. X                         grep(! /^\.{1,2}$/, readdir(subdir))));
  641. X      closedir(subdir);                                 
  642. X
  643. X      foreach $subname (@subfiles) {
  644. X
  645. X        $softtime = 0;
  646. X
  647. X        ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
  648. X         $atime,$softtime,$ctime,$blksize,$blocks) = 
  649. X                            stat("$softdir/$filename/install/$subname/LUDE");
  650. X
  651. X        $htmltime = 0;
  652. X
  653. X        ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
  654. X         $atime,$htmltime,$ctime,$blksize,$blocks) = 
  655. X                                 stat("$LUDEWWW/$filename/${subname}.html");
  656. X
  657. X        if($htmltime == 0 || $htmltime < $softtime) {
  658. X
  659. X          if(! -d "$LUDEWWW/$filename") {
  660. X            if(! $Show) { mkdir("$LUDEWWW/$filename",0755); }
  661. X          }
  662. X
  663. X      if($Show) {
  664. X            print "MakeHTMLfile($softdir/$filename/install/$subname/LUDE)\n";
  665. X          }
  666. X          else {
  667. X        &MakeHTMLfile("$softdir/$filename/install/$subname/LUDE",
  668. X                        "$filename/$subname",$FALSE);
  669. X          }
  670. X        }
  671. X
  672. X        # Check the classes available and update the status file
  673. X
  674. X        opendir(classdir, "$softdir/$filename/install/$subname");
  675. X        # Note that the files '.' and '..' are not retained 
  676. X        @classfiles = grep(! /^LUDE$/,
  677. X                         grep(! /^share$/,
  678. X                         grep(! /^\.{1,2}$/, readdir(classdir))));
  679. X        closedir(classdir);                                 
  680. X
  681. X        foreach $classname (@classfiles) {
  682. X
  683. X          if($Show) {
  684. X            print "MakeStatusFileEntry($softdir,$filename,$subname,$classname)\n";
  685. X          }
  686. X          else {
  687. X            &MakeStatusFileEntry($softdir,$filename,$subname,$classname);
  688. X          }
  689. X        }
  690. X      }     # for each modification
  691. X    
  692. X      if(! $Show) { close(STATUSFILE); }
  693. X
  694. X    }           # for each software
  695. X  }             # for each path component
  696. X
  697. X  # All the dir files can be concatenated to produce the main menu
  698. X
  699. X  if($Verbose) { print "$PGM: $TEXT[$HTML_UPDATING_MENU]\n"; }
  700. X
  701. X  if($Show) {
  702. X    print "chdir $LUDEWWW\n";
  703. X    print "$MAKEWWW\n";
  704. X  }
  705. X  else {
  706. X    chdir $LUDEWWW ;
  707. X    system $MAKEWWW ;
  708. X  }
  709. X
  710. X  if($Verbose) { print "$TEXT[$IS_DONE]\n\n"; }
  711. X
  712. X}
  713. X
  714. X
  715. X###########################################################
  716. X#
  717. X# Convert a IAFA-PACKAGES file into a HTML file
  718. X# and create the associated dir and wais files
  719. X#
  720. X
  721. Xsub MakeHTMLfile {
  722. X
  723. X  local($ludefile) = $_[0];
  724. X  local($software) = $_[1];
  725. X  local($notmodif) = $_[2];
  726. X  local(*html_file,*this_file);
  727. X
  728. X  if(!open(html_file,">$LUDEWWW/${software}.html")) {
  729. X    print "$PGM: $TEXT[$CANNOT_ACCESS] $LUDEWWW/${software}.html\n";
  730. X  }
  731. X  if(!open(this_file,$ludefile)) {
  732. X    print "$PGM: $TEXT[$CANNOT_ACCESS] $ludefile\n";
  733. X  }
  734. X
  735. X  $abstract = '';
  736. X  $description = '';
  737. X
  738. X  print html_file "<TITLE>$software</TITLE>\n";
  739. X  print html_file "<H1>$software</H1>\n";
  740. X
  741. X  # Read the file, when encountering a new field name, output the
  742. X  # previous field if not empty and not in the "no" list. Otherwise
  743. X  # accumulate the lines in the current field.
  744. X
  745. X  $in_description = 0;
  746. X  $in_abstract = 0;
  747. X  $fieldname = '';
  748. X  $field = '';
  749. X  while($_ = <this_file>) {
  750. X
  751. X    $found = /^([a-zA-Z-]*:)(.*)/;
  752. X    $newname = $1;
  753. X    $newfield = $2 . "\n";
  754. X
  755. X    if ($found eq '') {
  756. X      $field = $field . $_;
  757. X      if ( /^\s*$/ ) {
  758. X        $in_description = 0;
  759. X    $in_abstract = 0;
  760. X      }
  761. X
  762. X      if( $in_description == 1) {
  763. X    $description .= $_;
  764. X      }
  765. X
  766. X      if( $in_abstract == 1) {
  767. X        $abstract .= $_;
  768. X      }
  769. X    }
  770. X    else {
  771. X      if (($fieldname ne '') && 
  772. X#          ($No_field{$fieldname} != 1) &&
  773. X      ($field =~ /[-a-zA-Z0-9]/)) {
  774. X                
  775. X    print html_file "<H3>${fieldname}</H3>\n$field\n"
  776. X      }
  777. X                
  778. X      $fieldname = $newname;
  779. X      $fieldname =~ tr/a-z/A-Z/;
  780. X      $field = $newfield;
  781. X                
  782. X      #
  783. X      # keep the description for the main menu
  784. X      #
  785. X
  786. X      if (($fieldname eq $FIELD[$DESCRIPTION]) &&
  787. X      ($field =~ /[-a-zA-Z0-9]/)) {
  788. X    $in_description = 1;
  789. X    $description = $field;
  790. X      }
  791. X                
  792. X      if (($fieldname eq $FIELD[$ABSTRACT]) &&
  793. X      ($field =~ /[-a-zA-Z0-9]/)) {
  794. X    $in_abstract = 1;
  795. X    $abstract = $field;
  796. X      }
  797. X    }
  798. X  }
  799. X
  800. X  if (($fieldname ne '') && 
  801. X#      ($No_field{$fieldname} != 1) && 
  802. X      ($field =~ /[-a-zA-Z0-9]/)) {
  803. X            
  804. X    print html_file "<H3>${fieldname}</H3>\n$field\n";
  805. X  }
  806. X
  807. X  close this_file;
  808. X            
  809. X  # The html file was produced. If this is not simply a modification,
  810. X  # a dir file and perhaps a WAIS file should be created.
  811. X        
  812. X  if($notmodif) {
  813. X
  814. X    # A reference is added to the status file
  815. X
  816. X    print html_file "<H3>$TEXT[$SOFT_AVAILABILITY]</H3>\n";
  817. X    print html_file "<A HREF=http://$HostWWW:$PortWWW$LUDEWWW/${software}.status.html>$software</A>\n\n";
  818. X    close html_file;
  819. X
  820. X    # the dir file is created
  821. X
  822. X    open(html_file,">$LUDEWWW/${software}.dir");
  823. X    print html_file "<DT><A HREF=http://$HostWWW:$PortWWW${LUDEWWW}/${software}.html>$software</A><DD>$abstract\n";
  824. X    close html_file;
  825. X
  826. X    # the WAIS file is created if needed
  827. X
  828. X    if($WAISSoft) {
  829. X
  830. X      if( !open(html_file,">$LUDEWAIS/soft/${software}")) {
  831. X        print "$PGM: $TEXT[$CANNOT_ACCESS] $LUDEWAIS/soft/${software}\n";
  832. X      }
  833. X      else {
  834. X        chop $abstract;
  835. X        print html_file "$software $abstract\n";
  836. X        print html_file "<TITLE>$software</TITLE>\n<H1>$software</H1>\n";
  837. X        print html_file "<H2>$FIELD[$DESCRIPTION]</H2>\n$description<P>\n";
  838. X        print html_file "<A HREF=http://$HostWWW:$PortWWW${LUDEWWW}/${software}.html>$software</A>\n\n";
  839. X        close html_file;
  840. X      }
  841. X
  842. X    }
  843. X  }
  844. X  else {
  845. X    close html_file;
  846. X  }
  847. X}    
  848. X
  849. X##########################################################
  850. X
  851. Xsub MakeStatusFileEntry {
  852. X
  853. X  local($softdir) = $_[0];
  854. X  local($software) = $_[1];
  855. X  local($modif) = $_[2];
  856. X  local($class) = $_[3];
  857. X
  858. X  # output one line in the status file
  859. X
  860. X  if($IsLocal) { 
  861. X    if($IsLinked) {
  862. X      print STATUSFILE 
  863. X            sprintf("<P>$TEXT[$CLASS_IS_LINKED]\n",$software,$modif,$class);  
  864. X    }
  865. X    else {
  866. X      print STATUSFILE 
  867. X            sprintf("<P>$TEXT[$CLASS_IS_LOCAL]\n",
  868. X                    $software,$modif,$class,$softdir);  
  869. X    }
  870. X  }
  871. X  elsif($IsServer ne '') {
  872. X    print STATUSFILE 
  873. X          sprintf("<P>$TEXT[$CLASS_ON_SERVER]\n",$software,$modif,$class,$IsServer);  
  874. X  }
  875. X  else {
  876. X    print STATUSFILE 
  877. X          sprintf("<P>$TEXT[$CLASS_ELSEWHERE]\n",$software,$modif,$class,$softdir);  
  878. X  }
  879. X
  880. X  # Put out a link to the modification
  881. X
  882. X  print STATUSFILE "<P><A HREF=$LUDEWWW/$software/${modif}.html>$modif</A>\n\n";
  883. X
  884. X  # If needed, list doc/info/man pages
  885. X
  886. X  if($IsLocal || $RemoteLink) {
  887. X
  888. X    print STATUSFILE "<P>\n";
  889. X
  890. X    if(-d "$softdir/$software/run/$modif/$class/doc") {
  891. X      &MakeDocLinks("$softdir/$software/run/$modif/$class/doc",
  892. X                    "doc/","","");
  893. X    }
  894. X
  895. X    if(-d "$softdir/$software/run/$modif/$class/info") {
  896. X      &MakeDocLinks("$softdir/$software/run/$modif/$class/info",
  897. X                    "info/",'^((.*\.dir$)|(.*[0-9]$)|(dir)|(dir\.top)|(COPYING))$',
  898. X                    ".info");
  899. X    }
  900. X
  901. X    if(-d "$softdir/$software/run/$modif/$class/man") {
  902. X      &MakeDocLinks("$softdir/$software/run/$modif/$class/man",
  903. X                    "",'^whatis$',".man");
  904. X    }
  905. X  }
  906. X}
  907. X
  908. X####################################################################
  909. X#
  910. X# Search for documentation files in the software tree and
  911. X# put out links to them in the status file
  912. X
  913. Xsub MakeDocLinks {
  914. X
  915. X  local($htmlLinksDirName, $radix, $filePattern, $ext) = @_;
  916. X  local(@allfiles,$filename);
  917. X  local(*html_links_dir);
  918. X
  919. X  if($NoWWWExt) {
  920. X    $ext = "";
  921. X  }
  922. X
  923. X  opendir(html_links_dir, $htmlLinksDirName);
  924. X  @allfiles = grep(! /^\.{1,2}$/, readdir(html_links_dir));
  925. X  closedir(html_links_dir);
  926. X
  927. X  # ignore ordinary files, follow recursively subdirectories
  928. X  # (adding the filename to both the directory name and to the 
  929. X  #  short name radix) and process symbolic links
  930. X
  931. X  foreach $filename (@allfiles) {
  932. X    if (-d "$htmlLinksDirName/$filename") {
  933. X      &MakeDocLinks("$htmlLinksDirName/$filename", "$radix$filename/",
  934. X             $filePattern,$ext);
  935. X    }
  936. X    else {
  937. X      if (!($filename =~ /$filePattern/)) {
  938. X
  939. X        print STATUSFILE 
  940. X              "<A HREF=$htmlLinksDirName/$filename$ext>$radix$filename</A>\n";
  941. X      }
  942. X      else {
  943. X    if($Verbose) { print "$TEXT[$IGNORING_FILE] $htmlLinksDirName/$filename\n"; }
  944. X      }
  945. X    }
  946. X  }
  947. X}
  948. X
  949. X####################################################################
  950. X#
  951. X# Rebuild the WAIS database
  952. X#
  953. X
  954. Xsub MakeWAIS {
  955. X
  956. X  local($database_cover) = "${HostWAIS}:${PortWAIS}:lude.html";
  957. X  local(*waisfile);
  958. X
  959. X  if($Verbose) { print "$PGM: $TEXT[$WAIS_INDEXING]\n"; }
  960. X
  961. X  if($Show) {
  962. X    print "$MAKEWAIS\n";
  963. X    print "symlink($LUDEWAIS/lude.html,$LUDEWAIS/$database_cover)\n";
  964. X  }
  965. X  else {  
  966. X
  967. X    system $MAKEWAIS;
  968. X    
  969. X    # We must force the HTML type in this binary one line file.
  970. X    # The -T option in waisindex should have done it ?!
  971. X
  972. X    open(waisfile,"$LUDEWAIS/lude.fn");
  973. X    $_ = <waisfile>;
  974. X    close(waisfile);
  975. X    open(waisfile,">$LUDEWAIS/lude.fn");
  976. X    s/TEXT/HTML/g;
  977. X    print waisfile $_;
  978. X    close(waisfile);
  979. X
  980. X    # The cover page must have specially formatted name
  981. X
  982. X    symlink("$LUDEWAIS/lude.html","$LUDEWAIS/$database_cover");
  983. X  }
  984. X
  985. X  if($Verbose) { print "\n$TEXT[$IS_DONE]\n"; }
  986. X}
  987. X
  988. X### Local Variables: ***
  989. X### mode: perl ***
  990. X### End: ***
  991. X
  992. END_OF_FILE
  993.   if test 25280 -ne `wc -c <'lude-1.1/run/crim/sun4.1_sparc/bin/ludeindex'`; then
  994.     echo shar: \"'lude-1.1/run/crim/sun4.1_sparc/bin/ludeindex'\" unpacked with wrong size!
  995.   fi
  996.   chmod +x 'lude-1.1/run/crim/sun4.1_sparc/bin/ludeindex'
  997.   # end of 'lude-1.1/run/crim/sun4.1_sparc/bin/ludeindex'
  998. fi
  999. if test -f 'lude-1.1/run/crim/sun4.1_sparc/include/lude/ludeadminc' -a "${1}" != "-c" ; then 
  1000.   echo shar: Will not clobber existing file \"'lude-1.1/run/crim/sun4.1_sparc/include/lude/ludeadminc'\"
  1001. else
  1002.   echo shar: Extracting \"'lude-1.1/run/crim/sun4.1_sparc/include/lude/ludeadminc'\" \(8880 characters\)
  1003.   sed "s/^X//" >'lude-1.1/run/crim/sun4.1_sparc/include/lude/ludeadminc' <<'END_OF_FILE'
  1004. X# ludeadminc - Project lude.
  1005. X# Copyright (C) 1991,1992  Pierre Laplante
  1006. X# Copyright (C) 1992,1993 Stephane Boucher, Ecole Polytechnique de Montreal.
  1007. X#
  1008. X# This program is free software; you can redistribute it and/or modify
  1009. X# it under the terms of the GNU General Public License as published by
  1010. X# the Free Software Foundation; either version 1, or (at your option)
  1011. X# any later version.
  1012. X#
  1013. X# This program is distributed in the hope that it will be useful,
  1014. X# but WITHOUT ANY WARRANTY; without even the implied warranty of
  1015. X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  1016. X# GNU General Public License for more details.
  1017. X#
  1018. X# You should have received a copy of the GNU General Public License
  1019. X# along with this program; if not, write to the Free Software
  1020. X# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  1021. X
  1022. X$FULL_VERSION.= '$Id: ludeadminc,v 1.4 1993/03/17 19:44:08 sbo Exp $' ."\n";
  1023. X
  1024. X#-----------------------------------------------------------------------
  1025. X#
  1026. X#    Local definitions
  1027. X#
  1028. X
  1029. Xsub localDef {
  1030. X    
  1031. X# Environnement
  1032. X    
  1033. X    $ENV{'SHELL'} = '/bin/sh' if $ENV{'SHELL'} ne '';
  1034. X    
  1035. X    # debug level
  1036. X    if (!defined($Debugvalue)) { $Debugvalue=$DEFAULTDEBUGLEVEL; }
  1037. X    
  1038. X    # get progname
  1039. X    $Progname=&BaseName($0);
  1040. X    
  1041. X    $Server=$Software=$Modification="";
  1042. X    $Create=$Mount_tfs=$Umount_tfs=$Lock=$Release=$FALSE;
  1043. X    $Duplicate=$Unduplicate=$FALSE;
  1044. X    $Show=$Verbose=$FALSE;
  1045. X}
  1046. X
  1047. X
  1048. Xsub ExecCommands {
  1049. X    local($retval)=1;        # Success by default
  1050. X
  1051. X    if ($Server ne '/') {
  1052. X    &DispSoftFoundOnce("$SERVER_DIR/$Server", $Software, $Modification, $Class);
  1053. X    }
  1054. X    else {
  1055. X    &DispSoftFoundOnce("$SOFT_DIR", $Software, $Modification, $Class);
  1056. X    }
  1057. X
  1058. X    if ($Create) {
  1059. X    &Verbose($VERB_START_CREATE, $Software, $Modification, $Class);
  1060. X    if (! &Create($Server, $Software, $Modification, $Class)) {
  1061. X        return 0;
  1062. X    }
  1063. X    &Warning($VERB_CREATE_DONE);
  1064. X    &HistAppend("create", $Server, $Software, $Modification, $Class);
  1065. X    }
  1066. X    if ($Duplicate) {
  1067. X    &Verbose($VERB_START_DUPLICATE, "$Software/src/$Modification");
  1068. X    if (&Duplicate($Server, $Software, $Modification)) {
  1069. X        return 0;
  1070. X    }
  1071. X    &Warning($VERB_DUPLICATE_DONE);
  1072. X    &HistAppend("duplicate", $Server, $Software, $Modification, '');
  1073. X    }
  1074. X    if ($Unduplicate) {
  1075. X    &Verbose($VERB_START_UNDUPLICATE, "$Software/src/$Modification");
  1076. X    if (! &Unduplicate($Server, $Software, $Modification)) {
  1077. X        return 0;
  1078. X    }
  1079. X    &Warning($VERB_UNDUPLICATE_DONE);
  1080. X    &HistAppend("unduplicate", $Server, $Software, $Modification, '');
  1081. X    }
  1082. X    if ($Mount_tfs) {    
  1083. X    &Verbose($VERB_START_MOUNT_TFS);
  1084. X    if (! &Mount_tfs($Server, $Software, $Modification)) {
  1085. X        return 0;
  1086. X    }
  1087. X    &Warning($VERB_MOUNT_TFS_DONE);
  1088. X    &HistAppend("mount_tfs", $Server, $Software, $Modification, $Class);
  1089. X    }
  1090. X    if ($Umount_tfs) {    
  1091. X    &Verbose($VERB_START_UMOUNT_TFS);
  1092. X    if (! &Umount_tfs($Server, $Software, $Modification)) {
  1093. X        return 0;
  1094. X    }
  1095. X    &Warning($VERB_UMOUNT_TFS_DONE);
  1096. X    &HistAppend("umount_tfs", $Server, $Software, $Modification, $Class);
  1097. X    }
  1098. X    if ($Lock) {
  1099. X    &Verbose($VERB_START_LOCK);
  1100. X    if (! &Lock($Server, $Software, $Modification, $Class)) {
  1101. X        return 0;
  1102. X    }
  1103. X    &Warning($VERB_LOCK_DONE);
  1104. X    &HistAppend("lock", $Server, $Software, $Modification, $Class);
  1105. X    }
  1106. X    if ($Release) {
  1107. X    &Verbose($VERB_START_RELEASE);
  1108. X    if (! &Release($Server, $Software, $Modification, $Class)) {
  1109. X        return 0;
  1110. X    }
  1111. X    &Warning($VERB_RELEASE_DONE);
  1112. X    &HistAppend("release", $Server, $Software, $Modification, $Class);
  1113. X    }
  1114. X
  1115. X    return $retval;
  1116. X}
  1117. X
  1118. X
  1119. X#-----------------------------------------------------------------------
  1120. X#
  1121. X#    Initialisation
  1122. X#
  1123. X# Returns : the number of commands left to do
  1124. X#           or -1 if any error      
  1125. Xsub Initialisation {
  1126. X    local($retval)=1;        # success by default
  1127. X    local($cmdsToDo)=0;
  1128. X    local($displayVersion)=$FALSE;
  1129. X    local($displayFullVersion)=$FALSE;
  1130. X    
  1131. X# Globals definitions
  1132. X    
  1133. X# Locals definitions
  1134. X    
  1135. X    &localDef();
  1136. X    
  1137. X# scan aguments
  1138. X    
  1139. X    local($class_arg)       =&BldRegexpMinRqr('class', 2);
  1140. X    local($create_arg)      =&BldRegexpMinRqr('create', 2);
  1141. X    local($debug_arg)       =&BldRegexpMinRqr('debug', 2);
  1142. X    local($duplicate_arg)   =&BldRegexpMinRqr('duplicate', 2);
  1143. X    local($full_version_arg)=&BldRegexpMinRqr("full-version", 1);
  1144. X    local($help_arg)        =&BldRegexpMinRqr("help", 1);
  1145. X    local($language_arg)    ='language';
  1146. X    local($lock_arg)        =&BldRegexpMinRqr("lock", 2);
  1147. X    local($modification_arg)=&BldRegexpMinRqr("modification", 3);
  1148. X    local($mount_tfs_arg)   =&BldRegexpMinRqr("mount_tfs", 3);
  1149. X    local($release_arg)     =&BldRegexpMinRqr("release", 1);
  1150. X    local($server_arg)      =&BldRegexpMinRqr("server", 2);
  1151. X    local($show_arg)        =&BldRegexpMinRqr("show", 2);
  1152. X    local($software_arg)    =&BldRegexpMinRqr("software", 2);
  1153. X    local($umount_tfs_arg)  =&BldRegexpMinRqr('umount_tfs', 2);
  1154. X    local($unduplicate_arg) =&BldRegexpMinRqr('unduplicate', 2);
  1155. X    local($verbose_arg)     =&BldRegexpMinRqr("verbose", 4);
  1156. X    local($version_arg)     =&BldRegexpMinRqr("version", 4);
  1157. X
  1158. X    while ($_=$ARGV[0],/^-/) {
  1159. X
  1160. X    last if (/^--$/);
  1161. X
  1162. X    shift(@ARGV);
  1163. X      
  1164. X    if (/^-$class_arg$/o)        { &Arg($_, *Class, '[\-\w+.]+'); }
  1165. X    elsif (/^-$create_arg$/o)    { $cmdsToDo++; $Create=$TRUE; }
  1166. X    elsif (/^-$debug_arg$/o)     { &Arg($_, *Debuglevel, '[0-9]+'); }
  1167. X    elsif (/^-$duplicate_arg$/o) { $cmdsToDo++; $Duplicate=$TRUE; }
  1168. X    elsif (/^-$full_version_arg$/o) { $displayFullVersion=$TRUE; }
  1169. X    elsif (/^-($help_arg)|([?])$/o) { &Help; }
  1170. X        elsif (/^-$language_arg$/o)  { shift @ARGV; } # Just ignore it
  1171. X    elsif (/^-$lock_arg$/o)      { $cmdsToDo++; $Lock=$TRUE; }
  1172. X    elsif (/^-$modification_arg$/o) { 
  1173. X        &Arg($_, *Modification, '[\-\w+.]+'); 
  1174. X    }
  1175. X    elsif (/^-$mount_tfs_arg$/o) { 
  1176. X      if ($CONF_HAVE_TFS) { $cmdsToDo++; $Mount_tfs=$TRUE; }
  1177. X      else                { &Usage($ERR_TFS_NOT_SUPPORTED); }
  1178. X    }
  1179. X    elsif (/^-$release_arg$/o)   { $cmdsToDo++; $Release=$TRUE; }
  1180. X    elsif (/^-$show_arg$/o)      { $Show=$Verbose=$TRUE; }    # verbose implicit
  1181. X    elsif (/^-$server_arg$/o)    { &Arg($_, *Server, '[\-\w+.]+'); }
  1182. X    elsif (/^-$software_arg$/o)  { 
  1183. X        &Arg($_, *Software, '[\-\w+.]+'); 
  1184. X    }
  1185. X    elsif (/^-$umount_tfs_arg$/o){ $cmdsToDo++; $Umount_tfs=$TRUE; }
  1186. X    elsif (/^-$unduplicate_arg$/o) { $cmdsToDo++; $Unduplicate=$TRUE; }
  1187. X    elsif (/^-$verbose_arg$/o)   { $Verbose=$TRUE; }
  1188. X    elsif (/^-$version_arg$/o)   { $displayVersion=$TRUE; }
  1189. X    else {
  1190. X        &Usage($INVALID_ARGUMENT, $_);
  1191. X    }
  1192. X    }
  1193. X
  1194. X    # Display the version immediately if requested
  1195. X    if ($displayVersion) {
  1196. X    print $OUT $VERSION . "\n";
  1197. X    }
  1198. X    # Display the full version (i.e. RCS revs) immediately if requested
  1199. X    if ($displayFullVersion) {
  1200. X    print $OUT $FULL_VERSION . "\n";
  1201. X    }
  1202. X
  1203. X    #
  1204. X    # Validation of the arguments
  1205. X    #
  1206. X    # Extra and invalid argument 
  1207. X    if ( $ARGV[0] ne "" ) { 
  1208. X    &Usage($INVALID_ARGUMENT, $ARGV[0]);
  1209. X    }
  1210. X
  1211. X    # -class with anything
  1212. X    # -debug with anything
  1213. X    # -duplicate with anything but ... 
  1214. X    if ($Duplicate && ($Mount_tfs || $Umount_tfs || $Unduplicate)) {
  1215. X    &Usage($ERR_INCOMP_ARGS, '-mount_tfs|-umount_tfs|-unduplicate'); 
  1216. X    }
  1217. X    # -lock with anything
  1218. X    # -modification with anything
  1219. X    # -modification must be specified with...
  1220. X    if ($Modification eq '' && ($Create)) {
  1221. X    &Usage($ERR_ARG_REQUIRED, '-modification');
  1222. X    }
  1223. X    # -mount_tfs with anything but ...
  1224. X    if ($Mount_tfs && ($Umount_tfs)) {
  1225. X    &Usage($ERR_INCOMP_ARGS, '-mount_tfs', '-umount_tfs'); 
  1226. X    }
  1227. X    # -release with anything
  1228. X    # -server with anything
  1229. X    # -software with anything
  1230. X    # -software is required with ...
  1231. X    if ($Software eq '' && ($Create || $Mount_tfs || 
  1232. X                $Umount_tfs  || $Lock || $Release)) {
  1233. X    &Usage($ERR_ARG_REQUIRED, '-software');
  1234. X    }
  1235. X    # -umount_tfs with anything but ...
  1236. X    if ($Umount_tfs && ($Mount_tfs)) {
  1237. X    &Usage($ERR_INCOMP_ARGS, '-umount_tfs', '-mount_tfs'); 
  1238. X    }
  1239. X    # -unduplicate with anything but ... 
  1240. X    if ($Unduplicate && ($Mount_tfs || $Umount_tfs || $Duplicate)) {
  1241. X    &Usage($ERR_INCOMP_ARGS, '-mount_tfs|-umount_tfs|-duplicate'); 
  1242. X    }
  1243. X    # -verbose with anything
  1244. X
  1245. X    # Find the default class if not already specified
  1246. X    local(@classes);
  1247. X    if ($Class eq '') {
  1248. X    local($cmd);
  1249. X    if ($Create) {
  1250. X        $cmd='class';
  1251. X        chop($Class=`$cmd`);
  1252. X        @classes=($Class);
  1253. X    } 
  1254. X    else {
  1255. X        $cmd='class -l';
  1256. X        @classes=split(/\s+/, `$cmd`);
  1257. X    }
  1258. X    }
  1259. X    else {
  1260. X    @classes=($Class);
  1261. X    }
  1262. X
  1263. X    if (! $Create) {
  1264. X    # Find a server
  1265. X    local($searchcmd)='lst';
  1266. X
  1267. X    local(@serverfound)=
  1268. X        &FindSoftware($searchcmd, $Server, $Software, $Modification, @classes);
  1269. X    
  1270. X    # If the list @serverfound is empty, that means an error
  1271. X    if (scalar(@serverfound) == 0) {
  1272. X        &Error($ERR_NOSER, $Software);
  1273. X    }
  1274. X    else {
  1275. X        ($Server, $Software, $Modification, $Class)=
  1276. X        split($;, $serverfound[$[]);
  1277. X    }
  1278. X    }
  1279. X    elsif ($Server eq '') {
  1280. X    # Case of a create command with no server specified
  1281. X    $Server='/';
  1282. X    }
  1283. X
  1284. X    return $cmdsToDo;
  1285. X}    
  1286. X
  1287. X1;
  1288. X
  1289. X#     ;;; Local Variables: ***
  1290. X#     ;;; mode:perl ***
  1291. X#     ;;; End: ***
  1292. END_OF_FILE
  1293.   if test 8880 -ne `wc -c <'lude-1.1/run/crim/sun4.1_sparc/include/lude/ludeadminc'`; then
  1294.     echo shar: \"'lude-1.1/run/crim/sun4.1_sparc/include/lude/ludeadminc'\" unpacked with wrong size!
  1295.   fi
  1296.   # end of 'lude-1.1/run/crim/sun4.1_sparc/include/lude/ludeadminc'
  1297. fi
  1298. if test -f 'lude-1.1/run/crim/sun4.1_sparc/lib/WWW/default.html' -a "${1}" != "-c" ; then 
  1299.   echo shar: Will not clobber existing file \"'lude-1.1/run/crim/sun4.1_sparc/lib/WWW/default.html'\"
  1300. else
  1301.   echo shar: Extracting \"'lude-1.1/run/crim/sun4.1_sparc/lib/WWW/default.html'\" \(1356 characters\)
  1302.   sed "s/^X//" >'lude-1.1/run/crim/sun4.1_sparc/lib/WWW/default.html' <<'END_OF_FILE'
  1303. X<title>World Wide Web (WWW)</title>
  1304. X<h1>World Wide Web Entry Point</h1>
  1305. XThis entry connects to information available around the world
  1306. Xthrough World Wide Web (WWW), Wide Area Information System (WAIS)
  1307. Xand Gopher information servers. The information available
  1308. Xranges from library indexes, technical reports, geographical
  1309. Xdatabases, computer programs to weather updates.
  1310. X<DL>
  1311. X<DT><a href=local.html>local</a>
  1312. X<DD>Local information about your site, its organisation, resources
  1313. Xavailable, seminars, local weather.
  1314. X<DT><a href=http://localhost:80/usr/local/lib/WWW/lude/dir.html>Lude List</a>
  1315. X<DD>List of locally available software packages, in
  1316. Xthe LUDE library, and their documentation.
  1317. X<DT><a href=http://localhost:81/localhost:210/lude>Lude Index</a>
  1318. X<DD>Index of locally available software packages, in
  1319. Xthe LUDE library, for keyword searches.
  1320. X<DT><a href=http://info.cern.ch./hypertext/DataSources/bySubject/Overview.html>by Subject</a>
  1321. X<DD>A classification by subject of interest. Incomplete
  1322. Xbut easiest to use.
  1323. X<DT><a href=http://info.cern.ch./hypertext/DataSources/ByAccess.html>by Type</a>
  1324. X<DD>Looking by type of service (access protocol, etc)
  1325. Xmay allow to find things if you know what you are looking for.
  1326. X<DT><a href=http://info.cern.ch/hypertext/WWW/TheProject.html>About WWW</a>
  1327. X<DD>About the World-Wide Web global information sharing project
  1328. X</DL>
  1329. X
  1330. END_OF_FILE
  1331.   if test 1356 -ne `wc -c <'lude-1.1/run/crim/sun4.1_sparc/lib/WWW/default.html'`; then
  1332.     echo shar: \"'lude-1.1/run/crim/sun4.1_sparc/lib/WWW/default.html'\" unpacked with wrong size!
  1333.   fi
  1334.   # end of 'lude-1.1/run/crim/sun4.1_sparc/lib/WWW/default.html'
  1335. fi
  1336. if test -f 'lude-1.1/src/orig/src/ludeindex' -a "${1}" != "-c" ; then 
  1337.   echo shar: Will not clobber existing file \"'lude-1.1/src/orig/src/ludeindex'\"
  1338. else
  1339.   echo shar: Extracting \"'lude-1.1/src/orig/src/ludeindex'\" \(25189 characters\)
  1340.   sed "s/^X//" >'lude-1.1/src/orig/src/ludeindex' <<'END_OF_FILE'
  1341. X#! /usr/local/bin/perl
  1342. X
  1343. X# Program to index the man pages, info files and lude entries
  1344. X# Copyright (C) 1992, 1993 Duong Thanh Long and Michel Dagenais
  1345. X#
  1346. X#
  1347. X# This file is part of Lude
  1348. X#
  1349. X# Lude is free software; you can redistribute it and/or modify
  1350. X# it under the terms of the GNU General Public License as published by
  1351. X# the Free Software Foundation; either version 2, or (at your option)
  1352. X# any later version.
  1353. X#
  1354. X# Lude is distributed in the hope that it will be useful,
  1355. X# but WITHOUT ANY WARRANTY; without even the implied warranty of
  1356. X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  1357. X# GNU General Public License for more details.
  1358. X#
  1359. X# You should have received a copy of the GNU General Public License
  1360. X# along with Lude; see the file COPYING.  If not, write to
  1361. X# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  1362. X#
  1363. X#
  1364. X##########################################################################
  1365. X#
  1366. X# A first prototype of Ludeindex was realised by Duong Thanh Long 
  1367. X# as an undergraduate project under the supervision of Michel Dagenais, 
  1368. X# in the department of electrical and computer engineering at Ecole 
  1369. X# Polytechnique de Montreal.
  1370. X#
  1371. X# It was subsequently rewritten and integrated into Lude by Michel Dagenais.
  1372. X# 26 january 1993
  1373. X#
  1374. X##########################################################################
  1375. X
  1376. X#-----------------------------------------------------------------------
  1377. X#
  1378. X#    Globals definitions
  1379. X#
  1380. X
  1381. X$FULL_VERSION=
  1382. X    "-- ludeindex --\n" .
  1383. X    "This is part of LUDE (Logitheque Universitaire Distribuee et Extensible)\n\n";
  1384. X
  1385. X$FULL_VERSION.='$Id: ludeindex,v 1.5 1993/06/14 20:09:11 dagenais Exp $' . "\n";
  1386. X
  1387. X$VERSION='%VERSION%';
  1388. X
  1389. X$PL_INCDIR="%PL_INCDIR%:../include";
  1390. X$LANG_PATH="%LANG_PATH%:../lib/lude/lang:../lang";
  1391. X
  1392. Xmain: {
  1393. X    local($exitval)=0;        # Success by default
  1394. X
  1395. X    unshift(@INC, split(/:/, $PL_INCDIR));
  1396. X
  1397. X    require('config.pl');
  1398. X
  1399. X    # Load and initialise the language support immediatly so
  1400. X    # that the messages are available the soonest possible.
  1401. X    # If an error occure in this phase, the execution is 
  1402. X    # immediatly aborted.
  1403. X    require('ludelang.pl');
  1404. X    &InitLang($CONF_LANG_DEFAULT, $LANG_PATH, 'ludeindex', @ARGV);
  1405. X
  1406. X    # Some useful definitions
  1407. X    if (!defined($DEFAULTDEBUGLEVEL)) { $DEFAULTDEBUGLEVEL=9; }
  1408. X    if (!defined($TRUE))              { $TRUE=1; }
  1409. X    if (!defined($FALSE))             { $FALSE=0; }
  1410. X    if (!defined($ERROR))             { $ERROR=STDERR; }
  1411. X    if (!defined($OUT))               { $OUT=STDOUT; }
  1412. X
  1413. X    # Environnement
  1414. X    
  1415. X    $ENV{'SHELL'} = '/bin/sh' if $ENV{'SHELL'} ne '';
  1416. X    
  1417. X    # debug level
  1418. X    
  1419. X    if (!defined($Debugvalue)) { $Debugvalue=$DEFAULTDEBUGLEVEL; }
  1420. X    
  1421. X    $CatMan=$FALSE;
  1422. X    $WAISMan=$FALSE;
  1423. X    $Info=$FALSE;
  1424. X    $WWWSoft=$FALSE;
  1425. X    $WAISSoft=$FALSE;
  1426. X    $RemoteLink=$FALSE;
  1427. X    $NoWWWExt=$FALSE;
  1428. X    $Show=$FALSE;
  1429. X    $Verbose=$FALSE;
  1430. X    $Help=$FALSE;
  1431. X
  1432. X    # Some useful definitions and default values
  1433. X    #
  1434. X    $LUDEWWW    = "$LOCAL_DIR/lib/WWW/lude";
  1435. X    $LUDEWAIS   = "$LOCAL_DIR/lib/WAIS";
  1436. X    $INSTALLDIR = "$LOCAL_DIR/doc";
  1437. X    $MANDIR     = "$LOCAL_DIR/man";
  1438. X
  1439. X    $PathCatMan = "$CONF_SYS_MAN_PATH:$MANDIR";
  1440. X    $PathWAISMan = $PathCatMan;
  1441. X    $PathInfo   = "$LOCAL_DIR/info";
  1442. X    $PathSoft   = "$LOCAL_DIR/soft";
  1443. X    $HostWWW    = "localhost";
  1444. X    $HostWAIS   = "localhost";
  1445. X    $PortWWW    = 80;
  1446. X    $PortWAIS   = 210;
  1447. X
  1448. X    $LocalSoft  = "$LOCAL_DIR/soft";
  1449. X    $ServerSoft = "$SERVER_DIR";
  1450. X    $IsLocal = $FALSE;
  1451. X    $IsServer = '';
  1452. X    
  1453. X    #
  1454. X    # commands that may change with various operating system flavors
  1455. X    #
  1456. X    $MAKEWHATIS = "catman -w -M";
  1457. X    $MAKEINFO = "cat diri.top *.dir >dir";
  1458. X    $MAKEWWW  = "cat dirh.top *.dir dirh.end >dir.html";
  1459. X    $MAKEWAIS = "waisindex -d $LUDEWAIS/lude -T HTML -t para $LUDEWAIS/man/* $LUDEWAIS/soft/*";
  1460. X
  1461. X
  1462. X    require("ludeindexinc");    # argument parsing
  1463. X    require("fileutil.pl");
  1464. X    require("BldRegexpMinRqr.pl");
  1465. X
  1466. X    # get progname
  1467. X
  1468. X    $PGM=&BaseName($0);
  1469. X    
  1470. X    #
  1471. X    # Field names that change with the language
  1472. X    #
  1473. X
  1474. X#    %No_field = ();
  1475. X#    $No_field{$FIELD{$USAGE}} = 1;
  1476. X#    $No_field{$FIELD{$INSTALL}} = 1;
  1477. X#    $No_field{$FIELD{$DESCRIPTION}} = 1;
  1478. X#    $No_field{$FIELD{$ABSTRACT}} = 1;
  1479. X
  1480. X    &Initialisation;
  1481. X
  1482. X    if($Help) { &Help; }
  1483. X    if($CatMan) { &MakeManPagesIndex; }
  1484. X    if($Info) { &MakeInfo; }
  1485. X    if($WAISMan) { &MakeWAISMan; }
  1486. X    if($WWWSoft) { &MakeWWWSoft; }
  1487. X    if($WAISMan || $WAISSoft) { &MakeWAIS; }
  1488. X
  1489. X    exit($exitval);
  1490. X}
  1491. X
  1492. X####################################################################
  1493. X#
  1494. X# First, index the man pages if one of the man directories is newer
  1495. X# than the index in the whatis file and if the
  1496. X# file whatis already exists.
  1497. X#
  1498. Xsub MakeManPagesIndex {
  1499. X  #
  1500. X  # list the components in the man path
  1501. X  #
  1502. X  local(@manpath) = split(/:/, $PathCatMan);
  1503. X  local($thisdir)  = '';
  1504. X  local(@allfiles) = '';
  1505. X  local($newest);
  1506. X  local($mandir);
  1507. X
  1508. X  foreach $mandir (@manpath) {
  1509. X
  1510. X    opendir(thisdir, "$mandir");
  1511. X    # Note that the files '.' and '..' are not retained 
  1512. X    @allfiles = grep(! /^\.{1,2}$/, readdir(thisdir));
  1513. X    closedir(thisdir);                                 
  1514. X
  1515. X    $newest = $allfiles[0];
  1516. X    $mtime = 0;
  1517. X
  1518. X    ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
  1519. X     $atime,$mtime,$ctime,$blksize,$blocks) = stat("$mandir/$newest");
  1520. X
  1521. X    $newest_time = $mtime;
  1522. X    $mtime = 0;
  1523. X
  1524. X    foreach $filename (@allfiles) {
  1525. X      ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
  1526. X       $atime,$mtime,$ctime,$blksize,$blocks) = stat("$mandir/$filename");
  1527. X
  1528. X      if($newest_time < $mtime) {
  1529. X    $newest = $filename;
  1530. X    $newest_time = $mtime;
  1531. X      }
  1532. X    }
  1533. X
  1534. X    #
  1535. X    # If a subdirectory is newer than the whatis index, call
  1536. X    # the catman indexing command.
  1537. X    #
  1538. X
  1539. X    if ($newest eq '' ) {
  1540. X      print "$PGM: ${mandir} $TEXT[$BAD_MAN_DIR]\n";
  1541. X    }
  1542. X    elsif ($newest eq "whatis") {
  1543. X      if($Verbose) { print "$PGM: ${mandir}/whatis $TEXT[$MAN_TO_DATE]\n"; }
  1544. X    }
  1545. X    else {
  1546. X      if($Verbose) { print sprintf("$PGM: $TEXT[$MAN_INDEXING]\n",
  1547. X                                   $mandir,$newest); }
  1548. X      if($Show) { print "$MAKEWHATIS $mandir\n"; }
  1549. X      else { system "$MAKEWHATIS $mandir"; }
  1550. X
  1551. X      if($Verbose) { print "$TEXT[$IS_DONE]\n\n"; }
  1552. X    }
  1553. X  }
  1554. X}
  1555. X
  1556. X#################################################################
  1557. X#
  1558. X# The main menu for the info files is rebuilt if the directory
  1559. X# was modified (an entry added or removed) and if the top.dir
  1560. X# file exists.
  1561. X#
  1562. Xsub MakeInfo {
  1563. X
  1564. X  local(@infopath) = split(/[:]/, $PathInfo);
  1565. X  local($infodir);
  1566. X
  1567. X  foreach $infodir (@infopath) {
  1568. X
  1569. X    chdir $infodir;
  1570. X
  1571. X    $infomtime = 0;
  1572. X    $dirmtime = 0;
  1573. X
  1574. X    ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
  1575. X     $atime,$infomtime,$ctime,$blksize,$blocks) = stat("$infodir");
  1576. X
  1577. X    ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
  1578. X     $atime,$dirmtime,$ctime,$blksize,$blocks) = stat("$infodir/dir");
  1579. X
  1580. X    if ($infomtime == 0) {
  1581. X      print "$PGM: ${infodir} $TEXT[$BAD_MAN_DIR]\n";
  1582. X    }
  1583. X    elsif($infomtime > $dirmtime) {
  1584. X
  1585. X      if($Verbose) { print "$PGM: $TEXT[$INFO_UPDATE] ${infodir}/dir\n"; }
  1586. X
  1587. X      if($Show) { print "$MAKEINFO\n"; }
  1588. X      else { system $MAKEINFO; }
  1589. X
  1590. X      if($Verbose) { print "$TEXT[$IS_DONE]\n\n"; }
  1591. X    }
  1592. X    else {
  1593. X      if($Verbose) { print "$PGM: ${infodir}/dir $TEXT[$MAN_TO_DATE]\n"; }
  1594. X    }
  1595. X  }
  1596. X}
  1597. X
  1598. X###############################################################
  1599. X#
  1600. X# Go through all the man pages in the path wais man and for
  1601. X# each prepare a short summary for inclusion in the WAIS
  1602. X# database.
  1603. X#
  1604. X
  1605. Xsub MakeWAISMan {
  1606. X  #
  1607. X  # list the components in the man path
  1608. X  #
  1609. X  local(@manpath) = split(/:/, $PathWAISMan);
  1610. X  local($waisfile);
  1611. X  local($mandir);
  1612. X  local($thisdir)  = '';
  1613. X  local(@allfiles) = '';
  1614. X  local($newest);
  1615. X
  1616. X  foreach $mandir (@manpath) {
  1617. X
  1618. X    #
  1619. X    # each man tree gets its own WAIS file named after the
  1620. X    # path with "/" replaced by "."
  1621. X    #
  1622. X    chdir $mandir;
  1623. X    $waisfile = $mandir;
  1624. X    $waisfile =~ s/\//./go;
  1625. X    $waisfile = "$LUDEWAIS/man/wais$waisfile";
  1626. X
  1627. X    opendir(thisdir, "$mandir");
  1628. X    # Note that the files '.' and '..' are not retained 
  1629. X    @allfiles = grep(! /^whatis$/,grep(! /^\.{1,2}$/, readdir(thisdir)));
  1630. X    closedir(thisdir);                                 
  1631. X
  1632. X    $newest_time = 0;
  1633. X    $mtime = 0;
  1634. X    $newest = '';
  1635. X
  1636. X    foreach $filename (@allfiles) {
  1637. X      ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
  1638. X       $atime,$mtime,$ctime,$blksize,$blocks) = stat("$mandir/$filename");
  1639. X
  1640. X      if($newest_time < $mtime) {
  1641. X    $newest = $filename;
  1642. X    $newest_time = $mtime;
  1643. X      }
  1644. X    }
  1645. X
  1646. X    $mtime = 0;
  1647. X
  1648. X    ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
  1649. X     $atime,$mtime,$ctime,$blksize,$blocks) = stat("$waisfile");
  1650. X
  1651. X    #
  1652. X    # If a subdirectory is newer than the WAIS database, 
  1653. X    # recreate it.
  1654. X    #
  1655. X
  1656. X    if ($newest eq '' ) {
  1657. X      print "$PGM: ${mandir} $TEXT[$BAD_MAN_DIR]\n";
  1658. X    }
  1659. X    elsif($newest_time < $mtime) {
  1660. X      if($Verbose) { print "$PGM: ${mandir}, $TEXT[$WAIS_TO_DATE]\n"; }
  1661. X    }
  1662. X
  1663. X    elsif($Show) {
  1664. X      if($Verbose) {print "$PGM: $TEXT[$WAIS_MAN_BASE] $mandir\n"; }
  1665. X    }
  1666. X
  1667. X    elsif(open(WAISFILE,">$waisfile")) {
  1668. X
  1669. X      if($Verbose) {print "$PGM: $TEXT[$WAIS_MAN_BASE] $mandir\n"; }
  1670. X
  1671. X      $Man_too_small = 0;
  1672. X
  1673. X      &ExtractWAISMan("$mandir","");
  1674. X
  1675. X      if ( $Man_too_small > 0 ) {
  1676. X        if($Verbose) { printf sprintf("$TEXT[$NB_MAN_TOO_SMALL]\n",
  1677. X                                      $Man_too_small); }
  1678. X      }
  1679. X
  1680. X      close(WAISFILE);
  1681. X      if($Verbose) { print "$TEXT[$IS_DONE]\n\n"; }
  1682. X    }
  1683. X    else {
  1684. X      print "$PGM: ${waisfile} $TEXT[$BAD_MAN_DIR]\n";
  1685. X    }
  1686. X  }
  1687. X}
  1688. X
  1689. X
  1690. X#######################################################################
  1691. X#
  1692. X# Recursive function to extract the WAIS database abstract for
  1693. X# each man page
  1694. X#
  1695. Xsub ExtractWAISMan {
  1696. X  local($manDirName)=$_[0];
  1697. X
  1698. X  local(@allfiles,$filename,$name,$description);
  1699. X  local(*man_dir, *man_file);
  1700. X  local($ext);
  1701. X
  1702. X  opendir(man_dir, $manDirName);
  1703. X  @allfiles = grep(! /^\.{1,2}$/, readdir(man_dir));
  1704. X  closedir(man_dir);
  1705. X
  1706. X  foreach $filename (sort @allfiles) {
  1707. X    if (-d "$manDirName/$filename") {
  1708. X      &ExtractWAISMan("$manDirName/$filename", "$_[1]$filename/");
  1709. X    }
  1710. X    elsif ("$manDirName/$filename" =~ /\.[0-9ln][a-z]*$/o) {
  1711. X
  1712. X      # Files of less than 80 characters are not worth pursuing
  1713. X      # because they are only sourcing other man pages that will
  1714. X      # get indexed anyhow.
  1715. X
  1716. X      ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
  1717. X       $atime,$infomtime,$ctime,$blksize,$blocks) =
  1718. X     stat("$manDirName/$filename");
  1719. X
  1720. X      if( $size <= 80 ) {
  1721. X    $Man_too_small++;
  1722. X    next; 
  1723. X      }
  1724. X
  1725. X      open(man_file,"nroff -Tcrt -man $manDirName/$filename |");
  1726. X
  1727. X      $description = '';
  1728. X      $name = '';
  1729. X
  1730. X      #
  1731. X      # Find the summary and use the first line as header
  1732. X      #
  1733. X
  1734. X      while($_ = <man_file>) {
  1735. X    if( /^NAME/ ) {
  1736. X      $name = <man_file>;
  1737. X      last;
  1738. X    }
  1739. X      }
  1740. X
  1741. X      #
  1742. X      # Get the rest of the NAME field if more than one line long
  1743. X      #
  1744. X
  1745. X      $long_name = $name;
  1746. X      while($_ = <man_file>) {
  1747. X
  1748. X    s/_\010//go;
  1749. X    if( /^\s*$/ ) {
  1750. X      last;
  1751. X    }
  1752. X    $long_name = $long_name . $_;
  1753. X      }
  1754. X
  1755. X      #
  1756. X      # Find the description heading
  1757. X      #
  1758. X
  1759. X      while($_ = <man_file>) {
  1760. X    if( /^DESCRIPTION/ ) {
  1761. X      last;
  1762. X    }
  1763. X      }
  1764. X
  1765. X      #
  1766. X      # keep the first paragraph of the description
  1767. X      #
  1768. X
  1769. X      while($_ = <man_file>) {
  1770. X
  1771. X    s/_\010//go;
  1772. X    if( /^\s*$/ ) {
  1773. X      last;
  1774. X    }
  1775. X    $description = $description . $_;
  1776. X      }
  1777. X
  1778. X      close(man_file);
  1779. X
  1780. X      #
  1781. X      # write this in the database file
  1782. X      #
  1783. X
  1784. X      if($NoWWWExt) { $ext = ""; }
  1785. X      else { $ext = ".man"; }
  1786. X
  1787. X      print WAISFILE "$name<TITLE>$filename</TITLE>\n<H1>$filename</H1>\n";
  1788. X      print WAISFILE "<H2>NAME</H2>\n$long_name<P>\n";
  1789. X      print WAISFILE "<H2>DESCRIPTION</H2>\n$description<P>\n";
  1790. X
  1791. X      print WAISFILE "<A HREF=http://$HostWWW:$PortWWW$manDirName/$filename$ext>$_[1]$filename</A>\n\n";
  1792. X
  1793. X    }
  1794. X    else {
  1795. X      if($Verbose) { print "$TEXT[$IGNORING_FILE] $manDirName/$filename\n"; }
  1796. X    }
  1797. X  }
  1798. X}
  1799. X
  1800. X###############################################################
  1801. X#
  1802. X# For each software package, insure that an up to date html
  1803. X# file is available. Create a new status file that tells which
  1804. X# software is available where.
  1805. X#
  1806. X
  1807. Xsub MakeWWWSoft {
  1808. X  
  1809. X  local(@softpath) = split(/:/, $PathSoft);
  1810. X  local($thisdir)  = '';
  1811. X  local(@allfiles) = '';
  1812. X  local($newest);
  1813. X  local($softdir);
  1814. X  local($subdir);
  1815. X  local(@subfiles);
  1816. X  local($filename);
  1817. X  local($subname);
  1818. X  local($classname);
  1819. X  local(@classfiles);
  1820. X  local($classdir);
  1821. X  local($softtime);
  1822. X  local($htmltime);
  1823. X  local($waistime);
  1824. X
  1825. X  # Remove all status files since it is safer to recreate them
  1826. X  # every time.  
  1827. X    
  1828. X  if($Show) { print "rm -f $LUDEWWW/*.status.html\n"; }
  1829. X  else { system "rm -f $LUDEWWW/*.status.html"; }
  1830. X
  1831. X  # Loop over all components of the Software path.
  1832. X  # It often contains /usr/local/soft and /usr/local/server/*
  1833. X
  1834. X  foreach $softdir (@softpath) {
  1835. X
  1836. X    chdir $softdir;
  1837. X
  1838. X    if (! -d $softdir) {
  1839. X      print "$PGM: ${softdir} $TEXT[$BAD_MAN_DIR]\n";
  1840. X      next;
  1841. X    }
  1842. X
  1843. X    if($Verbose) { print "$PGM: $TEXT[$HTML_UPDATING] $softdir\n"; }
  1844. X
  1845. X    # determine the type of software directory (local or server)
  1846. X
  1847. X    $IsLocal = $FALSE;
  1848. X    $IsServer = '';
  1849. X
  1850. X    if($softdir =~ /^$LocalSoft/) { 
  1851. X      $IsLocal = $TRUE; 
  1852. X    }
  1853. X    elsif($softdir =~ /^$ServerSoft/) {
  1854. X      ($IsServer) = /^$ServerSoft\/(.*)/;
  1855. X    }
  1856. X
  1857. X    # look at each software package
  1858. X
  1859. X    opendir(thisdir, $softdir);
  1860. X    # Note that the files '.' and '..' are not retained 
  1861. X    @allfiles = grep(! /^\.{1,2}$/, readdir(thisdir));
  1862. X    closedir(thisdir);                                 
  1863. X
  1864. X    foreach $filename (@allfiles) {
  1865. X
  1866. X      $softtime = 0;
  1867. X
  1868. X      ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
  1869. X       $atime,$softtime,$ctime,$blksize,$blocks) = 
  1870. X                             stat("$softdir/$filename/install/IAFA-PACKAGES");
  1871. X
  1872. X      # This cannot be a valid software package
  1873. X
  1874. X      if($softtime == 0) { next; }
  1875. X
  1876. X      # Verify if this package is linked in /usr/local/bin
  1877. X
  1878. X      if($IsLocal) {
  1879. X        if(readlink("$INSTALLDIR/$filename/IAFA-PACKAGES") eq
  1880. X           "$softdir/$filename/install/IAFA-PACKAGES") {
  1881. X          $IsLinked = $TRUE;
  1882. X        }
  1883. X        else {
  1884. X          $IsLinked = $FALSE;
  1885. X        }
  1886. X      }
  1887. X      # Check if a status file exists for this package
  1888. X
  1889. X      $htmltime = 0;
  1890. X
  1891. X      ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
  1892. X       $atime,$htmltime,$ctime,$blksize,$blocks) = 
  1893. X                                 stat("$LUDEWWW/${filename}.status.html");
  1894. X
  1895. X      if($Show) { 
  1896. X        print "\n"; 
  1897. X      }
  1898. X      elsif($htmltime == 0) {
  1899. X        open(STATUSFILE,">$LUDEWWW/${filename}.status.html");
  1900. X        print STATUSFILE "<TITLE>$filename</TITLE>\n<H1>$filename</H1>\n";
  1901. X      }
  1902. X      else {
  1903. X        open(STATUSFILE,">>$LUDEWWW/${filename}.status.html");
  1904. X      }
  1905. X     
  1906. X      # Now check the time of the html file
  1907. X
  1908. X      $htmltime = 0;
  1909. X
  1910. X      ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
  1911. X       $atime,$htmltime,$ctime,$blksize,$blocks) = 
  1912. X                                 stat("$LUDEWWW/${filename}.html");
  1913. X
  1914. X      # Check also the wais abstract if requested
  1915. X
  1916. X      if($WAISSoft) {
  1917. X        $waistime = 0;
  1918. X
  1919. X        ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
  1920. X         $atime,$waistime,$ctime,$blksize,$blocks) = 
  1921. X                                   stat("$LUDEWAIS/soft/$filename");
  1922. X        if($waistime < $htmltime) {
  1923. X          $htmltime = $waistime;
  1924. X        }
  1925. X      }
  1926. X
  1927. X      # The html file for the software should be regenerated
  1928. X      # the accompanying .dir and wais files are done at 
  1929. X      # the same time
  1930. X
  1931. X      if($htmltime == 0 || $htmltime < $softtime) {
  1932. X    if($Show) {
  1933. X          print "MakeHTMLfile($softdir/$filename/install/IAFA-PACKAGES)\n";
  1934. X        }
  1935. X    else {
  1936. X          &MakeHTMLfile("$softdir/$filename/install/IAFA-PACKAGES",
  1937. X                      $filename,$TRUE);
  1938. X        }
  1939. X      }
  1940. X
  1941. X      # Check also the html file for the modifications,
  1942. X      # loop over the modifications in the install dir.
  1943. X
  1944. X      opendir(subdir, "$softdir/$filename/install");
  1945. X      # Note that the files '.' and '..' are not retained 
  1946. X      @subfiles = grep(! /^IAFA-PACKAGES$/,
  1947. X                         grep(! /^share$/,
  1948. X                         grep(! /^\.{1,2}$/, readdir(subdir))));
  1949. X      closedir(subdir);                                 
  1950. X
  1951. X      foreach $subname (@subfiles) {
  1952. X
  1953. X        $softtime = 0;
  1954. X
  1955. X        ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
  1956. X         $atime,$softtime,$ctime,$blksize,$blocks) = 
  1957. X                            stat("$softdir/$filename/install/$subname/LUDE");
  1958. X
  1959. X        $htmltime = 0;
  1960. X
  1961. X        ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
  1962. X         $atime,$htmltime,$ctime,$blksize,$blocks) = 
  1963. X                                 stat("$LUDEWWW/$filename/${subname}.html");
  1964. X
  1965. X        if($htmltime == 0 || $htmltime < $softtime) {
  1966. X
  1967. X          if(! -d "$LUDEWWW/$filename") {
  1968. X            if(! $Show) { mkdir("$LUDEWWW/$filename",0755); }
  1969. X          }
  1970. X
  1971. X      if($Show) {
  1972. X            print "MakeHTMLfile($softdir/$filename/install/$subname/LUDE)\n";
  1973. X          }
  1974. X          else {
  1975. X        &MakeHTMLfile("$softdir/$filename/install/$subname/LUDE",
  1976. X                        "$filename/$subname",$FALSE);
  1977. X          }
  1978. X        }
  1979. X
  1980. X        # Check the classes available and update the status file
  1981. X
  1982. X        opendir(classdir, "$softdir/$filename/install/$subname");
  1983. X        # Note that the files '.' and '..' are not retained 
  1984. X        @classfiles = grep(! /^LUDE$/,
  1985. X                         grep(! /^share$/,
  1986. X                         grep(! /^\.{1,2}$/, readdir(classdir))));
  1987. X        closedir(classdir);                                 
  1988. X
  1989. X        foreach $classname (@classfiles) {
  1990. X
  1991. X          if($Show) {
  1992. X            print "MakeStatusFileEntry($softdir,$filename,$subname,$classname)\n";
  1993. X          }
  1994. X          else {
  1995. X            &MakeStatusFileEntry($softdir,$filename,$subname,$classname);
  1996. X          }
  1997. X        }
  1998. X      }     # for each modification
  1999. X    
  2000. X      if(! $Show) { close(STATUSFILE); }
  2001. X
  2002. X    }           # for each software
  2003. X  }             # for each path component
  2004. X
  2005. X  # All the dir files can be concatenated to produce the main menu
  2006. X
  2007. X  if($Verbose) { print "$PGM: $TEXT[$HTML_UPDATING_MENU]\n"; }
  2008. X
  2009. X  if($Show) {
  2010. X    print "chdir $LUDEWWW\n";
  2011. X    print "$MAKEWWW\n";
  2012. X  }
  2013. X  else {
  2014. X    chdir $LUDEWWW ;
  2015. X    system $MAKEWWW ;
  2016. X  }
  2017. X
  2018. X  if($Verbose) { print "$TEXT[$IS_DONE]\n\n"; }
  2019. X
  2020. X}
  2021. X
  2022. X
  2023. X###########################################################
  2024. X#
  2025. X# Convert a IAFA-PACKAGES file into a HTML file
  2026. X# and create the associated dir and wais files
  2027. X#
  2028. X
  2029. Xsub MakeHTMLfile {
  2030. X
  2031. X  local($ludefile) = $_[0];
  2032. X  local($software) = $_[1];
  2033. X  local($notmodif) = $_[2];
  2034. X  local(*html_file,*this_file);
  2035. X
  2036. X  if(!open(html_file,">$LUDEWWW/${software}.html")) {
  2037. X    print "$PGM: $TEXT[$CANNOT_ACCESS] $LUDEWWW/${software}.html\n";
  2038. X  }
  2039. X  if(!open(this_file,$ludefile)) {
  2040. X    print "$PGM: $TEXT[$CANNOT_ACCESS] $ludefile\n";
  2041. X  }
  2042. X
  2043. X  $abstract = '';
  2044. X  $description = '';
  2045. X
  2046. X  print html_file "<TITLE>$software</TITLE>\n";
  2047. X  print html_file "<H1>$software</H1>\n";
  2048. X
  2049. X  # Read the file, when encountering a new field name, output the
  2050. X  # previous field if not empty and not in the "no" list. Otherwise
  2051. X  # accumulate the lines in the current field.
  2052. X
  2053. X  $in_description = 0;
  2054. X  $in_abstract = 0;
  2055. X  $fieldname = '';
  2056. X  $field = '';
  2057. X  while($_ = <this_file>) {
  2058. X
  2059. X    $found = /^([a-zA-Z-]*:)(.*)/;
  2060. X    $newname = $1;
  2061. X    $newfield = $2 . "\n";
  2062. X
  2063. X    if ($found eq '') {
  2064. X      $field = $field . $_;
  2065. X      if ( /^\s*$/ ) {
  2066. X        $in_description = 0;
  2067. X    $in_abstract = 0;
  2068. X      }
  2069. X
  2070. X      if( $in_description == 1) {
  2071. X    $description .= $_;
  2072. X      }
  2073. X
  2074. X      if( $in_abstract == 1) {
  2075. X        $abstract .= $_;
  2076. X      }
  2077. X    }
  2078. X    else {
  2079. X      if (($fieldname ne '') && 
  2080. X#          ($No_field{$fieldname} != 1) &&
  2081. X      ($field =~ /[-a-zA-Z0-9]/)) {
  2082. X                
  2083. X    print html_file "<H3>${fieldname}</H3>\n$field\n"
  2084. X      }
  2085. X                
  2086. X      $fieldname = $newname;
  2087. X      $fieldname =~ tr/a-z/A-Z/;
  2088. X      $field = $newfield;
  2089. X                
  2090. X      #
  2091. X      # keep the description for the main menu
  2092. X      #
  2093. X
  2094. X      if (($fieldname eq $FIELD[$DESCRIPTION]) &&
  2095. X      ($field =~ /[-a-zA-Z0-9]/)) {
  2096. X    $in_description = 1;
  2097. X    $description = $field;
  2098. X      }
  2099. X                
  2100. X      if (($fieldname eq $FIELD[$ABSTRACT]) &&
  2101. X      ($field =~ /[-a-zA-Z0-9]/)) {
  2102. X    $in_abstract = 1;
  2103. X    $abstract = $field;
  2104. X      }
  2105. X    }
  2106. X  }
  2107. X
  2108. X  if (($fieldname ne '') && 
  2109. X#      ($No_field{$fieldname} != 1) && 
  2110. X      ($field =~ /[-a-zA-Z0-9]/)) {
  2111. X            
  2112. X    print html_file "<H3>${fieldname}</H3>\n$field\n";
  2113. X  }
  2114. X
  2115. X  close this_file;
  2116. X            
  2117. X  # The html file was produced. If this is not simply a modification,
  2118. X  # a dir file and perhaps a WAIS file should be created.
  2119. X        
  2120. X  if($notmodif) {
  2121. X
  2122. X    # A reference is added to the status file
  2123. X
  2124. X    print html_file "<H3>$TEXT[$SOFT_AVAILABILITY]</H3>\n";
  2125. X    print html_file "<A HREF=http://$HostWWW:$PortWWW$LUDEWWW/${software}.status.html>$software</A>\n\n";
  2126. X    close html_file;
  2127. X
  2128. X    # the dir file is created
  2129. X
  2130. X    open(html_file,">$LUDEWWW/${software}.dir");
  2131. X    print html_file "<DT><A HREF=http://$HostWWW:$PortWWW${LUDEWWW}/${software}.html>$software</A><DD>$abstract\n";
  2132. X    close html_file;
  2133. X
  2134. X    # the WAIS file is created if needed
  2135. X
  2136. X    if($WAISSoft) {
  2137. X
  2138. X      if( !open(html_file,">$LUDEWAIS/soft/${software}")) {
  2139. X        print "$PGM: $TEXT[$CANNOT_ACCESS] $LUDEWAIS/soft/${software}\n";
  2140. X      }
  2141. X      else {
  2142. X        chop $abstract;
  2143. X        print html_file "$software $abstract\n";
  2144. X        print html_file "<TITLE>$software</TITLE>\n<H1>$software</H1>\n";
  2145. X        print html_file "<H2>$FIELD[$DESCRIPTION]</H2>\n$description<P>\n";
  2146. X        print html_file "<A HREF=http://$HostWWW:$PortWWW${LUDEWWW}/${software}.html>$software</A>\n\n";
  2147. X        close html_file;
  2148. X      }
  2149. X
  2150. X    }
  2151. X  }
  2152. X  else {
  2153. X    close html_file;
  2154. X  }
  2155. X}    
  2156. X
  2157. X##########################################################
  2158. X
  2159. Xsub MakeStatusFileEntry {
  2160. X
  2161. X  local($softdir) = $_[0];
  2162. X  local($software) = $_[1];
  2163. X  local($modif) = $_[2];
  2164. X  local($class) = $_[3];
  2165. X
  2166. X  # output one line in the status file
  2167. X
  2168. X  if($IsLocal) { 
  2169. X    if($IsLinked) {
  2170. X      print STATUSFILE 
  2171. X            sprintf("<P>$TEXT[$CLASS_IS_LINKED]\n",$software,$modif,$class);  
  2172. X    }
  2173. X    else {
  2174. X      print STATUSFILE 
  2175. X            sprintf("<P>$TEXT[$CLASS_IS_LOCAL]\n",
  2176. X                    $software,$modif,$class,$softdir);  
  2177. X    }
  2178. X  }
  2179. X  elsif($IsServer ne '') {
  2180. X    print STATUSFILE 
  2181. X          sprintf("<P>$TEXT[$CLASS_ON_SERVER]\n",$software,$modif,$class,$IsServer);  
  2182. X  }
  2183. X  else {
  2184. X    print STATUSFILE 
  2185. X          sprintf("<P>$TEXT[$CLASS_ELSEWHERE]\n",$software,$modif,$class,$softdir);  
  2186. X  }
  2187. X
  2188. X  # Put out a link to the modification
  2189. X
  2190. X  print STATUSFILE "<P><A HREF=$LUDEWWW/$software/${modif}.html>$modif</A>\n\n";
  2191. X
  2192. X  # If needed, list doc/info/man pages
  2193. X
  2194. X  if($IsLocal || $RemoteLink) {
  2195. X
  2196. X    print STATUSFILE "<P>\n";
  2197. X
  2198. X    if(-d "$softdir/$software/run/$modif/$class/doc") {
  2199. X      &MakeDocLinks("$softdir/$software/run/$modif/$class/doc",
  2200. X                    "doc/","","");
  2201. X    }
  2202. X
  2203. X    if(-d "$softdir/$software/run/$modif/$class/info") {
  2204. X      &MakeDocLinks("$softdir/$software/run/$modif/$class/info",
  2205. X                    "info/",'^((.*\.dir$)|(.*[0-9]$)|(dir)|(dir\.top)|(COPYING))$',
  2206. X                    ".info");
  2207. X    }
  2208. X
  2209. X    if(-d "$softdir/$software/run/$modif/$class/man") {
  2210. X      &MakeDocLinks("$softdir/$software/run/$modif/$class/man",
  2211. X                    "",'^whatis$',".man");
  2212. X    }
  2213. X  }
  2214. X}
  2215. X
  2216. X####################################################################
  2217. X#
  2218. X# Search for documentation files in the software tree and
  2219. X# put out links to them in the status file
  2220. X
  2221. Xsub MakeDocLinks {
  2222. X
  2223. X  local($htmlLinksDirName, $radix, $filePattern, $ext) = @_;
  2224. X  local(@allfiles,$filename);
  2225. X  local(*html_links_dir);
  2226. X
  2227. X  if($NoWWWExt) {
  2228. X    $ext = "";
  2229. X  }
  2230. X
  2231. X  opendir(html_links_dir, $htmlLinksDirName);
  2232. X  @allfiles = grep(! /^\.{1,2}$/, readdir(html_links_dir));
  2233. X  closedir(html_links_dir);
  2234. X
  2235. X  # ignore ordinary files, follow recursively subdirectories
  2236. X  # (adding the filename to both the directory name and to the 
  2237. X  #  short name radix) and process symbolic links
  2238. X
  2239. X  foreach $filename (@allfiles) {
  2240. X    if (-d "$htmlLinksDirName/$filename") {
  2241. X      &MakeDocLinks("$htmlLinksDirName/$filename", "$radix$filename/",
  2242. X             $filePattern,$ext);
  2243. X    }
  2244. X    else {
  2245. X      if (!($filename =~ /$filePattern/)) {
  2246. X
  2247. X        print STATUSFILE 
  2248. X              "<A HREF=$htmlLinksDirName/$filename$ext>$radix$filename</A>\n";
  2249. X      }
  2250. X      else {
  2251. X    if($Verbose) { print "$TEXT[$IGNORING_FILE] $htmlLinksDirName/$filename\n"; }
  2252. X      }
  2253. X    }
  2254. X  }
  2255. X}
  2256. X
  2257. X####################################################################
  2258. X#
  2259. X# Rebuild the WAIS database
  2260. X#
  2261. X
  2262. Xsub MakeWAIS {
  2263. X
  2264. X  local($database_cover) = "${HostWAIS}:${PortWAIS}:lude.html";
  2265. X  local(*waisfile);
  2266. X
  2267. X  if($Verbose) { print "$PGM: $TEXT[$WAIS_INDEXING]\n"; }
  2268. X
  2269. X  if($Show) {
  2270. X    print "$MAKEWAIS\n";
  2271. X    print "symlink($LUDEWAIS/lude.html,$LUDEWAIS/$database_cover)\n";
  2272. X  }
  2273. X  else {  
  2274. X
  2275. X    system $MAKEWAIS;
  2276. X    
  2277. X    # We must force the HTML type in this binary one line file.
  2278. X    # The -T option in waisindex should have done it ?!
  2279. X
  2280. X    open(waisfile,"$LUDEWAIS/lude.fn");
  2281. X    $_ = <waisfile>;
  2282. X    close(waisfile);
  2283. X    open(waisfile,">$LUDEWAIS/lude.fn");
  2284. X    s/TEXT/HTML/g;
  2285. X    print waisfile $_;
  2286. X    close(waisfile);
  2287. X
  2288. X    # The cover page must have specially formatted name
  2289. X
  2290. X    symlink("$LUDEWAIS/lude.html","$LUDEWAIS/$database_cover");
  2291. X  }
  2292. X
  2293. X  if($Verbose) { print "\n$TEXT[$IS_DONE]\n"; }
  2294. X}
  2295. X
  2296. X### Local Variables: ***
  2297. X### mode: perl ***
  2298. X### End: ***
  2299. X
  2300. END_OF_FILE
  2301.   if test 25189 -ne `wc -c <'lude-1.1/src/orig/src/ludeindex'`; then
  2302.     echo shar: \"'lude-1.1/src/orig/src/ludeindex'\" unpacked with wrong size!
  2303.   fi
  2304.   chmod +x 'lude-1.1/src/orig/src/ludeindex'
  2305.   # end of 'lude-1.1/src/orig/src/ludeindex'
  2306. fi
  2307. echo shar: End of archive 7 \(of 12\).
  2308. cp /dev/null ark7isdone
  2309. MISSING=""
  2310. for I in 1 2 3 4 5 6 7 8 9 10 11 12 ; do
  2311.     if test ! -f ark${I}isdone ; then
  2312.     MISSING="${MISSING} ${I}"
  2313.     fi
  2314. done
  2315. if test "${MISSING}" = "" ; then
  2316.     echo You have unpacked all 12 archives.
  2317.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2318. else
  2319.     echo You still must unpack the following archives:
  2320.     echo "        " ${MISSING}
  2321. fi
  2322. exit 0
  2323. exit 0 # Just in case...
  2324.