home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume38 / lude / part09 < prev    next >
Text File  |  1993-07-12  |  67KB  |  1,844 lines

  1. Newsgroups: comp.sources.misc
  2. From: laplante@crim.ca (Pierre Laplante)
  3. Subject: v38i041:  lude - A Distributed Software Library, Part09/12
  4. Message-ID: <1993Jul11.224728.16795@sparky.imd.sterling.com>
  5. X-Md4-Signature: 2d1dfcbee8c7b2e37f2e5841c389e868
  6. Sender: kent@sparky.imd.sterling.com (Kent Landfield)
  7. Organization: Sterling Software
  8. Date: Sun, 11 Jul 1993 22:47:28 GMT
  9. Approved: kent@sparky.sterling.com
  10.  
  11. Submitted-by: laplante@crim.ca (Pierre Laplante)
  12. Posting-number: Volume 38, Issue 41
  13. Archive-name: lude/part09
  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/include/lude/fileutil.pl
  21. #   lude-1.1/src/orig/COPYING lude-1.1/src/orig/README
  22. #   lude-1.1/src/orig/bug-report/lude-bug.el
  23. #   lude-1.1/src/orig/src/ludeadminc lude-1.1/src/orig/src/ludeinc
  24. #   lude-1.1/src/orig/src/ludelist
  25. # Wrapped by kent@sparky on Sun Jul 11 15:49:15 1993
  26. PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
  27. echo If this archive is complete, you will see the following message:
  28. echo '          "shar: End of archive 9 (of 12)."'
  29. if test -f 'lude-1.1/run/crim/sun4.1_sparc/include/lude/fileutil.pl' -a "${1}" != "-c" ; then 
  30.   echo shar: Will not clobber existing file \"'lude-1.1/run/crim/sun4.1_sparc/include/lude/fileutil.pl'\"
  31. else
  32.   echo shar: Extracting \"'lude-1.1/run/crim/sun4.1_sparc/include/lude/fileutil.pl'\" \(5290 characters\)
  33.   sed "s/^X//" >'lude-1.1/run/crim/sun4.1_sparc/include/lude/fileutil.pl' <<'END_OF_FILE'
  34. X# fileutil - a library of functions to work on files and directories.
  35. X# Copyright (C) 1992,1993 Stephane Boucher.
  36. X#
  37. X# This program is free software; you can redistribute it and/or modify
  38. X# it under the terms of the GNU General Public License as published by
  39. X# the Free Software Foundation; either version 1, or (at your option)
  40. X# any later version.
  41. X#
  42. X# This program is distributed in the hope that it will be useful,
  43. X# but WITHOUT ANY WARRANTY; without even the implied warranty of
  44. X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  45. X# GNU General Public License for more details.
  46. X#
  47. X# You should have received a copy of the GNU General Public License
  48. X# along with this program; if not, write to the Free Software
  49. X# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  50. X
  51. X$FULL_VERSION.= '$Id: fileutil.pl,v 1.3 1993/03/17 14:56:43 sbo Exp $' ."\n";
  52. X
  53. X
  54. X#-----------------------------------------------------------------------
  55. X# Description : Delete the files given in parameters.
  56. X#
  57. X# Parameters  : $options - commands influencing the
  58. X#                          behavior of the deletion process
  59. X#                          This parameter is a string of letters
  60. X#                          where each letter modifies the behavior.
  61. X#                          Currently available:
  62. X#                          'r' - recursive deletion.
  63. X#               @files   - List of files to delete.
  64. X#
  65. X# Returns     : The number of files successfuly removed.
  66. X#               A removed directory counts as one, even
  67. X#               though the recursion process might have removed
  68. X#               many others.
  69. X#
  70. Xsub RmFiles {
  71. X    # Make sure that the number of parameters is correct
  72. X    if(scalar(@_)<1){die "Incorrect Number Of Parameters, stopped";}
  73. X    local($options, @files)=@_;
  74. X    local($recursive)=0;    # Recursion off by default
  75. X    local($remFiles)=0;        # So far, 0 file was removed
  76. X
  77. X    # Scan options
  78. X    foreach $opt (split(//, $options)) {
  79. X    if ($opt eq 'r') {
  80. X        $recursive=1;
  81. X    }
  82. X    else {
  83. X        die "Unknown option $opt, stopped";
  84. X    }
  85. X    }
  86. X
  87. X    stat('.');
  88. X    if (-w _) {
  89. X      foreach $f (@files) {
  90. X    # The links should not be followed, so lstat is used
  91. X    # instead of stat
  92. X    lstat($f); 
  93. X    if (-f _ || -l _) {
  94. X      if (unlink($f)) {
  95. X        $remFiles++;
  96. X      }
  97. X    }
  98. X    elsif (-d _ && $recursive) {
  99. X      local(*dir);
  100. X      local($savedir)=&GetCwd();
  101. X      local(@files);
  102. X      # Number of files removed in the directory $f
  103. X      local($dirRmFiles)=0;
  104. X      
  105. X      opendir(dir, $f);
  106. X      @files=grep(!/^\.{1,2}$/, readdir(dir));
  107. X      closedir(dir);
  108. X        
  109. X      if (! &ChDir($f)) {
  110. X        # Can't change directory
  111. X        # Ignore that file
  112. X      }
  113. X      else {
  114. X        $dirRmFiles=&RmFiles($options, @files);
  115. X        
  116. X        # Go back to the previous current directory
  117. X        &ChDir($savedir);
  118. X        
  119. X        # If all files in directory $f were removed...
  120. X        if ($dirRmFiles == scalar(@files)) { 
  121. X          # Remove the directory
  122. X          if (rmdir($f)) {
  123. X        $remFiles++;
  124. X          }
  125. X        }
  126. X      }
  127. X    }
  128. X      }
  129. X    }
  130. X    else {
  131. X      # Don't have write permission on the directory, so it will not
  132. X      # be possible to remove anything.
  133. X    }
  134. X
  135. X    return $remFiles;
  136. X}
  137. X
  138. X#-----------------------------------------------------------------------
  139. X# Find out what the current directory is
  140. X#
  141. X$libdir'CWD=`pwd`;
  142. Xif ($? != 0) {
  143. X    # The pwd command did not succeed.
  144. X    # Let's try something else...
  145. X    if (defined($ENV{'CWD'})) {
  146. X        $libdir'CWD=$ENV{'CWD'};
  147. X    }
  148. X    else {
  149. X      die "Could not find out what the current directory is, stopped";
  150. X    }
  151. X}
  152. Xif ($libdir'CWD !~ m|^/|) {
  153. X    die "CWD=\"$libdir'CWD\" Is Not an acceptable value\n" .
  154. X        "The CWD should be an absolute path,\nstopped";
  155. X}
  156. X
  157. X#-----------------------------------------------------------------------
  158. X# Description : Same thing as the built in chdir
  159. X#
  160. X# Parameters  : Same thing as the built in chdir
  161. X#
  162. X# Returns     : Same thing that chdir would return.
  163. X#               $! is also set the same way it would be if
  164. X#               chdir was called.
  165. X#
  166. Xsub ChDir {
  167. X    if(scalar(@_)!=1){die "Wrong Number Of Argument To ChDir, stopped";}
  168. X    local($dir)=@_;
  169. X    local($newdir);
  170. X    local($retval)=0;
  171. X
  172. X    if ($dir eq '.') {
  173. X    # Directory does not change
  174. X    $newdir=$libdir'CWD;
  175. X    }
  176. X    else {
  177. X        if ($dir =~ m|^/|) {
  178. X            $newdir=$dir;
  179. X        }
  180. X        else {
  181. X        $newdir="$libdir'CWD/$dir";
  182. X        }
  183. X    # Add a trailing '/' if none is present
  184. X        if ($newdir !~ m|[/]$|) {
  185. X            $newdir.='/';
  186. X        }
  187. X        # Remove path component before //
  188. X        $newdir =~ s|^.*[/]([/].*)$|$1|;
  189. X        # Remove ./
  190. X        while($newdir =~ s|[/]\.[/]|/|) {}
  191. X        # Remove something/../
  192. X    while ($newdir =~ s|[/][^/]+[/]\.\.[/]|/|) {}
  193. X        # Remove trailing '/'
  194. X    chop($newdir);
  195. X    }
  196. X    if ($retval=chdir($newdir)) {
  197. X        $libdir'CWD=$newdir;
  198. X    }
  199. X    # Note that $! is unchanged after chdir, so ChDir
  200. X    # has the same functionnality as chdir.
  201. X    return $retval;
  202. X}
  203. X
  204. X#-----------------------------------------------------------------------
  205. X# Description : Get the current working directory.
  206. X#
  207. X# Parameters  : none.
  208. X#
  209. X# Returns     : Return the current directory found.
  210. X#
  211. Xsub GetCwd {
  212. X    if (scalar(@_)!=0) {
  213. X    die "Wrong Number Of Argument To GetCwd, stopped";
  214. X    }
  215. X    return $libdir'CWD;
  216. X}
  217. X
  218. X1;
  219. X
  220. X#     ;;; Local Variables: ***
  221. X#     ;;; mode:perl ***
  222. X#     ;;; End: ***
  223. END_OF_FILE
  224.   if test 5290 -ne `wc -c <'lude-1.1/run/crim/sun4.1_sparc/include/lude/fileutil.pl'`; then
  225.     echo shar: \"'lude-1.1/run/crim/sun4.1_sparc/include/lude/fileutil.pl'\" unpacked with wrong size!
  226.   fi
  227.   # end of 'lude-1.1/run/crim/sun4.1_sparc/include/lude/fileutil.pl'
  228. fi
  229. if test -f 'lude-1.1/src/orig/COPYING' -a "${1}" != "-c" ; then 
  230.   echo shar: Will not clobber existing file \"'lude-1.1/src/orig/COPYING'\"
  231. else
  232.   echo shar: Extracting \"'lude-1.1/src/orig/COPYING'\" \(12473 characters\)
  233.   sed "s/^X//" >'lude-1.1/src/orig/COPYING' <<'END_OF_FILE'
  234. X
  235. X            GNU GENERAL PUBLIC LICENSE
  236. X             Version 1, February 1989
  237. X
  238. X Copyright (C) 1989 Free Software Foundation, Inc.
  239. X            675 Mass Ave, Cambridge, MA 02139, USA
  240. X Everyone is permitted to copy and distribute verbatim copies
  241. X of this license document, but changing it is not allowed.
  242. X
  243. X                Preamble
  244. X
  245. X  The license agreements of most software companies try to keep users
  246. Xat the mercy of those companies.  By contrast, our General Public
  247. XLicense is intended to guarantee your freedom to share and change free
  248. Xsoftware--to make sure the software is free for all its users.  The
  249. XGeneral Public License applies to the Free Software Foundation's
  250. Xsoftware and to any other program whose authors commit to using it.
  251. XYou can use it for your programs, too.
  252. X
  253. X  When we speak of free software, we are referring to freedom, not
  254. Xprice.  Specifically, the General Public License is designed to make
  255. Xsure that you have the freedom to give away or sell copies of free
  256. Xsoftware, that you receive source code or can get it if you want it,
  257. Xthat you can change the software or use pieces of it in new free
  258. Xprograms; and that you know you can do these things.
  259. X
  260. X  To protect your rights, we need to make restrictions that forbid
  261. Xanyone to deny you these rights or to ask you to surrender the rights.
  262. XThese restrictions translate to certain responsibilities for you if you
  263. Xdistribute copies of the software, or if you modify it.
  264. X
  265. X  For example, if you distribute copies of a such a program, whether
  266. Xgratis or for a fee, you must give the recipients all the rights that
  267. Xyou have.  You must make sure that they, too, receive or can get the
  268. Xsource code.  And you must tell them their rights.
  269. X
  270. X  We protect your rights with two steps: (1) copyright the software, and
  271. X(2) offer you this license which gives you legal permission to copy,
  272. Xdistribute and/or modify the software.
  273. X
  274. X  Also, for each author's protection and ours, we want to make certain
  275. Xthat everyone understands that there is no warranty for this free
  276. Xsoftware.  If the software is modified by someone else and passed on, we
  277. Xwant its recipients to know that what they have is not the original, so
  278. Xthat any problems introduced by others will not reflect on the original
  279. Xauthors' reputations.
  280. X
  281. X  The precise terms and conditions for copying, distribution and
  282. Xmodification follow.
  283. X
  284. X            GNU GENERAL PUBLIC LICENSE
  285. X   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
  286. X
  287. X  0. This License Agreement applies to any program or other work which
  288. Xcontains a notice placed by the copyright holder saying it may be
  289. Xdistributed under the terms of this General Public License.  The
  290. X"Program", below, refers to any such program or work, and a "work based
  291. Xon the Program" means either the Program or any work containing the
  292. XProgram or a portion of it, either verbatim or with modifications.  Each
  293. Xlicensee is addressed as "you".
  294. X
  295. X  1. You may copy and distribute verbatim copies of the Program's source
  296. Xcode as you receive it, in any medium, provided that you conspicuously and
  297. Xappropriately publish on each copy an appropriate copyright notice and
  298. Xdisclaimer of warranty; keep intact all the notices that refer to this
  299. XGeneral Public License and to the absence of any warranty; and give any
  300. Xother recipients of the Program a copy of this General Public License
  301. Xalong with the Program.  You may charge a fee for the physical act of
  302. Xtransferring a copy.
  303. X
  304. X  2. You may modify your copy or copies of the Program or any portion of
  305. Xit, and copy and distribute such modifications under the terms of Paragraph
  306. X1 above, provided that you also do the following:
  307. X
  308. X    a) cause the modified files to carry prominent notices stating that
  309. X    you changed the files and the date of any change; and
  310. X
  311. X    b) cause the whole of any work that you distribute or publish, that
  312. X    in whole or in part contains the Program or any part thereof, either
  313. X    with or without modifications, to be licensed at no charge to all
  314. X    third parties under the terms of this General Public License (except
  315. X    that you may choose to grant warranty protection to some or all
  316. X    third parties, at your option).
  317. X
  318. X    c) If the modified program normally reads commands interactively when
  319. X    run, you must cause it, when started running for such interactive use
  320. X    in the simplest and most usual way, to print or display an
  321. X    announcement including an appropriate copyright notice and a notice
  322. X    that there is no warranty (or else, saying that you provide a
  323. X    warranty) and that users may redistribute the program under these
  324. X    conditions, and telling the user how to view a copy of this General
  325. X    Public License.
  326. X
  327. X    d) You may charge a fee for the physical act of transferring a
  328. X    copy, and you may at your option offer warranty protection in
  329. X    exchange for a fee.
  330. X
  331. XMere aggregation of another independent work with the Program (or its
  332. Xderivative) on a volume of a storage or distribution medium does not bring
  333. Xthe other work under the scope of these terms.
  334. X
  335. X  3. You may copy and distribute the Program (or a portion or derivative of
  336. Xit, under Paragraph 2) in object code or executable form under the terms of
  337. XParagraphs 1 and 2 above provided that you also do one of the following:
  338. X
  339. X    a) accompany it with the complete corresponding machine-readable
  340. X    source code, which must be distributed under the terms of
  341. X    Paragraphs 1 and 2 above; or,
  342. X
  343. X    b) accompany it with a written offer, valid for at least three
  344. X    years, to give any third party free (except for a nominal charge
  345. X    for the cost of distribution) a complete machine-readable copy of the
  346. X    corresponding source code, to be distributed under the terms of
  347. X    Paragraphs 1 and 2 above; or,
  348. X
  349. X    c) accompany it with the information you received as to where the
  350. X    corresponding source code may be obtained.  (This alternative is
  351. X    allowed only for noncommercial distribution and only if you
  352. X    received the program in object code or executable form alone.)
  353. X
  354. XSource code for a work means the preferred form of the work for making
  355. Xmodifications to it.  For an executable file, complete source code means
  356. Xall the source code for all modules it contains; but, as a special
  357. Xexception, it need not include source code for modules which are standard
  358. Xlibraries that accompany the operating system on which the executable
  359. Xfile runs, or for standard header files or definitions files that
  360. Xaccompany that operating system.
  361. X
  362. X  4. You may not copy, modify, sublicense, distribute or transfer the
  363. XProgram except as expressly provided under this General Public License.
  364. XAny attempt otherwise to copy, modify, sublicense, distribute or transfer
  365. Xthe Program is void, and will automatically terminate your rights to use
  366. Xthe Program under this License.  However, parties who have received
  367. Xcopies, or rights to use copies, from you under this General Public
  368. XLicense will not have their licenses terminated so long as such parties
  369. Xremain in full compliance.
  370. X
  371. X  5. By copying, distributing or modifying the Program (or any work based
  372. Xon the Program) you indicate your acceptance of this license to do so,
  373. Xand all its terms and conditions.
  374. X
  375. X  6. Each time you redistribute the Program (or any work based on the
  376. XProgram), the recipient automatically receives a license from the original
  377. Xlicensor to copy, distribute or modify the Program subject to these
  378. Xterms and conditions.  You may not impose any further restrictions on the
  379. Xrecipients' exercise of the rights granted herein.
  380. X
  381. X  7. The Free Software Foundation may publish revised and/or new versions
  382. Xof the General Public License from time to time.  Such new versions will
  383. Xbe similar in spirit to the present version, but may differ in detail to
  384. Xaddress new problems or concerns.
  385. X
  386. XEach version is given a distinguishing version number.  If the Program
  387. Xspecifies a version number of the license which applies to it and "any
  388. Xlater version", you have the option of following the terms and conditions
  389. Xeither of that version or of any later version published by the Free
  390. XSoftware Foundation.  If the Program does not specify a version number of
  391. Xthe license, you may choose any version ever published by the Free Software
  392. XFoundation.
  393. X
  394. X  8. If you wish to incorporate parts of the Program into other free
  395. Xprograms whose distribution conditions are different, write to the author
  396. Xto ask for permission.  For software which is copyrighted by the Free
  397. XSoftware Foundation, write to the Free Software Foundation; we sometimes
  398. Xmake exceptions for this.  Our decision will be guided by the two goals
  399. Xof preserving the free status of all derivatives of our free software and
  400. Xof promoting the sharing and reuse of software generally.
  401. X
  402. X                NO WARRANTY
  403. X
  404. X  9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
  405. XFOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
  406. XOTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
  407. XPROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
  408. XOR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  409. XMERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
  410. XTO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
  411. XPROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
  412. XREPAIR OR CORRECTION.
  413. X
  414. X  10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
  415. XWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
  416. XREDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
  417. XINCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
  418. XOUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
  419. XTO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
  420. XYOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
  421. XPROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
  422. XPOSSIBILITY OF SUCH DAMAGES.
  423. X
  424. X             END OF TERMS AND CONDITIONS
  425. X
  426. X    Appendix: How to Apply These Terms to Your New Programs
  427. X
  428. X  If you develop a new program, and you want it to be of the greatest
  429. Xpossible use to humanity, the best way to achieve this is to make it
  430. Xfree software which everyone can redistribute and change under these
  431. Xterms.
  432. X
  433. X  To do so, attach the following notices to the program.  It is safest to
  434. Xattach them to the start of each source file to most effectively convey
  435. Xthe exclusion of warranty; and each file should have at least the
  436. X"copyright" line and a pointer to where the full notice is found.
  437. X
  438. X    <one line to give the program's name and a brief idea of what it does.>
  439. X    Copyright (C) 19yy    <name of author>
  440. X
  441. X    This program is free software; you can redistribute it and/or modify
  442. X    it under the terms of the GNU General Public License as published by
  443. X    the Free Software Foundation; either version 1, or (at your option)
  444. X    any later version.
  445. X
  446. X    This program is distributed in the hope that it will be useful,
  447. X    but WITHOUT ANY WARRANTY; without even the implied warranty of
  448. X    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  449. X    GNU General Public License for more details.
  450. X
  451. X    You should have received a copy of the GNU General Public License
  452. X    along with this program; if not, write to the Free Software
  453. X    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  454. X
  455. XAlso add information on how to contact you by electronic and paper mail.
  456. X
  457. XIf the program is interactive, make it output a short notice like this
  458. Xwhen it starts in an interactive mode:
  459. X
  460. X    Gnomovision version 69, Copyright (C) 19xx name of author
  461. X    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
  462. X    This is free software, and you are welcome to redistribute it
  463. X    under certain conditions; type `show c' for details.
  464. X
  465. XThe hypothetical commands `show w' and `show c' should show the
  466. Xappropriate parts of the General Public License.  Of course, the
  467. Xcommands you use may be called something other than `show w' and `show
  468. Xc'; they could even be mouse-clicks or menu items--whatever suits your
  469. Xprogram.
  470. X
  471. XYou should also get your employer (if you work as a programmer) or your
  472. Xschool, if any, to sign a "copyright disclaimer" for the program, if
  473. Xnecessary.  Here a sample; alter the names:
  474. X
  475. X  Yoyodyne, Inc., hereby disclaims all copyright interest in the
  476. X  program `Gnomovision' (a program to direct compilers to make passes
  477. X  at assemblers) written by James Hacker.
  478. X
  479. X  <signature of Ty Coon>, 1 April 1989
  480. X  Ty Coon, President of Vice
  481. X
  482. XThat's all there is to it!
  483. END_OF_FILE
  484.   if test 12473 -ne `wc -c <'lude-1.1/src/orig/COPYING'`; then
  485.     echo shar: \"'lude-1.1/src/orig/COPYING'\" unpacked with wrong size!
  486.   fi
  487.   # end of 'lude-1.1/src/orig/COPYING'
  488. fi
  489. if test -f 'lude-1.1/src/orig/README' -a "${1}" != "-c" ; then 
  490.   echo shar: Will not clobber existing file \"'lude-1.1/src/orig/README'\"
  491. else
  492.   echo shar: Extracting \"'lude-1.1/src/orig/README'\" \(12877 characters\)
  493.   sed "s/^X//" >'lude-1.1/src/orig/README' <<'END_OF_FILE'
  494. X
  495. X             ANNOUNCING LUDE: A DISTRIBUTED SOFTWARE LIBRARY
  496. X
  497. X
  498. X
  499. X       Pierre Laplante; Centre de Recherche Informatique de Montreal
  500. X    Stephane Boucher, Michel Dagenais: Ecole Polytechnique de Montreal
  501. X        Robert Gerin-Lajoie, Pierre Mailhot: Universite de Montreal
  502. X
  503. X
  504. X    The LUDE tools and associated documentation are freely redistributable
  505. X    under the terms of the GNU General Public License as published by
  506. X    the Free Software Foundation; either version 2, or (at your option)
  507. X    any later version.
  508. X
  509. X
  510. XNumerous software packages are being used and updated regularly on most 
  511. Xcomputer systems. Installing all these software packages is a formidable
  512. Xtask because each one has a different procedure for compiling or for
  513. Xplacing the files required at run time. This limits the number of
  514. Xpackages that a single system administrator can maintain. Moreover, it
  515. Xis difficult to organize software servers such that:
  516. X
  517. X  - heterogeneous systems can be served.
  518. X
  519. X  - each disk server can decide, on a package per package basis, if it wants a
  520. X    network access or a local copy of the executables
  521. X    and/or source code.
  522. X
  523. X  - users can access new software packages without editing their
  524. X    configuration files (.login .cshrc).
  525. X
  526. X  - more than one version of a given package can coexist during transitions.
  527. X
  528. X  - each software package is kept in a separate subtree to ease the
  529. X    management of disk space and prevent name conflicts.
  530. X
  531. X  - all the documentation is easily accessible through a single
  532. X    user interface.
  533. X
  534. X
  535. XThe LUDE (Logitheque Universitaire Distribuee et Extensible) software
  536. Xlibrary is a joint project of the Computer Science and Operational Research
  537. XDepartment of Universite de Montreal, of the Electrical and Computer
  538. XEngineering Department of Ecole Polytechnique de Montreal
  539. Xand of the Centre de recherche informatique de Montreal.
  540. XThe LUDE project was initiated in December 1991 to address the above
  541. Xmentioned goals. LUDE is an organization for installing software
  542. Xpackages, a set of tools to install and uninstall software packages
  543. Xand browse their documentation, and a number of FTP servers offering
  544. Xover 100 pre-installed freely available software packages.
  545. X
  546. XThe LUDE software library enables a large number of sites to pool the
  547. Xsoftware packages compiled by their system administrators. Each computer
  548. Xcan act as a client and/or a server as it desires. A client only needs a
  549. Xnetwork connection to a LUDE server (such as the Internet). A server
  550. Xneeds to install software packages as described in the Lude documentation 
  551. Xand to export them through NFS (Network File System) or FTP (File Transfer
  552. XProtocol). A client may represent a more or less heavy load for a server:
  553. X
  554. X  - A client takes a complete copy whenever a new package is available and
  555. X    remains autonomous thereafter. This represents a light load and can be
  556. X    performed between distant sites.
  557. X
  558. X  - A client takes a copy of the install and run subtrees and
  559. X    maintains a symbolic link to the source code on the server. If access to
  560. X    the source code is relatively infrequent, this is not a very heavy load
  561. X    either.
  562. X
  563. X  - A client only keeps symbolic links to the server 
  564. X    for the source code as well as the run time for most 
  565. X    software packages. Thus, each time one such package is
  566. X    accessed, the server is involved. This is only acceptable if the client
  567. X    and server are very close, on the same network and in the same
  568. X    organization.
  569. X
  570. X
  571. XTypically, a multi-level client server organization will be found:
  572. X
  573. X  - Public servers allow clients from around the world to take copies of
  574. X    their packages through FTP. Some usage restrictions may apply if
  575. X    the load is too high on these servers.
  576. X
  577. X  - Departmental servers regularly interact with public servers to keep a
  578. X    large set of up to date packages. Departmental clients may then use these
  579. X    packages either by taking a copy or even through symbolic links for the
  580. X    infrequently used packages. In some cases, a departmental server can also
  581. X    be a public server.
  582. X
  583. X  - A local server takes a copy of frequently used packages from the
  584. X    departmental server and perhaps keeps symbolic links for other packages.
  585. X    The source code for these packages is normally accessed through a
  586. X    symbolic link to the departmental server or to a nearby consenting
  587. X    public server.
  588. X
  589. X  - Individual workstations may simply mount /usr/local from the
  590. X    laboratory server.
  591. X
  592. X  - Notebook computers copy packages according to their upcoming needs for
  593. X    standalone, nomadic,  operation.
  594. X
  595. X
  596. XIn order to make the servers directly accessible to the lude tools, the 
  597. X/usr/local/server directory must lead to the /usr/local/soft
  598. Xdirectories on the reachable servers. This is conveniently achieved
  599. Xthrough automount (amd-5.2) and NFS. For instance, one could have:
  600. X
  601. X% ls /usr/local/server
  602. Xlude-poly                  lude-iro1            lude-crim
  603. X% ls /usr/local/server/lude-poly
  604. Xamd-5.2                ghostscript-2.4.1
  605. Xandrew-5.1             ghostview-1.2         
  606. Xdig.2.0                less-177          
  607. Xemacs-18.58            libg++-2.0  
  608. Xemacs-19.0             lude-1.0
  609. Xfind-3.5               modula3-2.11
  610. Xgcc-2.1                
  611. X
  612. X
  613. XSome coordination is required between the different lude servers.
  614. XIndeed, the same class names must be used to characterize the
  615. Xarchitecture and operating system of the computers. Similarly, when
  616. Xmany packages use the same information (fonts, emacs macros), 
  617. Xthe location in /usr/local must be agreed upon.
  618. X
  619. XMailing lists have been created for this purpose. Eventually they may
  620. Xbe replaced by Usenet newsgroups.
  621. X
  622. Xlude@iro.umontreal.ca: discussion and announcements on lude.
  623. X
  624. Xlude-request@iro.umontreal.ca: requests to be added or removed
  625. X
  626. Xlude-bugs@iro.umontreal.ca: problems encountered using the tools
  627. X                            associated with lude.
  628. X
  629. X
  630. XEach software package has a unique name consisting of its name and 
  631. Xversion number (for instance emacs-18.58). However, several 
  632. Xmodifications (or minor versions) may exist for a package; 
  633. Xthese usually represent minor modifications to
  634. Xthe original source code (for instance in the Makefile). Most often, 
  635. Xa single modification is needed and is named after the person or 
  636. Xthe site performing the compilation. Sometimes, a second 
  637. Xmodification exists which brings locally developed
  638. Xnew functionality, such as the modifications poly-plain and
  639. Xpoly-8bit for standard emacs versus one that accepts
  640. Xaccentuated characters.
  641. X
  642. XThe compiled binaries for a software package will differ according to the
  643. Xtarget architecture and operating system. The two together form the
  644. Xclass of the target system. The following classes have been
  645. Xregistered up to now. It is important that the same names be used
  646. Xthroughout the various LUDE software libraries on connected servers.
  647. X
  648. X  - linux0.99.10_386
  649. X
  650. X  - sun3.5_68020
  651. X
  652. X  - sun3.5_68010
  653. X
  654. X  - sun4.1_sparc
  655. X
  656. X  - sol2.1_sparc
  657. X
  658. X  - vax4.3_vax
  659. X
  660. X  - ultrix2.1_uvax
  661. X
  662. X  - ultrix4.1_mips
  663. X
  664. X  - dec2.1_alpha
  665. X
  666. X  - hp8.0_s200
  667. X
  668. X  - hp8.0_s800
  669. X
  670. X  - ibm3.1_rs6000
  671. X
  672. X  - sgi4.0_mips
  673. X
  674. X
  675. XThe proposed organization can be used on most operating systems that
  676. Xoffer tree-structured file systems and symbolic links. The utilities
  677. Xthat come along with LUDE require the Perl interpreter (available on
  678. Xmost platforms) and the system commands tar, date, hostname/uname 
  679. Xand domainname.
  680. X
  681. XTo install LUDE, one needs access to the /usr/local directory,
  682. Xand bin, lib, include, man, info, doc, soft and server sub-directories
  683. Xmust exist. A new sub-directory under /usr/local/soft will be created
  684. Xfor each software package installed.
  685. X
  686. XTo start, the LUDE utilities and the Perl interpreter must be retrieved.
  687. XThe following FTP servers are accessible on the Internet:
  688. Xftp.crim.ca, ftp.iro.umontreal.ca and ftp.vlsi.polymtl.ca. With FTP, 
  689. Xit is often easier to retrieve the complete subtree for a package 
  690. Xand then remove the unwanted binaries (for architectures not 
  691. Xused at your site).
  692. X
  693. XHere is how to proceed for installing lude and perl:
  694. X
  695. X% cd /usr/local/soft
  696. X% ftp ftp.crim.ca
  697. XConnected to Clouso.CRIM.CA.
  698. X220 clouso FTP server (Version 2.0WU(3) Mon Apr 12 22:48:26 EDT 1993) ready.
  699. XName (ftp.crim.ca:dagenais): ftp
  700. X331 Guest login ok, send e-mail address as password.
  701. XPassword:
  702. X230-
  703. X230-This ftp daemon support tar and compress.
  704. X230-To get a directory, append ".tar" to the name of the directory.
  705. X230-To get a compress version, append ".Z" to the name of the directory or file.
  706. X230-
  707. X230-
  708. X230 Guest login ok, access restrictions apply.
  709. Xftp> cd lude-crim
  710. X250 CWD command successful.
  711. Xftp> binary
  712. X200 Type set to I.
  713. Xftp> ls
  714. X200 PORT command successful.
  715. X150 Opening ASCII mode data connection for file list.
  716. XX11R5
  717. XTeX-3.141
  718. Xxrolo-v2p6
  719. Xprocmail-2.7
  720. Xet3.0-alpha.1
  721. Xlucid-19.3
  722. Xhyperbole-3.04
  723. Xwafe-0.92
  724. Xcvswrapper-0.9
  725. Xxntp-3.0
  726. Xbibview-1.4
  727. Xetgdb
  728. Xperl-4.035
  729. Xlude-1.1
  730. X226 Transfer complete.
  731. X859 bytes received in 0.3 seconds (2.8 Kbytes/s)
  732. Xftp> get lude-1.1.tar.Z
  733. X200 PORT command successful.
  734. X150 Opening BINARY mode data connection for /bin/tar.
  735. X226 Transfer complete.
  736. Xlocal: lude-1.1.tar.Z remote: lude-1.1.tar.Z
  737. Xftp> get perl-4.035.tar.Z
  738. X200 PORT command successful.
  739. X150 Opening BINARY mode data connection for /bin/tar.
  740. X226 Transfer complete.
  741. Xlocal: perl-4.035.tar.Z remote: perl-4.035.tar.Z
  742. Xftp> quit
  743. X221 Goodbye.
  744. X
  745. X% zcat lude-1.1.tar.Z | tar xf -
  746. X% rm lude-1.1.tar.Z
  747. X% zcat perl-4.035.tar.Z | tar xf -
  748. X% rm perl-4.035.tar.Z
  749. X% sh
  750. X$ PERL=/usr/local/soft/perl-4.035/run/poly/sun4.1_sparc/bin/perl
  751. X$ cd /usr/local/soft/lude-1.1/run/poly_eng/sun4.1_sparc/bin
  752. X$ $PERL lude -sof perl-4.035 -mod poly -cl sun4.1_sparc -link
  753. X$ ./lude -sof lude-1.1 -mod poly -class sun4.1_sparc -link
  754. X$ exit
  755. X%
  756. X
  757. X
  758. XThen, any other software package is easily installed. Suppose that you
  759. Xalso downloaded modula3-2.11.tar.Z in /usr/local/soft using FTP. 
  760. XThe following commands are now sufficient to install it.
  761. X
  762. X% zcat modula3-2.11.tar.Z | tar xf -
  763. X% rm modula3-2.11.tar.Z
  764. X% lude -sof modula3-2.11 -mod poly -class sun4.1_sparc -link
  765. X
  766. X
  767. XHowever, if lude or perl are not available for your
  768. Xarchitecture, their README files should explain how they can be
  769. Xcompiled and installed.
  770. X
  771. XEach software package is placed in its own subtree. Moreover, every
  772. Xversion of a software package is treated as a different package with its
  773. Xown subtree. The unique name of a package is then formed by the
  774. Xconcatenation of its name and version number (e.g. emacs-18.58,
  775. Xmodula3-2.11). This enables more than one version of the same software
  776. Xto coexist peacefully during transitions and simplifies the management
  777. Xof disk space since each package is kept separate.
  778. X
  779. XInside the subtree, three subdirectories are present src,
  780. Xrun and install, as well as a file, history, which traces where 
  781. Xthis package was copied from.
  782. X
  783. X                              Software-Version
  784. X       ______________________________|____________________
  785. X      /                    |                 |            \
  786. X     src                  run             history       install
  787. X   ___|___         ________|____                        ___|___
  788. X  /   |   \       /         |   \                      /   |   \    
  789. Xorig mod  ...   share      mod  ...                  orig mod  ...
  790. X                _|_        _|_____________           ______|______
  791. X               /   \      /           |   \         /             \
  792. X             man  ... `class`       share ...   `class`           ...
  793. X            ______________|____      _|_           |               |
  794. X           /   |   |   |   |   \    /   \          |               |
  795. X          bin man lib etc info ... man  ...     mapping         mapping
  796. X
  797. X
  798. XThe lude tools are used to create this file hierarchy, to install
  799. Xsymbolic links in the standard directories (/usr/local/bin, lib...)
  800. Xand to make the associated documentation available via World Wide Web
  801. Xand WAIS document browsing servers.
  802. X
  803. XEach installed software package has an associated summary under the
  804. XInternet Anonymous FTP Archive format (IAFA-PACKAGES). Moreover,
  805. Xman pages, info files and miscellaneous files in the doc subdirectory
  806. Xof a package are recognized by the documentation indexing tool.
  807. XPortions of this documentation (synopsis of man pages, IAFA-PACKAGES
  808. Xfiles...) is indexed through the Wide Area Information System (WAIS)
  809. Xand all these files are linked to form a World Wide Web hypertext
  810. Xdocument. Thus, it permits keyword searches to find relevant
  811. Xsoftware packages, and easy hypertext navigation through
  812. Xthe IAFA-PACKAGES, info, doc and man pages that accompany a 
  813. Xsoftware package, using a single browsing tool.
  814. X
  815. X
  816. XMost of this announcement was extracted from the info manual that
  817. Xcomes with Lude. Some may like to use Lude servers to browse source code,
  818. Xor to check how packages were compiled on a certain platform
  819. X(modifications to Makefiles) while others will directly install the
  820. Xpre compiled binaries. One should always be VERY CAREFUL executing
  821. Xdownloaded binaries and probably never do so as superuser.
  822. X
  823. XEnjoy!
  824. END_OF_FILE
  825.   if test 12877 -ne `wc -c <'lude-1.1/src/orig/README'`; then
  826.     echo shar: \"'lude-1.1/src/orig/README'\" unpacked with wrong size!
  827.   fi
  828.   # end of 'lude-1.1/src/orig/README'
  829. fi
  830. if test -f 'lude-1.1/src/orig/bug-report/lude-bug.el' -a "${1}" != "-c" ; then 
  831.   echo shar: Will not clobber existing file \"'lude-1.1/src/orig/bug-report/lude-bug.el'\"
  832. else
  833.   echo shar: Extracting \"'lude-1.1/src/orig/bug-report/lude-bug.el'\" \(1257 characters\)
  834.   sed "s/^X//" >'lude-1.1/src/orig/bug-report/lude-bug.el' <<'END_OF_FILE'
  835. X# Lude-bug - Util to report lude bugs.
  836. X
  837. X# Copyright (C) 1992 Stephane Boucher.
  838. X#
  839. X# This program is free software; you can redistribute it and/or modify
  840. X# it under the terms of the GNU General Public License as published by
  841. X# the Free Software Foundation; either version 1, or (at your option)
  842. X# any later version.
  843. X#
  844. X# This program is distributed in the hope that it will be useful,
  845. X# but WITHOUT ANY WARRANTY; without even the implied warranty of
  846. X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  847. X# GNU General Public License for more details.
  848. X#
  849. X# You should have received a copy of the GNU General Public License
  850. X# along with this program; if not, write to the Free Software
  851. X# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  852. X
  853. X(defvar lude-bug-template-file "/usr/users/sbo/lude/bug-report/template"
  854. X  "File containing the template to use for Lude's bug repports.")
  855. X
  856. X(defvar lude-bug-email-addr "lude-bugs@iro.umontreal.ca"
  857. X  "E-mail address where to send bug reports.")
  858. X(defun lude-report-bug ()
  859. X  (interactive)
  860. X  (mail)
  861. X  (goto-char (point-min))(end-of-line)
  862. X  (insert lude-bug-email-addr)
  863. X  (goto-char (point-max))
  864. X  (insert-file lude-bug-template-file)
  865. X  (goto-char (point-min))(next-line 1)(end-of-line))
  866. X
  867. X(provide 'lude-bug)
  868. END_OF_FILE
  869.   if test 1257 -ne `wc -c <'lude-1.1/src/orig/bug-report/lude-bug.el'`; then
  870.     echo shar: \"'lude-1.1/src/orig/bug-report/lude-bug.el'\" unpacked with wrong size!
  871.   fi
  872.   # end of 'lude-1.1/src/orig/bug-report/lude-bug.el'
  873. fi
  874. if test -f 'lude-1.1/src/orig/src/ludeadminc' -a "${1}" != "-c" ; then 
  875.   echo shar: Will not clobber existing file \"'lude-1.1/src/orig/src/ludeadminc'\"
  876. else
  877.   echo shar: Extracting \"'lude-1.1/src/orig/src/ludeadminc'\" \(8880 characters\)
  878.   sed "s/^X//" >'lude-1.1/src/orig/src/ludeadminc' <<'END_OF_FILE'
  879. X# ludeadminc - Project lude.
  880. X# Copyright (C) 1991,1992  Pierre Laplante
  881. X# Copyright (C) 1992,1993 Stephane Boucher, Ecole Polytechnique de Montreal.
  882. X#
  883. X# This program is free software; you can redistribute it and/or modify
  884. X# it under the terms of the GNU General Public License as published by
  885. X# the Free Software Foundation; either version 1, or (at your option)
  886. X# any later version.
  887. X#
  888. X# This program is distributed in the hope that it will be useful,
  889. X# but WITHOUT ANY WARRANTY; without even the implied warranty of
  890. X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  891. X# GNU General Public License for more details.
  892. X#
  893. X# You should have received a copy of the GNU General Public License
  894. X# along with this program; if not, write to the Free Software
  895. X# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  896. X
  897. X$FULL_VERSION.= '$Id: ludeadminc,v 1.4 1993/03/17 19:44:08 sbo Exp $' ."\n";
  898. X
  899. X#-----------------------------------------------------------------------
  900. X#
  901. X#    Local definitions
  902. X#
  903. X
  904. Xsub localDef {
  905. X    
  906. X# Environnement
  907. X    
  908. X    $ENV{'SHELL'} = '/bin/sh' if $ENV{'SHELL'} ne '';
  909. X    
  910. X    # debug level
  911. X    if (!defined($Debugvalue)) { $Debugvalue=$DEFAULTDEBUGLEVEL; }
  912. X    
  913. X    # get progname
  914. X    $Progname=&BaseName($0);
  915. X    
  916. X    $Server=$Software=$Modification="";
  917. X    $Create=$Mount_tfs=$Umount_tfs=$Lock=$Release=$FALSE;
  918. X    $Duplicate=$Unduplicate=$FALSE;
  919. X    $Show=$Verbose=$FALSE;
  920. X}
  921. X
  922. X
  923. Xsub ExecCommands {
  924. X    local($retval)=1;        # Success by default
  925. X
  926. X    if ($Server ne '/') {
  927. X    &DispSoftFoundOnce("$SERVER_DIR/$Server", $Software, $Modification, $Class);
  928. X    }
  929. X    else {
  930. X    &DispSoftFoundOnce("$SOFT_DIR", $Software, $Modification, $Class);
  931. X    }
  932. X
  933. X    if ($Create) {
  934. X    &Verbose($VERB_START_CREATE, $Software, $Modification, $Class);
  935. X    if (! &Create($Server, $Software, $Modification, $Class)) {
  936. X        return 0;
  937. X    }
  938. X    &Warning($VERB_CREATE_DONE);
  939. X    &HistAppend("create", $Server, $Software, $Modification, $Class);
  940. X    }
  941. X    if ($Duplicate) {
  942. X    &Verbose($VERB_START_DUPLICATE, "$Software/src/$Modification");
  943. X    if (&Duplicate($Server, $Software, $Modification)) {
  944. X        return 0;
  945. X    }
  946. X    &Warning($VERB_DUPLICATE_DONE);
  947. X    &HistAppend("duplicate", $Server, $Software, $Modification, '');
  948. X    }
  949. X    if ($Unduplicate) {
  950. X    &Verbose($VERB_START_UNDUPLICATE, "$Software/src/$Modification");
  951. X    if (! &Unduplicate($Server, $Software, $Modification)) {
  952. X        return 0;
  953. X    }
  954. X    &Warning($VERB_UNDUPLICATE_DONE);
  955. X    &HistAppend("unduplicate", $Server, $Software, $Modification, '');
  956. X    }
  957. X    if ($Mount_tfs) {    
  958. X    &Verbose($VERB_START_MOUNT_TFS);
  959. X    if (! &Mount_tfs($Server, $Software, $Modification)) {
  960. X        return 0;
  961. X    }
  962. X    &Warning($VERB_MOUNT_TFS_DONE);
  963. X    &HistAppend("mount_tfs", $Server, $Software, $Modification, $Class);
  964. X    }
  965. X    if ($Umount_tfs) {    
  966. X    &Verbose($VERB_START_UMOUNT_TFS);
  967. X    if (! &Umount_tfs($Server, $Software, $Modification)) {
  968. X        return 0;
  969. X    }
  970. X    &Warning($VERB_UMOUNT_TFS_DONE);
  971. X    &HistAppend("umount_tfs", $Server, $Software, $Modification, $Class);
  972. X    }
  973. X    if ($Lock) {
  974. X    &Verbose($VERB_START_LOCK);
  975. X    if (! &Lock($Server, $Software, $Modification, $Class)) {
  976. X        return 0;
  977. X    }
  978. X    &Warning($VERB_LOCK_DONE);
  979. X    &HistAppend("lock", $Server, $Software, $Modification, $Class);
  980. X    }
  981. X    if ($Release) {
  982. X    &Verbose($VERB_START_RELEASE);
  983. X    if (! &Release($Server, $Software, $Modification, $Class)) {
  984. X        return 0;
  985. X    }
  986. X    &Warning($VERB_RELEASE_DONE);
  987. X    &HistAppend("release", $Server, $Software, $Modification, $Class);
  988. X    }
  989. X
  990. X    return $retval;
  991. X}
  992. X
  993. X
  994. X#-----------------------------------------------------------------------
  995. X#
  996. X#    Initialisation
  997. X#
  998. X# Returns : the number of commands left to do
  999. X#           or -1 if any error      
  1000. Xsub Initialisation {
  1001. X    local($retval)=1;        # success by default
  1002. X    local($cmdsToDo)=0;
  1003. X    local($displayVersion)=$FALSE;
  1004. X    local($displayFullVersion)=$FALSE;
  1005. X    
  1006. X# Globals definitions
  1007. X    
  1008. X# Locals definitions
  1009. X    
  1010. X    &localDef();
  1011. X    
  1012. X# scan aguments
  1013. X    
  1014. X    local($class_arg)       =&BldRegexpMinRqr('class', 2);
  1015. X    local($create_arg)      =&BldRegexpMinRqr('create', 2);
  1016. X    local($debug_arg)       =&BldRegexpMinRqr('debug', 2);
  1017. X    local($duplicate_arg)   =&BldRegexpMinRqr('duplicate', 2);
  1018. X    local($full_version_arg)=&BldRegexpMinRqr("full-version", 1);
  1019. X    local($help_arg)        =&BldRegexpMinRqr("help", 1);
  1020. X    local($language_arg)    ='language';
  1021. X    local($lock_arg)        =&BldRegexpMinRqr("lock", 2);
  1022. X    local($modification_arg)=&BldRegexpMinRqr("modification", 3);
  1023. X    local($mount_tfs_arg)   =&BldRegexpMinRqr("mount_tfs", 3);
  1024. X    local($release_arg)     =&BldRegexpMinRqr("release", 1);
  1025. X    local($server_arg)      =&BldRegexpMinRqr("server", 2);
  1026. X    local($show_arg)        =&BldRegexpMinRqr("show", 2);
  1027. X    local($software_arg)    =&BldRegexpMinRqr("software", 2);
  1028. X    local($umount_tfs_arg)  =&BldRegexpMinRqr('umount_tfs', 2);
  1029. X    local($unduplicate_arg) =&BldRegexpMinRqr('unduplicate', 2);
  1030. X    local($verbose_arg)     =&BldRegexpMinRqr("verbose", 4);
  1031. X    local($version_arg)     =&BldRegexpMinRqr("version", 4);
  1032. X
  1033. X    while ($_=$ARGV[0],/^-/) {
  1034. X
  1035. X    last if (/^--$/);
  1036. X
  1037. X    shift(@ARGV);
  1038. X      
  1039. X    if (/^-$class_arg$/o)        { &Arg($_, *Class, '[\-\w+.]+'); }
  1040. X    elsif (/^-$create_arg$/o)    { $cmdsToDo++; $Create=$TRUE; }
  1041. X    elsif (/^-$debug_arg$/o)     { &Arg($_, *Debuglevel, '[0-9]+'); }
  1042. X    elsif (/^-$duplicate_arg$/o) { $cmdsToDo++; $Duplicate=$TRUE; }
  1043. X    elsif (/^-$full_version_arg$/o) { $displayFullVersion=$TRUE; }
  1044. X    elsif (/^-($help_arg)|([?])$/o) { &Help; }
  1045. X        elsif (/^-$language_arg$/o)  { shift @ARGV; } # Just ignore it
  1046. X    elsif (/^-$lock_arg$/o)      { $cmdsToDo++; $Lock=$TRUE; }
  1047. X    elsif (/^-$modification_arg$/o) { 
  1048. X        &Arg($_, *Modification, '[\-\w+.]+'); 
  1049. X    }
  1050. X    elsif (/^-$mount_tfs_arg$/o) { 
  1051. X      if ($CONF_HAVE_TFS) { $cmdsToDo++; $Mount_tfs=$TRUE; }
  1052. X      else                { &Usage($ERR_TFS_NOT_SUPPORTED); }
  1053. X    }
  1054. X    elsif (/^-$release_arg$/o)   { $cmdsToDo++; $Release=$TRUE; }
  1055. X    elsif (/^-$show_arg$/o)      { $Show=$Verbose=$TRUE; }    # verbose implicit
  1056. X    elsif (/^-$server_arg$/o)    { &Arg($_, *Server, '[\-\w+.]+'); }
  1057. X    elsif (/^-$software_arg$/o)  { 
  1058. X        &Arg($_, *Software, '[\-\w+.]+'); 
  1059. X    }
  1060. X    elsif (/^-$umount_tfs_arg$/o){ $cmdsToDo++; $Umount_tfs=$TRUE; }
  1061. X    elsif (/^-$unduplicate_arg$/o) { $cmdsToDo++; $Unduplicate=$TRUE; }
  1062. X    elsif (/^-$verbose_arg$/o)   { $Verbose=$TRUE; }
  1063. X    elsif (/^-$version_arg$/o)   { $displayVersion=$TRUE; }
  1064. X    else {
  1065. X        &Usage($INVALID_ARGUMENT, $_);
  1066. X    }
  1067. X    }
  1068. X
  1069. X    # Display the version immediately if requested
  1070. X    if ($displayVersion) {
  1071. X    print $OUT $VERSION . "\n";
  1072. X    }
  1073. X    # Display the full version (i.e. RCS revs) immediately if requested
  1074. X    if ($displayFullVersion) {
  1075. X    print $OUT $FULL_VERSION . "\n";
  1076. X    }
  1077. X
  1078. X    #
  1079. X    # Validation of the arguments
  1080. X    #
  1081. X    # Extra and invalid argument 
  1082. X    if ( $ARGV[0] ne "" ) { 
  1083. X    &Usage($INVALID_ARGUMENT, $ARGV[0]);
  1084. X    }
  1085. X
  1086. X    # -class with anything
  1087. X    # -debug with anything
  1088. X    # -duplicate with anything but ... 
  1089. X    if ($Duplicate && ($Mount_tfs || $Umount_tfs || $Unduplicate)) {
  1090. X    &Usage($ERR_INCOMP_ARGS, '-mount_tfs|-umount_tfs|-unduplicate'); 
  1091. X    }
  1092. X    # -lock with anything
  1093. X    # -modification with anything
  1094. X    # -modification must be specified with...
  1095. X    if ($Modification eq '' && ($Create)) {
  1096. X    &Usage($ERR_ARG_REQUIRED, '-modification');
  1097. X    }
  1098. X    # -mount_tfs with anything but ...
  1099. X    if ($Mount_tfs && ($Umount_tfs)) {
  1100. X    &Usage($ERR_INCOMP_ARGS, '-mount_tfs', '-umount_tfs'); 
  1101. X    }
  1102. X    # -release with anything
  1103. X    # -server with anything
  1104. X    # -software with anything
  1105. X    # -software is required with ...
  1106. X    if ($Software eq '' && ($Create || $Mount_tfs || 
  1107. X                $Umount_tfs  || $Lock || $Release)) {
  1108. X    &Usage($ERR_ARG_REQUIRED, '-software');
  1109. X    }
  1110. X    # -umount_tfs with anything but ...
  1111. X    if ($Umount_tfs && ($Mount_tfs)) {
  1112. X    &Usage($ERR_INCOMP_ARGS, '-umount_tfs', '-mount_tfs'); 
  1113. X    }
  1114. X    # -unduplicate with anything but ... 
  1115. X    if ($Unduplicate && ($Mount_tfs || $Umount_tfs || $Duplicate)) {
  1116. X    &Usage($ERR_INCOMP_ARGS, '-mount_tfs|-umount_tfs|-duplicate'); 
  1117. X    }
  1118. X    # -verbose with anything
  1119. X
  1120. X    # Find the default class if not already specified
  1121. X    local(@classes);
  1122. X    if ($Class eq '') {
  1123. X    local($cmd);
  1124. X    if ($Create) {
  1125. X        $cmd='class';
  1126. X        chop($Class=`$cmd`);
  1127. X        @classes=($Class);
  1128. X    } 
  1129. X    else {
  1130. X        $cmd='class -l';
  1131. X        @classes=split(/\s+/, `$cmd`);
  1132. X    }
  1133. X    }
  1134. X    else {
  1135. X    @classes=($Class);
  1136. X    }
  1137. X
  1138. X    if (! $Create) {
  1139. X    # Find a server
  1140. X    local($searchcmd)='lst';
  1141. X
  1142. X    local(@serverfound)=
  1143. X        &FindSoftware($searchcmd, $Server, $Software, $Modification, @classes);
  1144. X    
  1145. X    # If the list @serverfound is empty, that means an error
  1146. X    if (scalar(@serverfound) == 0) {
  1147. X        &Error($ERR_NOSER, $Software);
  1148. X    }
  1149. X    else {
  1150. X        ($Server, $Software, $Modification, $Class)=
  1151. X        split($;, $serverfound[$[]);
  1152. X    }
  1153. X    }
  1154. X    elsif ($Server eq '') {
  1155. X    # Case of a create command with no server specified
  1156. X    $Server='/';
  1157. X    }
  1158. X
  1159. X    return $cmdsToDo;
  1160. X}    
  1161. X
  1162. X1;
  1163. X
  1164. X#     ;;; Local Variables: ***
  1165. X#     ;;; mode:perl ***
  1166. X#     ;;; End: ***
  1167. END_OF_FILE
  1168.   if test 8880 -ne `wc -c <'lude-1.1/src/orig/src/ludeadminc'`; then
  1169.     echo shar: \"'lude-1.1/src/orig/src/ludeadminc'\" unpacked with wrong size!
  1170.   fi
  1171.   # end of 'lude-1.1/src/orig/src/ludeadminc'
  1172. fi
  1173. if test -f 'lude-1.1/src/orig/src/ludeinc' -a "${1}" != "-c" ; then 
  1174.   echo shar: Will not clobber existing file \"'lude-1.1/src/orig/src/ludeinc'\"
  1175. else
  1176.   echo shar: Extracting \"'lude-1.1/src/orig/src/ludeinc'\" \(13078 characters\)
  1177.   sed "s/^X//" >'lude-1.1/src/orig/src/ludeinc' <<'END_OF_FILE'
  1178. X# ludeinc - Project lude.
  1179. X# Copyright (C) 1991, 1992  Pierre Laplante.
  1180. X# Copyright (C) 1992 Stephane Boucher.
  1181. X#
  1182. X# This program is free software; you can redistribute it and/or modify
  1183. X# it under the terms of the GNU General Public License as published by
  1184. X# the Free Software Foundation; either version 1, or (at your option)
  1185. X# any later version.
  1186. X#
  1187. X# This program is distributed in the hope that it will be useful,
  1188. X# but WITHOUT ANY WARRANTY; without even the implied warranty of
  1189. X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  1190. X# GNU General Public License for more details.
  1191. X#
  1192. X# You should have received a copy of the GNU General Public License
  1193. X# along with this program; if not, write to the Free Software
  1194. X# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  1195. X
  1196. X$FULL_VERSION.= '$Id: ludeinc,v 1.5 1993/06/01 16:57:02 dagenais Exp $' ."\n";
  1197. X
  1198. X#-----------------------------------------------------------------------
  1199. X#
  1200. X#    ExecCommands: Determine which command to execute.
  1201. X#
  1202. Xsub ExecCommands {
  1203. X    local($retval)=1;     # Success by default
  1204. X    local($install);
  1205. X
  1206. X    # Set $softdir in case it is needed later to DispSoftFoundOnce
  1207. X    if ($Server ne '/') {
  1208. X    $softdir="$SERVER_DIR/$Server";
  1209. X    }
  1210. X    else {
  1211. X    $softdir=$LOCAL_DIR;
  1212. X    }
  1213. X
  1214. X    $install="$SOFT_DIR/$Software/install/$Modification/$Class";
  1215. X
  1216. X    if ($Rmlink) {
  1217. X    &DispSoftFoundOnce($softdir, $Software, $Modification, $Class);
  1218. X        &Verbose($VERB_START_RMLINK);
  1219. X
  1220. X        # Read the mapping file
  1221. X    if ( -r "$install/$MAPPING" ) {
  1222. X        if (! &ReadMapping("$install/$MAPPING")) {
  1223. X        return 0;
  1224. X        }
  1225. X    }
  1226. X
  1227. X    if ( -x "$install/$BEFORERMLINK") {
  1228. X        &RunCmd("$install/$BEFORERMLINK");
  1229. X    }
  1230. X
  1231. X    if ((&RmLinks("$SOFT_DIR/$Software/run/$Modification/$Class", "$LOCAL_DIR", "")+
  1232. X         &RmLinkDoc($Software, $Modification)) <=> 2) {
  1233. X        # all 2 operation did not succeed
  1234. X        return 0; 
  1235. X    }
  1236. X    if ( -x "$install/$AFTERRMLINK") {
  1237. X            &RunCmd("$install/$AFTERRMLINK");
  1238. X    }
  1239. X
  1240. X    &Warning($WARN_RMLINK);
  1241. X    &HistAppend("rmlink", '/', $Software, $Modification, $Class);
  1242. X    }
  1243. X
  1244. X    # Copy the files
  1245. X    if ($Copy ne '') {
  1246. X    &DispSoftFoundOnce($softdir, $Software, $Modification, $Class);
  1247. X        &Verbose($VERB_START_COPY, $Copy);
  1248. X
  1249. X    local($targ);
  1250. X    if ($Target ne '')      { $targ=$Target; }
  1251. X    elsif ($Lntarget ne '') { $targ=$Lntarget; }
  1252. X    else                    { $targ='/'; }
  1253. X        
  1254. X    if (! &Copy($targ, $Server, 
  1255. X            $Software, $Modification, $Class, $Copy)) {
  1256. X        return 0;
  1257. X    }
  1258. X    else {
  1259. X        if ($Lntarget ne '') {
  1260. X        if (! symlink("$SERVER_DIR/$targ/$Software", "$SOFT_DIR/$Software")) {
  1261. X            &NFError($ERR_SYMLINK,
  1262. X                 "$SERVER_DIR/$targ/$Software", "$SOFT_DIR/$Software",
  1263. X                 "");
  1264. X            return 0;
  1265. X        }
  1266. X        }
  1267. X    }
  1268. X
  1269. X    &Warning($WARN_COPY);
  1270. X    &HistAppend("copy: ($Copy)", $targ, $Software, $Modification, $Class);
  1271. X    } 
  1272. X    elsif ($Rmcopy) {
  1273. X    &DispSoftFoundOnce($softdir, $Software, $Modification, $Class);
  1274. X        &Verbose($VERB_START_RMCOPY);
  1275. X
  1276. X    local($targ);
  1277. X    if ($Target ne '')      { $targ=$Target; }
  1278. X    elsif ($Lntarget ne '') { $targ=$Lntarget; }
  1279. X    else                    { $targ='/'; }
  1280. X        
  1281. X    &RmCopy($targ, $Software, $Modification, $Class);
  1282. X    &Warning($WARN_RMCOPY);
  1283. X    &HistAppend("rmcopy", $targ, $Software, $Modification, $Class);
  1284. X    }
  1285. X
  1286. X    # Do the links
  1287. X    if ( $Link ) {
  1288. X    &DispSoftFoundOnce($softdir, $Software, $Modification, $Class);
  1289. X        &Verbose($VERB_START_LINK);
  1290. X
  1291. X        # Read the mapping file
  1292. X    if ( -r "$install/$MAPPING" ) {
  1293. X        if (! &ReadMapping("$install/$MAPPING")) {
  1294. X        return 0;
  1295. X        }
  1296. X    }
  1297. X
  1298. X    if ( -x "$install/$BEFORELINK") {
  1299. X        &RunCmd("$install/$BEFORELINK");
  1300. X    }
  1301. X
  1302. X    &MkLinks("$SOFT_DIR/$Software/run/$Modification/$Class", "$LOCAL_DIR", "");
  1303. X    &LinkDoc($Software, $Modification);
  1304. X
  1305. X    if ( -x "$install/$AFTERLINK") {
  1306. X        &RunCmd("$install/$AFTERLINK");
  1307. X    }
  1308. X
  1309. X    &Warning($WARN_LINK);
  1310. X    &HistAppend("link", '/', $Software, $Modification, $Class);
  1311. X    } 
  1312. X    
  1313. X    return $retval;
  1314. X} 
  1315. X
  1316. X
  1317. X#-----------------------------------------------------------------------
  1318. X#
  1319. X#    Local definitions
  1320. X#
  1321. X
  1322. Xsub localDef {
  1323. X    
  1324. X# Environnement
  1325. X    
  1326. X    $ENV{'SHELL'} = '/bin/sh' if $ENV{'SHELL'} ne '';
  1327. X    
  1328. X# debug level
  1329. X    
  1330. X    if (!defined($Debugvalue)) { $Debugvalue=$DEFAULTDEBUGLEVEL; }
  1331. X    
  1332. X# get progname
  1333. X    
  1334. X    $Progname=&BaseName($0);
  1335. X    
  1336. X    
  1337. X#-----------------------------------------------------------------------
  1338. X#
  1339. X#    Globals definitions
  1340. X#
  1341. X
  1342. Xif (!defined($Progname))          { $Progname="ludeinc"; }
  1343. Xif (!defined($HELP)) {
  1344. X    $HELP="There is no help defined for this program.\n";
  1345. X}
  1346. X
  1347. X    $Link=$Rmlink=$Rmcopy=$Index=
  1348. X    $Force=$FALSE;
  1349. X    $Show=$Verbose=$FALSE;
  1350. X    $Modification=$Class=$Preserve=$Software="";
  1351. X    $Server='';
  1352. X    $Copy="";
  1353. X    $Target=$Lntarget="";
  1354. X    $Config="";
  1355. X}
  1356. X
  1357. X#-----------------------------------------------------------------------
  1358. X#
  1359. X# Description: Initialise some variables.
  1360. X#              parse and validate the command line arguments.
  1361. X#
  1362. X# Parameters : none
  1363. X#
  1364. X# return     : the number of commands still to be done
  1365. X#              or -1 if an error occured
  1366. X#
  1367. Xsub Initialisation {
  1368. X    local($cmdsToDo)=0;        # Nothing left to do
  1369. X    local($test)=$FALSE;    # By default the soft must be released
  1370. X    local($displayVersion)=$FALSE;
  1371. X    local($displayFullVersion)=$FALSE;
  1372. X
  1373. X    # Locals definitions
  1374. X    &localDef();
  1375. X    
  1376. X    local($class_arg)       =&BldRegexpMinRqr("class", 2);
  1377. X    local($config_arg)      =&BldRegexpMinRqr("config", 3);
  1378. X    local($copy_arg)        =&BldRegexpMinRqr("copy", 3);
  1379. X    local($debug_arg)       =&BldRegexpMinRqr("debug", 1);
  1380. X    local($force_arg)       =&BldRegexpMinRqr("force", 2);
  1381. X    local($full_version_arg)=&BldRegexpMinRqr("full-version", 2);
  1382. X    local($help_arg)        =&BldRegexpMinRqr("help", 1);
  1383. X    local($install_arg)     =&BldRegexpMinRqr("install", 3);
  1384. X    local($language_arg)    ='language';
  1385. X    local($link_arg)        =&BldRegexpMinRqr("link", 2);
  1386. X    local($lntarget_arg)    =&BldRegexpMinRqr("lntarget", 2);
  1387. X    local($modification_arg)=&BldRegexpMinRqr("modification", 1);
  1388. X    local($preserve_arg)    =&BldRegexpMinRqr("preserve", 1);
  1389. X    local($rmcopy_arg)      =&BldRegexpMinRqr("rmcopy", 3);
  1390. X    local($rmlink_arg)      =&BldRegexpMinRqr("rmlink", 3);
  1391. X    local($server_arg)      =&BldRegexpMinRqr("server", 2);
  1392. X    local($show_arg)        =&BldRegexpMinRqr("show", 2);
  1393. X    local($software_arg)    =&BldRegexpMinRqr("software", 2);
  1394. X    local($target_arg)      =&BldRegexpMinRqr("target", 2);
  1395. X    local($test_arg)        =&BldRegexpMinRqr("test", 2);
  1396. X    local($uninstall_arg)   =&BldRegexpMinRqr("uninstall",1);
  1397. X    local($verbose_arg)     =&BldRegexpMinRqr("verbose", 4);
  1398. X    local($version_arg)     =&BldRegexpMinRqr("version", 4);
  1399. X
  1400. X    while ($_=$ARGV[0],/^-/) {
  1401. X
  1402. X    last if (/^--$/);
  1403. X
  1404. X    shift(@ARGV);
  1405. X
  1406. X    if (/^-$class_arg$/o)        { &Arg($_, *Class, '[\-\w+.]+'); }
  1407. X    elsif (/^-$config_arg$/o)    { &Arg($_, *Config, '[^\s]+'); }
  1408. X    elsif (/^-$copy_arg$/o)      { $cmdsToDo++;
  1409. X        &Arg($_, *Copy, 
  1410. X         '((src,run)|(run,src)|(src)|(run)|(none))');
  1411. X    }
  1412. X    elsif (/^-$debug_arg$/o)     { &Arg($_, *Debugvalue, '[0-9]+'); }
  1413. X    elsif (/^-$force_arg$/o)     { $Force=$TRUE; }
  1414. X    elsif (/^-$full_version_arg$/o) { $displayFullVersion=$TRUE; }
  1415. X    elsif (/^-($help_arg)|([?])$/o) { &Help; }
  1416. X    elsif (/^-$install_arg$/o)   { $cmdsToDo+=2; $Copy='run'; 
  1417. X                       $Link=$TRUE; }
  1418. X    elsif (/^-$language_arg$/o)  { shift @ARGV; } # Just ignore it
  1419. X    elsif (/^-$link_arg$/o)      { $cmdsToDo++; $Link=$TRUE; }
  1420. X    elsif (/^-$lntarget_arg$/o)  {
  1421. X        &Arg($_, *Lntarget, '[\-\w+.]+'); 
  1422. X    }
  1423. X    elsif (/^-$modification_arg$/o) { 
  1424. X        &Arg($_, *Modification, '[\-\w+.]+'); 
  1425. X    }
  1426. X    elsif (/^-$preserve_arg$/o)  { &Arg($_, *Preserve, '[^\s]+'); }
  1427. X    elsif (/^-$rmcopy_arg$/o)    { $cmdsToDo++; $Rmcopy=$TRUE; }
  1428. X    elsif (/^-$rmlink_arg$/o)    { $cmdsToDo++; $Rmlink=$TRUE; }
  1429. X    elsif (/^-$server_arg$/o)    { &Arg($_, *Server, '[\-\w+.]+'); }
  1430. X    elsif (/^-$show_arg$/o)      { $Show=$Verbose=$TRUE; } # Show implies Verbose
  1431. X    elsif (/^-$software_arg$/o)  { 
  1432. X        &Arg($_, *Software, '[\-0-9a-zA-Z.+_]+'); 
  1433. X    }
  1434. X    elsif (/^-$target_arg$/o)    {
  1435. X        &Arg($_, *Target, '[\-0-9a-zA-Z.+_]+'); 
  1436. X    }
  1437. X    elsif (/^-$test_arg$/o)      { $test=$TRUE; }
  1438. X    elsif (/^-$uninstall_arg$/o) { $cmdsToDo+=2;
  1439. X        $Rmcopy=$Rmlink=$TRUE; 
  1440. X    }
  1441. X    elsif (/^-$verbose_arg$/o)   { $Verbose=$TRUE; }
  1442. X    elsif (/^-$version_arg$/o)   { $displayVersion=$TRUE; }
  1443. X    else {
  1444. X        &Usage($INVALID_ARGUMENT, $_);
  1445. X    }
  1446. X    }
  1447. X
  1448. X    # Display the version immediately if requested
  1449. X    if ($displayVersion) {
  1450. X    print $OUT $VERSION ."\n";
  1451. X    }
  1452. X    # Display the full version (i.e. RCS revs) immediately if requested
  1453. X    if ($displayFullVersion) {
  1454. X    print $OUT $FULL_VERSION ."\n";
  1455. X    }
  1456. X
  1457. X    #
  1458. X    # Validation of the arguments
  1459. X    #
  1460. X    # Extra and invalid argument 
  1461. X    if ( $ARGV[0] ne "" ) { 
  1462. X    &Usage($INVALID_ARGUMENT, $ARGV[0]);
  1463. X    }
  1464. X
  1465. X    # -class with anything
  1466. X    # -config with anything
  1467. X    # -copy with anything but ...
  1468. X    if ($Copy ne '' && ($Rmlink || $Rmcopy)) {
  1469. X    &Usage($ERR_INCOMP_ARGS, '-copy', '-rmlink|-rmcopy'); 
  1470. X    }
  1471. X    # -force with anything but ...
  1472. X    if ($Force && ($Target ne '' || $Lntarget ne '' || 
  1473. X           $Rmlink || $Preserve ne '' || $Rmcopy)) {
  1474. X    &Usage($ERR_INCOMP_ARGS, '-force', 
  1475. X           '-target|-lntraget|-rmlink|-preserve|-rmcopy'); 
  1476. X    }
  1477. X    # -link with anything but ...
  1478. X    if ($Link && ($Target ne '' || $Rmlink || $Rmcopy)) {
  1479. X    &Usage($ERR_INCOMP_ARGS, '-link', '-target|-rmlink|-rmcopy'); 
  1480. X    }
  1481. X    # -lntarget with anything but ...
  1482. X    if ($Lntarget ne '' && ($Rmlink || $Target ne '')) {
  1483. X    &Usage($ERR_INCOMP_ARGS, '-lntarget', 
  1484. X           '-rmlink|-target'); 
  1485. X    }
  1486. X    # -modification with anything
  1487. X    # -preserve with anything but ...
  1488. X    if ($Preserve ne '' && ($Target ne '' || 
  1489. X                $Rmlink || $Force || $Rmcopy)) {
  1490. X    &Usage($ERR_INCOMP_ARGS, '-preserve', 
  1491. X           '-target|-rmlink|-force|-rmcopy'); 
  1492. X    }
  1493. X    # -rmcopy with anything but ...
  1494. X    if ($Rmcopy && ($Server ne '' || $Copy ne '' || $Link ||
  1495. X            $Force || $Preserve ne '')) {
  1496. X    &Usage($ERR_INCOMP_ARGS, '-rmcopy', 
  1497. X           '-server|-target|-copy|-link|-force|-preserve'); 
  1498. X    }
  1499. X    # -rmlink with anything but ...
  1500. X    if ($Rmlink && ($Server ne '' || $Target ne '' ||
  1501. X            $Copy ne '' || $Lntarget ne '' || $Link ||
  1502. X            $Force || $Preserve ne '')) {
  1503. X    &Usage($ERR_INCOMP_ARGS, '-rmlink', 
  1504. X           '-server|-target|-copy|-lntraget|-link|-force|-preserve'); 
  1505. X    } 
  1506. X    # -server with anything but ...
  1507. X    if ($Server ne '' && ($Rmlink || $Rmcopy)) {
  1508. X    &Usage($ERR_INCOMP_ARGS, '-server', '-rmlink|-rmcopy'); 
  1509. X    }
  1510. X    # -software must be specified with...
  1511. X    if ($Software eq '' && ($Copy ne '' || $Rmcopy ||
  1512. X                $Link || $Rmlink)) {
  1513. X    &Usage($ERR_ARG_REQUIRED, '-software');
  1514. X    }
  1515. X    # -show with anything
  1516. X    # -target with anything but ...
  1517. X    if ($Target ne '' && ($Man || $Info || $Doc ||
  1518. X              $Link || $Rmlink || $Force || $Lntarget ne '' ||
  1519. X              $Preserve ne '')) {
  1520. X    &Usage($ERR_INCOMP_ARGS, '-target', 
  1521. X           '-man|-info|-doc|-link|-force|-lntarget|-rmlink|-preserve|-rmcopy'); 
  1522. X    }
  1523. X    # -test requires -copy or -rmcopy or -link or -rmlink
  1524. X    if ($test == $TRUE && ($Copy eq '' && ! $Rmcopy && ! $Link && ! $Rmlink)) {
  1525. X      &Usage($ERR_ARG_REQUIRES, '-test',
  1526. X         '-copy|-rmcopy|-link|-rmlink');
  1527. X    }
  1528. X    # -verbose with anything
  1529. X
  1530. X    # Find the default class if not already specified
  1531. X    local(@classes);
  1532. X    if ($Class eq '') {
  1533. X    @classes=split(/\s+/, `class -l`);
  1534. X    }
  1535. X    else {
  1536. X    @classes=($Class);
  1537. X    }
  1538. X
  1539. X    # Set the search commands
  1540. X    # 
  1541. X    local($searchcmd);
  1542. X    if ($Copy ne '' || $Rmcopy) {
  1543. X    $searchcmd='ls';
  1544. X    }
  1545. X    else {
  1546. X    $searchcmd='l';
  1547. X    }
  1548. X
  1549. X    # Do not requre the file /usr/local/soft/install/mod/class/LUDE
  1550. X    if ($test || $Rmcopy || $Rmlink) { $searchcmd.='t'; }
  1551. X
  1552. X    # Choose the server where to search
  1553. X    local($searchServer)='';
  1554. X    if ($Rmcopy) {
  1555. X    # In the case of Rmcopy, we use $Target or $Lntarget
  1556. X    if ($Target ne '') {
  1557. X        $searchServer=$Target;
  1558. X    }
  1559. X    elsif ($Lntarget ne '') {
  1560. X        $searchServer=$Lntarget;
  1561. X    }
  1562. X    }
  1563. X    else {
  1564. X    $searchServer=$Server;
  1565. X    }
  1566. X
  1567. X    local(@serverfound)=
  1568. X    &FindSoftware($searchcmd, $searchServer, $Software, $Modification, @classes);
  1569. X
  1570. X    # If the list @serverfound is empty, that means an error
  1571. X    if (scalar(@serverfound) == 0) {
  1572. X    &Error($ERR_NOSER, $Software);
  1573. X    }
  1574. X    else {
  1575. X    ($Server, $Software, $Modification, $Class)=split($;, $serverfound[$[]);
  1576. X    if ($Rmcopy) {
  1577. X        if ($Lntarget ne '') {
  1578. X        $Lntarget=$Server;
  1579. X        }
  1580. X        else {
  1581. X        $Target=$Server;
  1582. X        }
  1583. X    }
  1584. X    }
  1585. X
  1586. X    # Get the version of lude that was used to install the found software
  1587. X    local(%kw)=&GetKeyWord($Server, $Software,
  1588. X               "$Modification/$LUDE_FILE", 'LUDE-VERSION');
  1589. X    if ($kw{'LUDE-VERSION'} =~ m|^\s*([0-9]+)\.([0-9]+)\s*$|o) {
  1590. X      $LudeVersionUsedForSoft{'major'} = $1;
  1591. X      $LudeVersionUsedForSoft{'minor'} = $2;
  1592. X    }
  1593. X    else {
  1594. X      &Error($ERR_NO_LUDE_VERSION_USED_FOR_SOFT);
  1595. X    }
  1596. X
  1597. X    # Test to make sure that that a copy on top of itself is not made
  1598. X    if ($Copy ne '' && 
  1599. X    ((($Target eq '' || $Lntarget eq '') && $Server eq '/') ||
  1600. X     ($Target eq $Server || $Lntarget eq $Server))) {
  1601. X      &Error($ERR_CANNOT_CP_SOFT_ON_ITSELF);
  1602. X    }
  1603. X    return $cmdsToDo;
  1604. X}    
  1605. X
  1606. X1;
  1607. X
  1608. X#     ;;; Local Variables: ***
  1609. X#     ;;; mode:perl ***
  1610. X#     ;;; End: ***
  1611. END_OF_FILE
  1612.   if test 13078 -ne `wc -c <'lude-1.1/src/orig/src/ludeinc'`; then
  1613.     echo shar: \"'lude-1.1/src/orig/src/ludeinc'\" unpacked with wrong size!
  1614.   fi
  1615.   # end of 'lude-1.1/src/orig/src/ludeinc'
  1616. fi
  1617. if test -f 'lude-1.1/src/orig/src/ludelist' -a "${1}" != "-c" ; then 
  1618.   echo shar: Will not clobber existing file \"'lude-1.1/src/orig/src/ludelist'\"
  1619. else
  1620.   echo shar: Extracting \"'lude-1.1/src/orig/src/ludelist'\" \(5492 characters\)
  1621.   sed "s/^X//" >'lude-1.1/src/orig/src/ludelist' <<'END_OF_FILE'
  1622. X#!/usr/local/bin/perl
  1623. X
  1624. X# ludelist - Project lude.
  1625. X# Copyright (C) 1992,1993 Stephane Boucher, Ecole Polytechnique de Montreal.
  1626. X#
  1627. X# This program is free software; you can redistribute it and/or modify
  1628. X# it under the terms of the GNU General Public License as published by
  1629. X# the Free Software Foundation; either version 1, or (at your option)
  1630. X# any later version.
  1631. X#
  1632. X# This program is distributed in the hope that it will be useful,
  1633. X# but WITHOUT ANY WARRANTY; without even the implied warranty of
  1634. X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  1635. X# GNU General Public License for more details.
  1636. X#
  1637. X# You should have received a copy of the GNU General Public License
  1638. X# along with this program; if not, write to the Free Software
  1639. X# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  1640. X
  1641. X$FULL_VERSION=
  1642. X    "-- ludelist --\n" .
  1643. X    "This is part of LUDE (Logitheque Universitaire Distribuee et Extensible)\n\n";
  1644. X
  1645. X$FULL_VERSION.= '$Id: ludelist,v 1.3 1993/03/17 14:56:55 sbo Exp $' ."\n";
  1646. X
  1647. X$VERSION='%VERSION%';
  1648. X
  1649. X#-----------------------------------------------------------------------
  1650. X#
  1651. X#    Globals definitions
  1652. X#
  1653. X
  1654. X$PL_INCDIR="%PL_INCDIR%";
  1655. X$LANG_PATH="%LANG_PATH%:../lang";
  1656. X$LUDEMISC="ludemisc";
  1657. X$LUDELISTINC="ludelistinc";
  1658. X
  1659. X#-----------------------------------------------------------------------
  1660. X#    Main program
  1661. X#
  1662. Xmain: {
  1663. X    local($exitval)=0;        # Success by default
  1664. X
  1665. X    unshift(@INC,"$PL_INCDIR");
  1666. X
  1667. X    require('config.pl');
  1668. X
  1669. X    # Load and initialise the language support immediatly so
  1670. X    # that the messages are available the soonest possible.
  1671. X    # If an error occure in this phase, the execution is 
  1672. X    # immediatly aborted.
  1673. X    require('ludelang.pl');
  1674. X    &InitLang($CONF_LANG_DEFAULT, $LANG_PATH, 'ludemisc', @ARGV);
  1675. X    &InitLang($CONF_LANG_DEFAULT, $LANG_PATH, 'ludelist', @ARGV);
  1676. X    &InitLang($CONF_LANG_DEFAULT, $LANG_PATH, 'ludedatafiles', @ARGV);
  1677. X
  1678. X    require($LUDEMISC);
  1679. X    require($LUDELISTINC);
  1680. X    require("BldRegexpMinRqr.pl");
  1681. X
  1682. X    if (! &VerifySystem) {
  1683. X    $exitval=1;
  1684. X    }
  1685. X    elsif (! &Initialisation) {
  1686. X    $exitval=2;
  1687. X    }
  1688. X    elsif (! &ExecCommands) {
  1689. X    $exitval=3;
  1690. X    }
  1691. X
  1692. X    exit $exitval;
  1693. X}
  1694. X
  1695. X
  1696. X#-----------------------------------------------------------------------
  1697. X# Description  : List the softwares according the given specification.
  1698. X# 
  1699. X# Parameters   : $listtype - type of listing requested
  1700. X#                @lstsoft  - list of softwares found.
  1701. X#
  1702. X# Returns      : nothing
  1703. X#
  1704. Xsub List {
  1705. X    local($listtype, @lstsoft)=@_;
  1706. X
  1707. X    if ($listtype == $RAW_LISTING) {
  1708. X    &RawList(@lstsoft);
  1709. X    }
  1710. X    elsif ($listtype == $SHORT_LISTING) {
  1711. X    &ShortList(@lstsoft);
  1712. X    }
  1713. X    elsif ($listtype == $LONG_LISTING) {
  1714. X    &LongList(@lstsoft);
  1715. X    }
  1716. X    else {
  1717. X    &Error($ERR_INTERNAL,
  1718. X           sprintf("\"(%d)\", %s:%d", scalar(@_), __FILE__, __LINE__));
  1719. X    }
  1720. X}
  1721. X
  1722. X#-----------------------------------------------------------------------
  1723. X# Description  : Output a raw listing. A raw listing being:
  1724. X#                   -one line per software
  1725. X#                   -each line made up of 4 fields seperated by blanks
  1726. X#                   -Each fields in order of appearance are:
  1727. X#                         server software modification class
  1728. X# 
  1729. X# Parameters   : @lstsoft  - Softwares to be listed.
  1730. X#
  1731. X# Returns      : nothing
  1732. X#
  1733. Xsub RawList {
  1734. X    local(@lstsofts)=@_;
  1735. X    local($server, $soft, $mod, $cla);
  1736. X
  1737. X    for $s (@lstsofts) {
  1738. X    ($server, $soft, $mod, $cla)=split($;, $s);
  1739. X    print $OUT $server . ' ' . $soft . ' ' . $mod . ' ' . $cla . "\n";
  1740. X    }
  1741. X}
  1742. X
  1743. X#-----------------------------------------------------------------------
  1744. X# Description  : Output a listing containing the server, software name,
  1745. X#                modification name, class, and a one line summary.
  1746. X# 
  1747. X# Parameters   : @lstsoft  - Softwares to be listed.
  1748. X#
  1749. X# Returns      : nothing
  1750. X#
  1751. Xsub ShortList {
  1752. X    local(@lstsofts)=@_;
  1753. X    local($server, $soft, $mod, $cla);
  1754. X    local(%kws);
  1755. X    local($prevsoft)='';
  1756. X
  1757. X    for $s (@lstsofts) {
  1758. X    ($server, $soft, $mod, $cla)=split($;, $s);
  1759. X    if ($soft ne $prevsoft) {
  1760. X        print $OUT "$soft:\n";
  1761. X        %kws=&GetKeyWord($server, $soft, $IAFA_FILE, 'ABSTRACT');
  1762. X        $kws{'ABSTRACT'} =~ m/^([^\n]*)/;
  1763. X        if ($1 !~ /^\s*$/) { 
  1764. X        print "\t$Prkw{'ABSTRACT'} : $1\n\n";
  1765. X        }
  1766. X        $prevsoft=$soft;
  1767. X    }
  1768. X    print "\t$Prkw{'SERVER'} : $server\n" .
  1769. X          "\t$Prkw{'MODIFICATION'} : $mod\n" .
  1770. X              "\t$Prkw{'CLASS'} : $cla\n";
  1771. X    print "\n";
  1772. X    }
  1773. X}
  1774. X
  1775. X#-----------------------------------------------------------------------
  1776. X# Description  : Not yet implemented
  1777. X# 
  1778. X# Parameters   : 
  1779. X#
  1780. X# Returns      : nothing
  1781. X#
  1782. Xsub LongList {
  1783. X    print $OUT "Long Format Not Yet Implemented.\n";
  1784. X}
  1785. X
  1786. X#-----------------------------------------------------------------------
  1787. X# Description  : Sort the list of software according to the following
  1788. X#                keys (in order of precedence):
  1789. X#                  soft, server, mod, class
  1790. X# 
  1791. X# Parameters   : a and b as required by perl for a function
  1792. X#                designed to be used with the builtin function sort.
  1793. X#
  1794. X# Returns      : -1 if $a precedes $b
  1795. X#                 0 if $a is same as $b
  1796. X#                 1 if $a follows $b
  1797. X#
  1798. Xsub SortSoftware {
  1799. X    local($ser1, $soft1, $mod1, $cla1)=split(/$;/, $a);
  1800. X    local($ser2, $soft2, $mod2, $cla2)=split(/$;/, $b);
  1801. X    local($cmp);
  1802. X    $cmp = $soft1 cmp $soft2;
  1803. X    if (! $cmp) {
  1804. X    $cmp = $ser1 cmp $ser2;
  1805. X    if (! $cmp) {
  1806. X        $cmp = $mod1 cmp $mod2;
  1807. X        if (! $cmp) {
  1808. X        $cmp = $cla1 cmp $cla2;
  1809. X        }
  1810. X    }
  1811. X    }
  1812. X    return $cmp;
  1813. X}
  1814. X#     ;;; Local Variables: ***
  1815. X#     ;;; mode:perl ***
  1816. X#     ;;; End: ***
  1817. END_OF_FILE
  1818.   if test 5492 -ne `wc -c <'lude-1.1/src/orig/src/ludelist'`; then
  1819.     echo shar: \"'lude-1.1/src/orig/src/ludelist'\" unpacked with wrong size!
  1820.   fi
  1821.   chmod +x 'lude-1.1/src/orig/src/ludelist'
  1822.   # end of 'lude-1.1/src/orig/src/ludelist'
  1823. fi
  1824. echo shar: End of archive 9 \(of 12\).
  1825. cp /dev/null ark9isdone
  1826. MISSING=""
  1827. for I in 1 2 3 4 5 6 7 8 9 10 11 12 ; do
  1828.     if test ! -f ark${I}isdone ; then
  1829.     MISSING="${MISSING} ${I}"
  1830.     fi
  1831. done
  1832. if test "${MISSING}" = "" ; then
  1833.     echo You have unpacked all 12 archives.
  1834.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1835. else
  1836.     echo You still must unpack the following archives:
  1837.     echo "        " ${MISSING}
  1838. fi
  1839. exit 0
  1840. exit 0 # Just in case...
  1841.