home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume41 / dist-3.0 / patch18 < prev    next >
Encoding:
Text File  |  1994-01-27  |  45.1 KB  |  1,454 lines

  1. Newsgroups: comp.sources.misc
  2. From: Raphael Manfredi <ram@acri.fr>
  3. Subject: v41i114:  dist-3.0 - Configure script generator and related tools, Patch18
  4. Message-ID: <1994Jan28.023402.2401@sparky.sterling.com>
  5. X-Md4-Signature: b81c17a29899ab38ceab069c5c3cca39
  6. Sender: kent@sparky.sterling.com (Kent Landfield)
  7. Organization: Advanced Computer Research Institute, Lyon, France
  8. Date: Fri, 28 Jan 1994 02:34:02 GMT
  9. Approved: kent@sparky.sterling.com
  10.  
  11. Submitted-by: Raphael Manfredi <ram@acri.fr>
  12. Posting-number: Volume 41, Issue 114
  13. Archive-name: dist-3.0/patch18
  14. Environment: UNIX, Perl, RCS
  15. Patch-To: dist-3.0: Volume 39, Issue 5-32
  16.  
  17. [The latest patch for dist version 3.0 is #22.]
  18.  
  19. System: dist version 3.0
  20. Patch #: 18
  21. Priority: LOW
  22. Subject: patch #16, continued
  23. Date: Mon Jan 24 15:54:17 MET 1994
  24. From: Raphael Manfredi <ram@acri.fr>
  25.  
  26. Description:
  27.     See patch #16.
  28.  
  29.  
  30. Fix:    From rn, say "| patch -p -N -d DIR", where DIR is your dist source
  31.     directory.  Outside of rn, say "cd DIR; patch -p -N <thisarticle".
  32.     If you don't have the patch program, apply the following by hand,
  33.     or get patch (version 2.0, latest patchlevel).
  34.  
  35.     After patching:
  36.         *** DO NOTHING--INSTALL ALL PATCHES UP THROUGH #22 FIRST ***
  37.  
  38.     If patch indicates that patchlevel is the wrong version, you may need
  39.     to apply one or more previous patches, or the patch may already
  40.     have been applied.  See the patchlevel.h file to find out what has or
  41.     has not been applied.  In any event, don't continue with the patch.
  42.  
  43.     If you are missing previous patches they can be obtained from me:
  44.  
  45.         Raphael Manfredi <ram@acri.fr>
  46.  
  47.     If you send a mail message of the following form it will greatly speed
  48.     processing:
  49.  
  50.         Subject: Command
  51.         @SH mailpatch PATH dist 3.0 LIST
  52.                ^ note the c
  53.  
  54.     where PATH is a return path FROM ME TO YOU either in Internet notation,
  55.     or in bang notation from some well-known host, and LIST is the number
  56.     of one or more patches you need, separated by spaces, commas, and/or
  57.     hyphens.  Saying 35- says everything from 35 to the end.
  58.  
  59.     To get some more detailed instructions, send me the following mail:
  60.  
  61.         Subject: Command
  62.         @SH mailhelp PATH
  63.  
  64.  
  65. Index: patchlevel.h
  66. Prereq: 17
  67. 4c4
  68. < #define PATCHLEVEL 17
  69. ---
  70. > #define PATCHLEVEL 18
  71.  
  72. Index: pat/patdiff.SH
  73. Prereq: 3.0.1.1
  74. *** pat/patdiff.SH.old    Mon Jan 24 15:35:21 1994
  75. --- pat/patdiff.SH    Mon Jan 24 15:35:21 1994
  76. ***************
  77. *** 20,26 ****
  78.       eval "exec perl -S \$0 \$*"
  79.           if \$running_under_some_shell;
  80.   
  81. ! # $Id: patdiff.SH,v 3.0.1.1 1993/08/19 06:42:35 ram Exp $
  82.   #
  83.   #  Copyright (c) 1991-1993, Raphael Manfredi
  84.   #  
  85. --- 20,26 ----
  86.       eval "exec perl -S \$0 \$*"
  87.           if \$running_under_some_shell;
  88.   
  89. ! # $Id: patdiff.SH,v 3.0.1.2 1994/01/24 14:30:36 ram Exp $
  90.   #
  91.   #  Copyright (c) 1991-1993, Raphael Manfredi
  92.   #  
  93. ***************
  94. *** 33,38 ****
  95. --- 33,42 ----
  96.   # Original Author: Larry Wall <lwall@netlabs.com>
  97.   #
  98.   # $Log: patdiff.SH,v $
  99. + # Revision 3.0.1.2  1994/01/24  14:30:36  ram
  100. + # patch16: now prefix error messages with program's name
  101. + # patch16: added ~/.dist_profile awareness
  102. + #
  103.   # Revision 3.0.1.1  1993/08/19  06:42:35  ram
  104.   # patch1: leading config.sh searching was not aborting properly
  105.   #
  106. ***************
  107. *** 48,65 ****
  108.   $RCSEXT = ',v' unless $RCSEXT;
  109.   $TOPDIR = '';            # We are at top-level directory
  110.   
  111.   require 'getopts.pl';
  112.   &usage unless $#ARGV >= 0;
  113.   &usage unless &Getopts("ahnV");
  114.   
  115.   if ($opt_V) {
  116. !     print STDERR "patdiff $version PL$patchlevel\n";
  117.       exit 0;
  118.   } elsif ($opt_h) {
  119.       &usage;
  120.   }
  121.   
  122. - $RCSEXT = ',v' unless $RCSEXT;
  123.   &readpackage;
  124.   ©right'init($copyright) if -f $copyright;
  125.   
  126. --- 52,69 ----
  127.   $RCSEXT = ',v' unless $RCSEXT;
  128.   $TOPDIR = '';            # We are at top-level directory
  129.   
  130. + $progname = &profile;    # Read ~/.dist_profile
  131.   require 'getopts.pl';
  132.   &usage unless $#ARGV >= 0;
  133.   &usage unless &Getopts("ahnV");
  134.   
  135.   if ($opt_V) {
  136. !     print STDERR "$progname $version PL$patchlevel\n";
  137.       exit 0;
  138.   } elsif ($opt_h) {
  139.       &usage;
  140.   }
  141.   
  142.   &readpackage;
  143.   ©right'init($copyright) if -f $copyright;
  144.   
  145. ***************
  146. *** 66,76 ****
  147.   system 'mkdir', 'bugs' unless -d 'bugs';
  148.   
  149.   if (-f 'patchlevel.h') {
  150. !     open(PL,"patchlevel.h") || die "Can't open patchlevel.h\n";
  151.       while (<PL>) {
  152.           $bnum = $1 if /^#define\s+PATCHLEVEL\s+(\d+)/;
  153.       }
  154. !     die "Malformed patchlevel.h file.\n" if $bnum eq '';
  155.       ++$bnum;
  156.   } else {
  157.       $bnum=1;
  158. --- 70,80 ----
  159.   system 'mkdir', 'bugs' unless -d 'bugs';
  160.   
  161.   if (-f 'patchlevel.h') {
  162. !     open(PL,"patchlevel.h") || die "$progname: can't open patchlevel.h: $!\n";
  163.       while (<PL>) {
  164.           $bnum = $1 if /^#define\s+PATCHLEVEL\s+(\d+)/;
  165.       }
  166. !     die "$progname: malformed patchlevel.h file.\n" if $bnum eq '';
  167.       ++$bnum;
  168.   } else {
  169.       $bnum=1;
  170. ***************
  171. *** 77,83 ****
  172.   }
  173.   
  174.   if ($opt_a) {
  175. !     open(MANI,"MANIFEST.new") || die "No MANIFEST.new found.\n";
  176.       @ARGV = ();
  177.       while (<MANI>) {
  178.           chop;
  179. --- 81,87 ----
  180.   }
  181.   
  182.   if ($opt_a) {
  183. !     open(MANI,"MANIFEST.new") || die "$progname: can't read MANIFEST.new: $!\n";
  184.       @ARGV = ();
  185.       while (<MANI>) {
  186.           chop;
  187. ***************
  188. *** 91,97 ****
  189.   foreach $file (@ARGV) {
  190.       next if ($file =~ /^patchlevel.h$/);        # Skip patchlevel.h
  191.       if (! -f $file) {
  192. !         print "$file not found.\n";
  193.           next;
  194.       }
  195.       $files = &rcsargs($file);
  196. --- 95,101 ----
  197.   foreach $file (@ARGV) {
  198.       next if ($file =~ /^patchlevel.h$/);        # Skip patchlevel.h
  199.       if (! -f $file) {
  200. !         print "$progname: $file not found.\n";
  201.           next;
  202.       }
  203.       $files = &rcsargs($file);
  204. ***************
  205. *** 102,114 ****
  206.       ($lastpat) = ($rlog =~ /lastpat: ([\d.]+)/);
  207.       ($revs) = ($rlog =~ /selected revisions: (\d+)/);
  208.       if (!$revs) {
  209. !         print "No cil has been done on $file.\n" ;;
  210.       } elsif ($revs == 1) {
  211.           ($base) = ($rlog =~ /.*\nrevision\s+(\S+)/);
  212.           ($a,$b,$c,$d) = split(/\./,$base);
  213.           if ($d ne '') {
  214.               if (!$opt_n) {
  215. !         print "No changes in $file since last patch.  (Did you cil it?)\n";
  216.                   next;        # Skip file with no changes
  217.               } else {
  218.                   $new='foo';
  219. --- 106,119 ----
  220.       ($lastpat) = ($rlog =~ /lastpat: ([\d.]+)/);
  221.       ($revs) = ($rlog =~ /selected revisions: (\d+)/);
  222.       if (!$revs) {
  223. !         print "$progname: no cil has been done on $file.\n" ;;
  224.       } elsif ($revs == 1) {
  225.           ($base) = ($rlog =~ /.*\nrevision\s+(\S+)/);
  226.           ($a,$b,$c,$d) = split(/\./,$base);
  227.           if ($d ne '') {
  228.               if (!$opt_n) {
  229. !                 print
  230. !     "$progname: no changes in $file since last patch.  (Did you cil it?)\n";
  231.                   next;        # Skip file with no changes
  232.               } else {
  233.                   $new='foo';
  234. ***************
  235. *** 118,124 ****
  236.               $rlog = `rlog -r$revbranch- $files 2>&1`;
  237.               ($revs) = ($rlog =~ /selected revisions: (\d+)/);
  238.               if (!$revs) {
  239. !         print "No changes in $file since base version.  (Did you cil it?)\n";
  240.                   next;        # Skip file with no changes
  241.               } else {
  242.                   ($new) = ($rlog =~ /\nrevision\s*(\d+\.\d+\.\d+\.\d+)/);
  243. --- 123,130 ----
  244.               $rlog = `rlog -r$revbranch- $files 2>&1`;
  245.               ($revs) = ($rlog =~ /selected revisions: (\d+)/);
  246.               if (!$revs) {
  247. !                 print
  248. !     "$progname: no changes in $file since base version.  (Did you cil it?)\n";
  249.                   next;        # Skip file with no changes
  250.               } else {
  251.                   ($new) = ($rlog =~ /\nrevision\s*(\d+\.\d+\.\d+\.\d+)/);
  252. ***************
  253. *** 143,149 ****
  254.           if (!$opt_n) {
  255.               if ($mydiff eq '') {
  256.                   open(DIFF,"rcsdiff -c -rlastpat -r$new $files |") ||
  257. !                 die "Can't run rcsdiff";
  258.                   while (<DIFF>) {
  259.                       if ($. == 1) {s|\*\*\* \S+    |*** $file.old    |;}
  260.                       if ($. == 2) {s|--- \S+    |--- $file    |;}
  261. --- 149,155 ----
  262.           if (!$opt_n) {
  263.               if ($mydiff eq '') {
  264.                   open(DIFF,"rcsdiff -c -rlastpat -r$new $files |") ||
  265. !                 die "$progname: can't fork rcsdiff: $!\n";
  266.                   while (<DIFF>) {
  267.                       if ($. == 1) {s|\*\*\* \S+    |*** $file.old    |;}
  268.                       if ($. == 2) {s|--- \S+    |--- $file    |;}
  269. ***************
  270. *** 188,194 ****
  271.                   system "co -p -rlastpat $files >/tmp/pdo$$";
  272.                   system "cp $file /tmp/pdn$$";
  273.                   open(DIFF, "$mydiff /tmp/pdo$$ /tmp/pdn$$ |") ||
  274. !                 die "Can't run $mydiff";
  275.                   while (<DIFF>) {
  276.                       # Contextual or unified diff
  277.                       if ($. == 1) {
  278. --- 194,200 ----
  279.                   system "co -p -rlastpat $files >/tmp/pdo$$";
  280.                   system "cp $file /tmp/pdn$$";
  281.                   open(DIFF, "$mydiff /tmp/pdo$$ /tmp/pdn$$ |") ||
  282. !                 die "$progname: can't fork $mydiff: $!\n";
  283.                   while (<DIFF>) {
  284.                       # Contextual or unified diff
  285.                       if ($. == 1) {
  286. ***************
  287. *** 210,220 ****
  288.   }
  289.   
  290.   sub usage {
  291. !     print STDERR "Usage: patdiff [-ahnV] [filelist]\n";
  292. !     print STDERR "  -a : all the files in MANIFEST.new\n";
  293. !     print STDERR "  -h : print this message and exit\n";
  294. !     print STDERR "  -n : non update mode\n";
  295. !     print STDERR "  -V : print version number and exit\n";
  296.       exit 1;
  297.   }
  298.   
  299. --- 216,228 ----
  300.   }
  301.   
  302.   sub usage {
  303. !     print STDERR <<EOM;
  304. ! Usage: $progname [-ahnV] [filelist]
  305. !   -a : all the files in MANIFEST.new
  306. !   -h : print this message and exit
  307. !   -n : non update mode
  308. !   -V : print version number and exit
  309. ! EOM
  310.       exit 1;
  311.   }
  312.   
  313. ***************
  314. *** 222,226 ****
  315. --- 230,236 ----
  316.   $grep -v '^;#' ../pl/package.pl >>patdiff
  317.   $grep -v '^;#' ../pl/rcsargs.pl >>patdiff
  318.   $grep -v '^;#' ../pl/copyright.pl >>patdiff
  319. + $grep -v '^;#' ../pl/tilde.pl >>patdiff
  320. + $grep -v '^;#' ../pl/profile.pl >>patdiff
  321.   chmod +x patdiff
  322.   $eunicefix patdiff
  323.  
  324. Index: mcon/U/prototype.U
  325. Prereq: 3.0.1.1
  326. *** mcon/U/prototype.U.old    Mon Jan 24 15:35:06 1994
  327. --- mcon/U/prototype.U    Mon Jan 24 15:35:06 1994
  328. ***************
  329. *** 1,4 ****
  330. ! ?RCS: $Id: prototype.U,v 3.0.1.1 1993/08/25 14:03:12 ram Exp $
  331.   ?RCS:
  332.   ?RCS: Copyright (c) 1991-1993, Raphael Manfredi
  333.   ?RCS: 
  334. --- 1,4 ----
  335. ! ?RCS: $Id: prototype.U,v 3.0.1.2 1994/01/24 14:15:36 ram Exp $
  336.   ?RCS:
  337.   ?RCS: Copyright (c) 1991-1993, Raphael Manfredi
  338.   ?RCS: 
  339. ***************
  340. *** 9,14 ****
  341. --- 9,17 ----
  342.   ?RCS: of the source tree for dist 3.0.
  343.   ?RCS:
  344.   ?RCS: $Log: prototype.U,v $
  345. + ?RCS: Revision 3.0.1.2  1994/01/24  14:15:36  ram
  346. + ?RCS: patch16: prototype handling macros now appear only when needed
  347. + ?RCS:
  348.   ?RCS: Revision 3.0.1.1  1993/08/25  14:03:12  ram
  349.   ?RCS: patch6: defines were referring to non-existent VOID symbol
  350.   ?RCS:
  351. ***************
  352. *** 25,38 ****
  353.   ?C:    If defined, this macro indicates that the C compiler can handle
  354.   ?C:    function prototypes.
  355.   ?C:.
  356. ! ?C:DOTS ~ %<:
  357.   ?C:    This macro is used to specify the ... in function prototypes which
  358.   ?C:    have arbitrary additional arguments.
  359.   ?C:.
  360. ! ?C:NXT_ARG ~ %<:
  361.   ?C:    This macro is used to separate arguments in the declared argument list.
  362.   ?C:.
  363. ! ?C:P_FUNC ~ %<:
  364.   ?C:    This macro is used to declare "private" (static) functions.
  365.   ?C:    It takes three arguments: the function type and name, a parenthesized
  366.   ?C:    traditional (comma separated) argument list, and the declared argument
  367. --- 28,41 ----
  368.   ?C:    If defined, this macro indicates that the C compiler can handle
  369.   ?C:    function prototypes.
  370.   ?C:.
  371. ! ?C:DOTS:
  372.   ?C:    This macro is used to specify the ... in function prototypes which
  373.   ?C:    have arbitrary additional arguments.
  374.   ?C:.
  375. ! ?C:NXT_ARG:
  376.   ?C:    This macro is used to separate arguments in the declared argument list.
  377.   ?C:.
  378. ! ?C:P_FUNC:
  379.   ?C:    This macro is used to declare "private" (static) functions.
  380.   ?C:    It takes three arguments: the function type and name, a parenthesized
  381.   ?C:    traditional (comma separated) argument list, and the declared argument
  382. ***************
  383. *** 41,47 ****
  384.   ?C:
  385.   ?C:        P_FUNC(int foo, (bar, baz), int bar NXT_ARG char *baz[])
  386.   ?C:.
  387. ! ?C:P_FUNC_VOID ~ %<:
  388.   ?C:    This macro is used to declare "private" (static) functions that have
  389.   ?C:    no arguments.  The macro takes one argument: the function type and name.
  390.   ?C:    For example:
  391. --- 44,50 ----
  392.   ?C:
  393.   ?C:        P_FUNC(int foo, (bar, baz), int bar NXT_ARG char *baz[])
  394.   ?C:.
  395. ! ?C:P_FUNC_VOID:
  396.   ?C:    This macro is used to declare "private" (static) functions that have
  397.   ?C:    no arguments.  The macro takes one argument: the function type and name.
  398.   ?C:    For example:
  399. ***************
  400. *** 48,54 ****
  401.   ?C:
  402.   ?C:        P_FUNC_VOID(int subr)
  403.   ?C:.
  404. ! ?C:V_FUNC ~ %<:
  405.   ?C:    This macro is used to declare "public" (non-static) functions.
  406.   ?C:    It takes three arguments: the function type and name, a parenthesized
  407.   ?C:    traditional (comma separated) argument list, and the declared argument
  408. --- 51,57 ----
  409.   ?C:
  410.   ?C:        P_FUNC_VOID(int subr)
  411.   ?C:.
  412. ! ?C:V_FUNC:
  413.   ?C:    This macro is used to declare "public" (non-static) functions.
  414.   ?C:    It takes three arguments: the function type and name, a parenthesized
  415.   ?C:    traditional (comma separated) argument list, and the declared argument
  416. ***************
  417. *** 57,63 ****
  418.   ?C:
  419.   ?C:        V_FUNC(int main, (argc, argv), int argc NXT_ARG char *argv[])
  420.   ?C:.
  421. ! ?C:V_FUNC_VOID ~ %<:
  422.   ?C:    This macro is used to declare "public" (non-static) functions that have
  423.   ?C:    no arguments.  The macro takes one argument: the function type and name.
  424.   ?C:    For example:
  425. --- 60,66 ----
  426.   ?C:
  427.   ?C:        V_FUNC(int main, (argc, argv), int argc NXT_ARG char *argv[])
  428.   ?C:.
  429. ! ?C:V_FUNC_VOID:
  430.   ?C:    This macro is used to declare "public" (non-static) functions that have
  431.   ?C:    no arguments.  The macro takes one argument: the function type and name.
  432.   ?C:    For example:
  433. ***************
  434. *** 64,70 ****
  435.   ?C:
  436.   ?C:        V_FUNC_VOID(int fork)
  437.   ?C:.
  438. ! ?C:_ ~ %< (P):
  439.   ?C:    This macro is used to declare function parameters for folks who want
  440.   ?C:    to make declarations with prototypes using a different style than
  441.   ?C:    the above macros.  Use double parentheses.  For example:
  442. --- 67,73 ----
  443.   ?C:
  444.   ?C:        V_FUNC_VOID(int fork)
  445.   ?C:.
  446. ! ?C:_ (P):
  447.   ?C:    This macro is used to declare function parameters for folks who want
  448.   ?C:    to make declarations with prototypes using a different style than
  449.   ?C:    the above macros.  Use double parentheses.  For example:
  450. ***************
  451. *** 73,96 ****
  452.   ?C:.
  453.   ?H:?%<:#$prototype    CAN_PROTOTYPE    /**/
  454.   ?H:?%<:#ifdef CAN_PROTOTYPE
  455. ! ?H:?%<:#define    NXT_ARG ,
  456. ! ?H:?%<:#define    DOTS , ...
  457. ! ?H:?%<:#define    V_FUNC(name, arglist, args)name(args)
  458. ! ?H:?%<:#define    P_FUNC(name, arglist, args)static name(args)
  459. ! ?H:?%<:#define    V_FUNC_VOID(name)name(void)
  460. ! ?H:?%<:#define    P_FUNC_VOID(name)static name(void)
  461. ! ?H:?%<:#define    _(args) args
  462.   ?H:?%<:#else
  463. ! ?H:?%<:#define    NXT_ARG ;
  464. ! ?H:?%<:#define    DOTS
  465. ! ?H:?%<:#define    V_FUNC(name, arglist, args)name arglist args;
  466. ! ?H:?%<:#define    P_FUNC(name, arglist, args)static name arglist args;
  467. ! ?H:?%<:#define    V_FUNC_VOID(name)name()
  468. ! ?H:?%<:#define    P_FUNC_VOID(name)static name()
  469. ! ?H:?%<:#define    _(args) ()
  470.   ?H:?%<:#endif
  471.   ?H:.
  472. ! ?W:%<:NXT_ARGS DOTS V_FUNC P_FUNC V_FUNC_VOID P_FUNC_VOID _
  473.   ?LINT:set prototype
  474.   : Cruising for prototypes
  475.   echo " "
  476. --- 76,99 ----
  477.   ?C:.
  478.   ?H:?%<:#$prototype    CAN_PROTOTYPE    /**/
  479.   ?H:?%<:#ifdef CAN_PROTOTYPE
  480. ! ?H:?NXT_ARG:#define    NXT_ARG ,
  481. ! ?H:?DOTS:#define    DOTS , ...
  482. ! ?H:?V_FUNC:#define    V_FUNC(name, arglist, args)name(args)
  483. ! ?H:?P_FUNC:#define    P_FUNC(name, arglist, args)static name(args)
  484. ! ?H:?V_FUNC_VOID:#define    V_FUNC_VOID(name)name(void)
  485. ! ?H:?P_FUNC_VOID:#define    P_FUNC_VOID(name)static name(void)
  486. ! ?H:?_:#define    _(args) args
  487.   ?H:?%<:#else
  488. ! ?H:?NXT_ARG:#define    NXT_ARG ;
  489. ! ?H:?DOTS:#define    DOTS
  490. ! ?H:?V_FUNC:#define    V_FUNC(name, arglist, args)name arglist args;
  491. ! ?H:?P_FUNC:#define    P_FUNC(name, arglist, args)static name arglist args;
  492. ! ?H:?V_FUNC_VOID:#define    V_FUNC_VOID(name)name()
  493. ! ?H:?P_FUNC_VOID:#define    P_FUNC_VOID(name)static name()
  494. ! ?H:?_:#define    _(args) ()
  495.   ?H:?%<:#endif
  496.   ?H:.
  497. ! ?W:%<:NXT_ARG DOTS V_FUNC P_FUNC V_FUNC_VOID P_FUNC_VOID _
  498.   ?LINT:set prototype
  499.   : Cruising for prototypes
  500.   echo " "
  501.  
  502. Index: mcon/man/mconfig.SH
  503. Prereq: 3.0.1.5
  504. *** mcon/man/mconfig.SH.old    Mon Jan 24 15:35:09 1994
  505. --- mcon/man/mconfig.SH    Mon Jan 24 15:35:10 1994
  506. ***************
  507. *** 20,26 ****
  508.   .TH METACONFIG $manext "Version $VERSION PL$PATCHLEVEL"
  509.   ''' @(#) Manual page for metaconfig
  510.   '''
  511. ! ''' $Id: mconfig.SH,v 3.0.1.5 1993/10/16 13:51:50 ram Exp $
  512.   '''
  513.   '''  Copyright (c) 1991-1993, Raphael Manfredi
  514.   '''  
  515. --- 20,26 ----
  516.   .TH METACONFIG $manext "Version $VERSION PL$PATCHLEVEL"
  517.   ''' @(#) Manual page for metaconfig
  518.   '''
  519. ! ''' $Id: mconfig.SH,v 3.0.1.6 1994/01/24 14:19:47 ram Exp $
  520.   '''
  521.   '''  Copyright (c) 1991-1993, Raphael Manfredi
  522.   '''  
  523. ***************
  524. *** 31,36 ****
  525. --- 31,41 ----
  526.   '''  of the source tree for dist 3.0.
  527.   '''
  528.   ''' $Log: mconfig.SH,v $
  529. + ''' Revision 3.0.1.6  1994/01/24  14:19:47  ram
  530. + ''' patch16: symbols defined in a unit can be tagged "internal use only"
  531. + ''' patch16: documents new MailList.U special unit
  532. + ''' patch16: new general <\$variable> macro substitution
  533. + '''
  534.   ''' Revision 3.0.1.5  1993/10/16  13:51:50  ram
  535.   ''' patch12: new option -M to activate ?M: lines
  536.   ''' patch12: documents new ?M: lines format
  537. ***************
  538. *** 998,1004 ****
  539.   stated otherwise, the order of this presentation is the order to be used
  540.   within the unit.
  541.   .TP 5
  542. ! ?RCS: \fIfree_text\fR
  543.   To be used for RCS comments, at the top of the unit.
  544.   .TP
  545.   ?X: \fIany text\fR
  546. --- 1003,1009 ----
  547.   stated otherwise, the order of this presentation is the order to be used
  548.   within the unit.
  549.   .TP 5
  550. ! ?RCS: \fIfree text\fR
  551.   To be used for RCS comments, at the top of the unit.
  552.   .TP
  553.   ?X: \fIany text\fR
  554. ***************
  555. *** 1005,1014 ****
  556.   General purpose comments. May appear anywhere in the unit but must be left
  557.   justfied. For RCS comments, please use the ?RCS: comment form.
  558.   .TP
  559. ! ?MAKE:\fIsymbol list\fR:\fIdependency list\fR [\fI+optional\fR]
  560.   This is the first dependency line. The first \fIsymbol list\fR should list
  561.   all the symbols built by this unit (i.e. whose value is computed by the
  562. ! shell section of the unit). Symbols should be space separated.
  563.   The second part of the list (after the middle ':') is the unit dependency.
  564.   It should list all the needed special units, as well as all the symbols
  565.   used by the shell implementation. If a symbol is nedded but its configuration
  566. --- 1010,1022 ----
  567.   General purpose comments. May appear anywhere in the unit but must be left
  568.   justfied. For RCS comments, please use the ?RCS: comment form.
  569.   .TP
  570. ! ?MAKE:\fIsymbol list\fR: \fIdependency list\fR [\fI+optional\fR]
  571.   This is the first dependency line. The first \fIsymbol list\fR should list
  572.   all the symbols built by this unit (i.e. whose value is computed by the
  573. ! shell section of the unit). Symbols should be space separated. If a defined
  574. ! symbol is for internal use only and should  not appear in the generated
  575. ! \fIconfig.sh\fR file, then it should be preceded by a '+' (not to be confused
  576. ! with optional dependencies defined hereafter).
  577.   The second part of the list (after the middle ':') is the unit dependency.
  578.   It should list all the needed special units, as well as all the symbols
  579.   used by the shell implementation. If a symbol is nedded but its configuration
  580. ***************
  581. *** 1324,1329 ****
  582. --- 1332,1347 ----
  583.   generated a particular \fIConfigure\fR script and for which package it
  584.   was done. The e-mail address of the maintainer is hardwired in the leading
  585.   instructions that \fIConfigure\fR prints when starting.
  586. + .PP
  587. + Recent \fImetaconfig\fR versions understand a much more general syntax
  588. + of the form:
  589. + .Ex
  590. +     <\$variable>
  591. + .Ef
  592. + which is replaced at Configure-generation time by the value of \fIvariable\fR
  593. + taken from your \fI.package\fR file. Eventually, the old hardwired macro
  594. + format will disappear, and <\$baserev> will replace <BASEREV> in all the
  595. + supplied units.
  596.   '''
  597.   .SS Special Units
  598.   .PP
  599. ***************
  600. *** 1459,1464 ****
  601. --- 1477,1490 ----
  602.   the author, optionally being notified when new patches arrive or receiving
  603.   them automatically when issued. You need to install \fImailagent\fR to do
  604.   this (at least version 3.0).
  605. + .TP
  606. + MailList.U
  607. + This unit needs to be included on the ?MAKE: line of your own private End.U
  608. + to make it into \fIConfigure\fR. It offers the user to subscribe or
  609. + unsubscribe to a mailing list where discussion related to the package are
  610. + taking place. You need to run \fIpackinit\fR and answer the mailing list
  611. + related questions to set up the proper variables in your \fI.package\fR
  612. + before this unit may become operational.
  613.   .TP
  614.   Myinit.U
  615.   Copy this unit into your private \fIU\fR directory to add your own default
  616.  
  617. Index: mcon/mconfig.SH
  618. Prereq: 3.0.1.2
  619. *** mcon/mconfig.SH.old    Mon Jan 24 15:35:11 1994
  620. --- mcon/mconfig.SH    Mon Jan 24 15:35:11 1994
  621. ***************
  622. *** 20,26 ****
  623.       eval "exec perl -S \$0 \$*"
  624.           if \$running_under_some_shell;
  625.   
  626. ! # $Id: mconfig.SH,v 3.0.1.2 1993/10/16 13:53:10 ram Exp $
  627.   #
  628.   #  Copyright (c) 1991-1993, Raphael Manfredi
  629.   #  
  630. --- 20,26 ----
  631.       eval "exec perl -S \$0 \$*"
  632.           if \$running_under_some_shell;
  633.   
  634. ! # $Id: mconfig.SH,v 3.0.1.3 1994/01/24 14:20:53 ram Exp $
  635.   #
  636.   #  Copyright (c) 1991-1993, Raphael Manfredi
  637.   #  
  638. ***************
  639. *** 34,39 ****
  640. --- 34,42 ----
  641.   # Key Contributor: Harlan Stenn <harlan@mumps.pfcs.com>
  642.   #
  643.   # $Log: mconfig.SH,v $
  644. + # Revision 3.0.1.3  1994/01/24  14:20:53  ram
  645. + # patch16: added ~/.dist_profile awareness
  646. + #
  647.   # Revision 3.0.1.2  1993/10/16  13:53:10  ram
  648.   # patch12: new -M option for magic symbols and confmagic.h production
  649.   #
  650. ***************
  651. *** 60,65 ****
  652. --- 63,69 ----
  653.   chop($MC = `pwd`);                # Real metaconfig lib path (no symbolic links)
  654.   chdir $WD || die "Can't chdir back to $WD: $!\n";
  655.   
  656. + &profile;                        # Read ~/.dist_profile
  657.   require 'getopts.pl';
  658.   &usage unless &Getopts("dhkmostvwMV");
  659.   
  660. ***************
  661. *** 161,165 ****
  662. --- 165,170 ----
  663.   $grep -v '^;#' ../pl/package.pl >>mconfig 
  664.   $grep -v '^;#' ../pl/manifake.pl >>mconfig 
  665.   $grep -v '^;#' ../pl/tilde.pl >>mconfig 
  666. + $grep -v '^;#' ../pl/profile.pl >>mconfig 
  667.   chmod +x mconfig
  668.   $eunicefix mconfig
  669.  
  670. Index: pat/patmake.SH
  671. Prereq: 3.0.1.2
  672. *** pat/patmake.SH.old    Mon Jan 24 15:35:22 1994
  673. --- pat/patmake.SH    Mon Jan 24 15:35:22 1994
  674. ***************
  675. *** 20,26 ****
  676.       eval "exec perl -S \$0 \$*"
  677.           if \$running_under_some_shell;
  678.   
  679. ! # $Id: patmake.SH,v 3.0.1.2 1993/08/24 12:18:59 ram Exp $
  680.   #
  681.   #  Copyright (c) 1991-1993, Raphael Manfredi
  682.   #  
  683. --- 20,26 ----
  684.       eval "exec perl -S \$0 \$*"
  685.           if \$running_under_some_shell;
  686.   
  687. ! # $Id: patmake.SH,v 3.0.1.3 1994/01/24 14:30:55 ram Exp $
  688.   #
  689.   #  Copyright (c) 1991-1993, Raphael Manfredi
  690.   #  
  691. ***************
  692. *** 34,39 ****
  693. --- 34,43 ----
  694.   # Contribution by: Graham Stoney <greyham@research.canon.oz.au>
  695.   #
  696.   # $Log: patmake.SH,v $
  697. + # Revision 3.0.1.3  1994/01/24  14:30:55  ram
  698. + # patch16: now prefix error messages with program's name
  699. + # patch16: added ~/.dist_profile awareness
  700. + #
  701.   # Revision 3.0.1.2  1993/08/24  12:18:59  ram
  702.   # patch3: now asks for patch mailing/posting after all patches edited
  703.   # patch3: patch release notification is done via new patnotify
  704. ***************
  705. *** 53,63 ****
  706.   !GROK!THIS!
  707.   cat >>patmake <<'!NO!SUBS!'
  708.   
  709.   require 'getopts.pl';
  710.   &usage unless &Getopts("hV");
  711.   
  712.   if ($opt_V) {
  713. !     print STDERR "patmake $version PL$patchlevel\n";
  714.       exit 0;
  715.   } elsif ($opt_h) {
  716.       &usage;
  717. --- 57,68 ----
  718.   !GROK!THIS!
  719.   cat >>patmake <<'!NO!SUBS!'
  720.   
  721. + $progname = &profile;    # Read ~/.dist_profile
  722.   require 'getopts.pl';
  723.   &usage unless &Getopts("hV");
  724.   
  725.   if ($opt_V) {
  726. !     print STDERR "$progname $version PL$patchlevel\n";
  727.       exit 0;
  728.   } elsif ($opt_h) {
  729.       &usage;
  730. ***************
  731. *** 72,78 ****
  732.   $FIRST_PAT = 3000;        # Give space for first patch (descriptions)
  733.   
  734.   if (-f 'patchlevel.h') {
  735. !     open(PL,"patchlevel.h") || die "Can't open patchlevel.h\n";
  736.       while (<PL>) {
  737.           if (/^#define\s+PATCHLEVEL\s+(\d+)/) {
  738.               $last = $1;
  739. --- 77,83 ----
  740.   $FIRST_PAT = 3000;        # Give space for first patch (descriptions)
  741.   
  742.   if (-f 'patchlevel.h') {
  743. !     open(PL,"patchlevel.h") || die "$progname: can't open patchlevel.h: $!\n";
  744.       while (<PL>) {
  745.           if (/^#define\s+PATCHLEVEL\s+(\d+)/) {
  746.               $last = $1;
  747. ***************
  748. *** 79,85 ****
  749.               $patchline = $.;    # Record PATCHLEVEL line
  750.           }
  751.       }
  752. !     die "Malformed patchlevel.h file.\n" if $last eq '';
  753.       $bnum = $last + 1;
  754.   }
  755.   else {
  756. --- 84,90 ----
  757.               $patchline = $.;    # Record PATCHLEVEL line
  758.           }
  759.       }
  760. !     die "$progname: malformed patchlevel.h file.\n" if $last eq '';
  761.       $bnum = $last + 1;
  762.   }
  763.   else {
  764. ***************
  765. *** 107,116 ****
  766.   
  767.   chdir 'bugs' if -d 'bugs';
  768.   
  769. ! die "Patch #$bnum already exists.\n" if -f "patch$bnum";
  770.   
  771.   @patlist=<*.$bnum>;
  772. ! die "No diff files for patch #$bnum.\n" if $patlist[0] =~ /^\*/;
  773.   
  774.   # Look for size of each diff file
  775.   for (@patlist) {
  776. --- 112,121 ----
  777.   
  778.   chdir 'bugs' if -d 'bugs';
  779.   
  780. ! die "$progname: patch #$bnum already exists.\n" if -f "patch$bnum";
  781.   
  782.   @patlist=<*.$bnum>;
  783. ! die "$progname: no diff files for patch #$bnum.\n" if $patlist[0] =~ /^\*/;
  784.   
  785.   # Look for size of each diff file
  786.   for (@patlist) {
  787. ***************
  788. *** 140,146 ****
  789.   $numpat = $#list;        # Number of patches to generate
  790.   
  791.   if ($numpat > 1) {
  792. !     print "Warning: generating $numpat patches.\n";
  793.       sleep(1);
  794.   }
  795.   
  796. --- 145,151 ----
  797.   $numpat = $#list;        # Number of patches to generate
  798.   
  799.   if ($numpat > 1) {
  800. !     print "$progname: Warning: generating $numpat patches.\n";
  801.       sleep(1);
  802.   }
  803.   
  804. ***************
  805. *** 312,319 ****
  806.           system 'chmod', '-w', "patch$bnum";        # Protect newly created patch
  807.           chdir '..';
  808.           `echo "#define PATCHLEVEL 0" >patchlevel.h` unless -f 'patchlevel.h';
  809. !         open(PL,"patchlevel.h") || die "Can't open patchlevel.h\n";
  810. !         open(PLN,">patchlevel.h+") || die "Can't create new patchlevel.h\n";
  811.           while (<PL>) {
  812.               if (/^#define\s+PATCHLEVEL\s+(\d+)/) {
  813.                   $bnum = $1;
  814. --- 317,326 ----
  815.           system 'chmod', '-w', "patch$bnum";        # Protect newly created patch
  816.           chdir '..';
  817.           `echo "#define PATCHLEVEL 0" >patchlevel.h` unless -f 'patchlevel.h';
  818. !         open(PL,"patchlevel.h") ||
  819. !             die "$progname: can't open patchlevel.h: $!\n";
  820. !         open(PLN,">patchlevel.h+") ||
  821. !             die "$progname: can't create new patchlevel.h: $!\n";
  822.           while (<PL>) {
  823.               if (/^#define\s+PATCHLEVEL\s+(\d+)/) {
  824.                   $bnum = $1;
  825. ***************
  826. *** 326,338 ****
  827.           close PLN;
  828.           close PL;
  829.           `mv -f patchlevel.h+ patchlevel.h`;
  830. !         die "Malformed patchlevel.h file.\n" if $bnum eq '';
  831.       } else {
  832.           unlink "patch$bnum";
  833. !         die "Aborted.\n";
  834.       }
  835.   
  836. !     chdir 'bugs' || die "Cannot cd to bugs.\n";
  837.       
  838.       # Find priority for next patch in loop
  839.       $priority='';
  840. --- 333,345 ----
  841.           close PLN;
  842.           close PL;
  843.           `mv -f patchlevel.h+ patchlevel.h`;
  844. !         die "$progname: malformed patchlevel.h file.\n" if $bnum eq '';
  845.       } else {
  846.           unlink "patch$bnum";
  847. !         die "$progname: aborted.\n";
  848.       }
  849.   
  850. !     chdir 'bugs' || die "$progname: cannot cd to bugs: $!\n";
  851.       
  852.       # Find priority for next patch in loop
  853.       $priority='';
  854. ***************
  855. *** 404,412 ****
  856.   }
  857.   
  858.   sub usage {
  859. !     print STDERR "Usage: patmake [-hV]\n";
  860. !     print STDERR "  -h : print this message and exit\n";
  861. !     print STDERR "  -V : print version number and exit\n";
  862.       exit 1;
  863.   }
  864.   
  865. --- 411,421 ----
  866.   }
  867.   
  868.   sub usage {
  869. !     print STDERR <<EOM;
  870. ! Usage: $progname [-hV]
  871. !   -h : print this message and exit
  872. !   -V : print version number and exit
  873. ! EOM
  874.       exit 1;
  875.   }
  876.   
  877. ***************
  878. *** 413,417 ****
  879. --- 422,428 ----
  880.   !NO!SUBS!
  881.   $grep -v '^;#' ../pl/package.pl >>patmake
  882.   $grep -v '^;#' ../pl/users.pl >>patmake
  883. + $grep -v '^;#' ../pl/tilde.pl >>patmake
  884. + $grep -v '^;#' ../pl/profile.pl >>patmake
  885.   chmod +x patmake
  886.   $eunicefix patmake
  887.  
  888. Index: mcon/U/d_uwait.U
  889. Prereq: 3.0
  890. *** mcon/U/d_uwait.U.old    Mon Jan 24 15:34:58 1994
  891. --- mcon/U/d_uwait.U    Mon Jan 24 15:34:58 1994
  892. ***************
  893. *** 1,4 ****
  894. ! ?RCS: $Id: d_uwait.U,v 3.0 1993/08/18 12:07:54 ram Exp $
  895.   ?RCS:
  896.   ?RCS: Copyright (c) 1991-1993, Raphael Manfredi
  897.   ?RCS: 
  898. --- 1,4 ----
  899. ! ?RCS: $Id: d_uwait.U,v 3.0.1.1 1994/01/24 14:10:49 ram Exp $
  900.   ?RCS:
  901.   ?RCS: Copyright (c) 1991-1993, Raphael Manfredi
  902.   ?RCS: 
  903. ***************
  904. *** 9,18 ****
  905.   ?RCS: of the source tree for dist 3.0.
  906.   ?RCS:
  907.   ?RCS: $Log: d_uwait.U,v $
  908.   ?RCS: Revision 3.0  1993/08/18  12:07:54  ram
  909.   ?RCS: Baseline for dist 3.0 netwide release.
  910.   ?RCS:
  911. ! ?MAKE:d_uwait: contains Setvar Findhdr
  912.   ?MAKE:    -pick add $@ %<
  913.   ?S:d_uwait:
  914.   ?S:    This symbol conditionally defines UNION_WAIT which indicates to the C
  915. --- 9,24 ----
  916.   ?RCS: of the source tree for dist 3.0.
  917.   ?RCS:
  918.   ?RCS: $Log: d_uwait.U,v $
  919. + ?RCS: Revision 3.0.1.1  1994/01/24  14:10:49  ram
  920. + ?RCS: patch16: added knowledge about wait3()
  921. + ?RCS: patch16: revised 'union wait' look-up algorithm
  922. + ?RCS: patch16: fixed make dependency line accordingly
  923. + ?RCS:
  924.   ?RCS: Revision 3.0  1993/08/18  12:07:54  ram
  925.   ?RCS: Baseline for dist 3.0 netwide release.
  926.   ?RCS:
  927. ! ?MAKE:d_uwait d_uwait3: cat contains cppstdin cppminus +cppflags rm \
  928. !     Setvar Findhdr
  929.   ?MAKE:    -pick add $@ %<
  930.   ?S:d_uwait:
  931.   ?S:    This symbol conditionally defines UNION_WAIT which indicates to the C
  932. ***************
  933. *** 19,24 ****
  934. --- 25,35 ----
  935.   ?S:    program that argument for the wait() system call should be declared as
  936.   ?S:    'union wait status' instead of 'int status'.
  937.   ?S:.
  938. + ?S:d_uwait3:
  939. + ?S:    This symbol conditionally defines UNION_WAIT3 which indicates to the C
  940. + ?S:    program that the first argument for the wait3() system call should be
  941. + ?S:    declared as 'union wait status' instead of 'int status'.
  942. + ?S:.
  943.   ?C:UNION_WAIT:
  944.   ?C:    This symbol if defined indicates to the C program that the argument
  945.   ?C:    for the wait() system call should be declared as 'union wait status'
  946. ***************
  947. *** 25,42 ****
  948.   ?C:    instead of 'int status'. You probably need to include <sys/wait.h>
  949.   ?C:    in the former case (see I_SYSWAIT).
  950.   ?C:.
  951.   ?H:#$d_uwait UNION_WAIT        /**/
  952.   ?H:.
  953. ! ?LINT:set d_uwait
  954.   : see if union wait is available
  955.   echo " "
  956. ! if $contains 'union.*wait.*{' `./findhdr sys/wait.h` >/dev/null 2>&1 ; then
  957. !     echo "Looks like we have to use 'union wait' pointer for wait()." >&4
  958.       val="$define"
  959.   else
  960. !     echo "Your wait() should be happy with a plain 'int' pointer." >&4
  961.       val="$undef"
  962.   fi
  963.   set d_uwait
  964.   eval $setvar
  965.   
  966. --- 36,123 ----
  967.   ?C:    instead of 'int status'. You probably need to include <sys/wait.h>
  968.   ?C:    in the former case (see I_SYSWAIT).
  969.   ?C:.
  970. + ?C:UNION_WAIT3:
  971. + ?C:    This symbol if defined indicates to the C program that the first argument
  972. + ?C:    for the wait3() system call should be declared as 'union wait status'
  973. + ?C:    instead of 'int status'. You probably need to include <sys/wait.h>
  974. + ?C:    in the former case (see I_SYSWAIT). It seems safe to assume that the
  975. + ?C:    same rule applies to the second parameter of wait4().
  976. + ?C:.
  977.   ?H:#$d_uwait UNION_WAIT        /**/
  978. + ?H:#$d_uwait3 UNION_WAIT3    /**/
  979.   ?H:.
  980. ! ?T:val2 flags f also
  981. ! ?LINT:set d_uwait d_uwait3
  982.   : see if union wait is available
  983.   echo " "
  984. ! ?X:
  985. ! ?X: Unfortunately, we can't just grep <sys/wait.h> for "union wait" because
  986. ! ?X: some weird systems (did I hear HP-UX?) define union wait only when _BSD
  987. ! ?X: is defined. The same thing happens on OSF/1, who is pushing weirdness to
  988. ! ?X: its limits by requiring wait() to use (int *) but wait3() to use
  989. ! ?X: (union wait *), unless _BSD is defined and -lbsd is used, in which case
  990. ! ?X: wait() also expects (union wait *). Aaargh!!--RAM
  991. ! ?X:
  992. ! set X $cppflags
  993. ! shift
  994. ! flags=''
  995. ! also=''
  996. ! for f in $*; do
  997. !     case "$f" in
  998. !     *NO_PROTO*) ;;
  999. !     *) flags="$flags $f";;
  1000. !     esac
  1001. ! done
  1002. ! $cat `./findhdr sys/wait.h` /dev/null | \
  1003. !     $cppstdin $flags $cppminus >wait.out 2>/dev/null
  1004. ! if $contains 'union.*wait.*{' wait.out >/dev/null 2>&1 ; then
  1005. !     echo "Looks like your <sys/wait.h> knows about 'union wait'..." >&4
  1006.       val="$define"
  1007. + @if UNION_WAIT
  1008. +     also='also '
  1009. +     if $contains 'extern.*wait[     ]*([     ]*int' wait.out >/dev/null 2>&1
  1010. +     then
  1011. +         echo "But wait() seems to expect an 'int' pointer (POSIX way)." >&4
  1012. +         val="$undef"
  1013. +         also=''
  1014. +     elif $contains 'extern.*wait[     ]*([     ]*union' wait.out >/dev/null 2>&1
  1015. +     then
  1016. +         echo "And indeed wait() expects an 'union wait' pointer (BSD way)." >&4
  1017. +     else
  1018. +         echo "So we'll use that for wait()." >&4
  1019. +     fi
  1020. + @end
  1021. + @if UNION_WAIT3 || d_uwait3
  1022. +     val2="$define"
  1023. + @end
  1024. + @if UNION_WAIT3
  1025. +     if $contains 'extern.*wait3[     ]*([     ]*int' wait.out >/dev/null 2>&1
  1026. +     then
  1027. +         echo "However wait3() seems to expect an 'int' pointer, weird." >&4
  1028. +         val2="$undef"
  1029. +     elif $contains 'extern.*wait3[     ]*([     ]*union' wait.out >/dev/null 2>&1
  1030. +     then
  1031. +         echo "And wait3() ${also}expects an 'union wait' pointer, fine." >&4
  1032. +     else
  1033. +         echo "As expected, wait3() ${also}uses an 'union wait' pointer." >&4
  1034. +     fi
  1035. + @end
  1036.   else
  1037. !     echo "No trace of 'union wait' in <sys/wait.h>..." >&4
  1038.       val="$undef"
  1039. + @if UNION_WAIT && UNION_WAIT3
  1040. +     echo "Both wait() and wait3() will use a plain 'int' pointer then." >&4
  1041. + @elsif UNION_WAIT
  1042. +     echo "Your wait() should be happy with a plain 'int' pointer." >&4
  1043. + @elsif UNION_WAIT3
  1044. +     echo "Your wait3() should be happy with a plain 'int' pointer." >&4
  1045. + @end
  1046.   fi
  1047.   set d_uwait
  1048.   eval $setvar
  1049. + @if UNION_WAIT3 || d_uwait3
  1050. + val="$val2"; set d_uwait3
  1051. + eval $setvar
  1052. + @end
  1053. + $rm -f wait.out
  1054.   
  1055.  
  1056. Index: MANIFEST
  1057. *** MANIFEST.old    Mon Jan 24 15:35:28 1994
  1058. --- MANIFEST    Mon Jan 24 15:35:28 1994
  1059. ***************
  1060. *** 45,50 ****
  1061. --- 45,61 ----
  1062.   kit/manifake.SH            Makes a MANIFEST.new file out of a MANIFEST
  1063.   kit/manifake.man           Manual page for same
  1064.   lib/                       Some library support files
  1065. + lib/C/                     Some useful C routines
  1066. + lib/C/Jmakefile            Generic makefile for C lib routines
  1067. + lib/C/Makefile.SH          Produces Makefile for C lib routines
  1068. + lib/C/fake/                Fake implementations of real routines
  1069. + lib/C/fake/Jmakefile       Generic makefile for faked C routines
  1070. + lib/C/fake/Makefile.SH     Jmake-generated configured makefile
  1071. + lib/C/fake/dup2.C          A dup2() replacement
  1072. + lib/C/fake/getopt.C        A getopt() replacement
  1073. + lib/C/fake/rename.C        A rename() replacement for files
  1074. + lib/C/fake/scandir.C       A scandir() replacement
  1075. + lib/C/fake/setsid.C        A setsid() pale imitation
  1076.   lib/Jmakefile              Generic makefile description for lib
  1077.   lib/Makefile.SH            Jmake-generated configured makefile
  1078.   lib/errnolist.a            Awk script to build sys_errnolist[]
  1079. ***************
  1080. *** 82,87 ****
  1081. --- 93,99 ----
  1082.   mcon/U/Loc.U               Look for common programs
  1083.   mcon/U/Magic_h.U           Makes confmagic.h--bizarrity here
  1084.   mcon/U/MailAuthor.U        Offers user to register himself
  1085. + mcon/U/MailList.U          Offers user to subscribe to users list
  1086.   mcon/U/Myinit.U            For copying to private U directories
  1087.   mcon/U/Myread.U            Makes program to do read with shell escape
  1088.   mcon/U/Nothing.U           For empty dependencies
  1089. ***************
  1090. *** 107,112 ****
  1091. --- 119,126 ----
  1092.   mcon/U/byteorder.U         Computes the byte order (big-endian?)
  1093.   mcon/U/cc.U                Which C compiler should be used?
  1094.   mcon/U/ccflags.U           Any additional C flags?
  1095. + mcon/U/cf_email.U          Computes user's e-mail address
  1096. + mcon/U/cf_name.U           Computes user's full name
  1097.   mcon/U/cf_who.U            Who configured the sytem, where and when
  1098.   mcon/U/charorder.U         Character order within a byte
  1099.   mcon/U/charsize.U          What is the size of "char"?
  1100. ***************
  1101. *** 202,207 ****
  1102. --- 216,223 ----
  1103.   mcon/U/d_rusage.U          Do we have getrusage()?
  1104.   mcon/U/d_safebcpy.U        Can bcopy() handle overlapping blocks?
  1105.   mcon/U/d_safemcpy.U        Can memcpy() handle overlapping blocks?
  1106. + mcon/U/d_sbrk.U            Do we have sbrk()?
  1107. + mcon/U/d_scandir.U         Do we have scandir()?
  1108.   mcon/U/d_scannl.U          Does scanf() groks '\n' correctly?
  1109.   mcon/U/d_scorfl.U          Keep scoreboards by full name?
  1110.   mcon/U/d_select.U          Do we have select()?
  1111. ***************
  1112. *** 211,216 ****
  1113. --- 227,233 ----
  1114.   mcon/U/d_semop.U           Do we have semop()?
  1115.   mcon/U/d_setegid.U         Do we have setegid()?
  1116.   mcon/U/d_seteuid.U         Do we have seteuid()?
  1117. + mcon/U/d_setpgid.U         Do we have setpgid()?
  1118.   mcon/U/d_setpgrp.U         Do we have setpgrp()?
  1119.   mcon/U/d_setpgrp2.U        Do we have setpgrp2()? (DG/UX)
  1120.   mcon/U/d_setprior.U        Do we have setpriority()?
  1121. ***************
  1122. *** 218,223 ****
  1123. --- 235,241 ----
  1124.   mcon/U/d_setreuid.U        Do we have setreuid()?
  1125.   mcon/U/d_setrgid.U         Do we have setrgid()?
  1126.   mcon/U/d_setruid.U         Do we have setruid()?
  1127. + mcon/U/d_setsid.U          Do we have setsid()?
  1128.   mcon/U/d_sgndchr.U         Are chars signed?
  1129.   mcon/U/d_shm.U             Do we have full shm(2) support?
  1130.   mcon/U/d_shmat.U           Do we have shmat()?
  1131. ***************
  1132. *** 271,276 ****
  1133. --- 289,295 ----
  1134.   mcon/U/d_xdrs.U            Do we have XDR serialization routines?
  1135.   mcon/U/defeditor.U         Find default editor
  1136.   mcon/U/doublesize.U        What is the size of "double"?
  1137. + mcon/U/errnolist.U         See if we need our own .c to get sys_errnolist[]
  1138.   mcon/U/etc.U               Where administrative executable should go
  1139.   mcon/U/filexp.U            Finds location of filexp made by Filexp.U
  1140.   mcon/U/floatsize.U         What is the size of "float"?
  1141. ***************
  1142. *** 297,302 ****
  1143. --- 316,322 ----
  1144.   mcon/U/i_sysdir.U          Shall we include <sys/dir.h>?
  1145.   mcon/U/i_sysfile.U         Do we need <sys/file.h>?
  1146.   mcon/U/i_sysioctl.U        Include <sys/ioctl.h> or <sgtty.h>?
  1147. + mcon/U/i_sysmman.U         Do we have to include <sys/mman.h>?
  1148.   mcon/U/i_sysndir.U         Shall we include <sys/ndir.h>?
  1149.   mcon/U/i_sysresrc.U        Shall we include <sys/resource.h>?
  1150.   mcon/U/i_sysselct.U        Shall we include <sys/select.h>?
  1151. ***************
  1152. *** 367,372 ****
  1153. --- 387,393 ----
  1154.   mcon/U/rcs_branch.U        Does RCS know about the -b switch?
  1155.   mcon/U/registers.U         How many register declarations to use
  1156.   mcon/U/rootid.U            Root user id
  1157. + mcon/U/sbrksmart.U         Can sbrk() be used to release core?
  1158.   mcon/U/sbrktype.U          What is the return type of sbrk()?
  1159.   mcon/U/scriptdir.U         Where to put public scripts
  1160.   mcon/U/shm_for.U           More shared memory stuff
  1161. ***************
  1162. *** 460,465 ****
  1163. --- 481,487 ----
  1164.   pl/newer.pl                Perl library to Find files newer than patchlevel.h
  1165.   pl/package.pl              Perl library to read .package
  1166.   pl/patseq.pl               Perl library to compute issued patch sequence
  1167. + pl/profile.pl              Perl library to get ~/.dist_profile
  1168.   pl/rangeargs.pl            Perl library to expand number lists
  1169.   pl/rcsargs.pl              Perl library to expand rcs filename lists
  1170.   pl/snapshot.pl             Perl library to parse RCS snapshot file
  1171.  
  1172. Index: pat/patsend.SH
  1173. Prereq: 3.0.1.4
  1174. *** pat/patsend.SH.old    Mon Jan 24 15:35:25 1994
  1175. --- pat/patsend.SH    Mon Jan 24 15:35:25 1994
  1176. ***************
  1177. *** 20,26 ****
  1178.       eval "exec perl -S \$0 \$*"
  1179.           if \$running_under_some_shell;
  1180.   
  1181. ! # $Id: patsend.SH,v 3.0.1.4 1993/08/25 14:08:01 ram Exp $
  1182.   #
  1183.   #  Copyright (c) 1991-1993, Raphael Manfredi
  1184.   #  
  1185. --- 20,26 ----
  1186.       eval "exec perl -S \$0 \$*"
  1187.           if \$running_under_some_shell;
  1188.   
  1189. ! # $Id: patsend.SH,v 3.0.1.5 1994/01/24 14:32:46 ram Exp $
  1190.   #
  1191.   #  Copyright (c) 1991-1993, Raphael Manfredi
  1192.   #  
  1193. ***************
  1194. *** 33,38 ****
  1195. --- 33,43 ----
  1196.   # Original Author: Larry Wall <lwall@netlabs.com>
  1197.   #
  1198.   # $Log: patsend.SH,v $
  1199. + # Revision 3.0.1.5  1994/01/24  14:32:46  ram
  1200. + # patch16: now prefix error messages with program's name
  1201. + # patch16: don't feed mailer with more than 50 addresses at a time
  1202. + # patch16: added ~/.dist_profile awareness
  1203. + #
  1204.   # Revision 3.0.1.4  1993/08/25  14:08:01  ram
  1205.   # patch6: now asks for recipient list edition by default
  1206.   # patch6: new -q option to suppress that
  1207. ***************
  1208. *** 59,69 ****
  1209.   !GROK!THIS!
  1210.   cat >>patsend <<'!NO!SUBS!'
  1211.   
  1212.   require 'getopts.pl';
  1213.   &usage unless &Getopts("hquV");
  1214.   
  1215.   if ($opt_V) {
  1216. !     print STDERR "patsend $version PL$patchlevel\n";
  1217.       exit 0;
  1218.   } elsif ($opt_h) {
  1219.       &usage;
  1220. --- 64,75 ----
  1221.   !GROK!THIS!
  1222.   cat >>patsend <<'!NO!SUBS!'
  1223.   
  1224. + $progname = &profile;            # Read ~/.dist_profile
  1225.   require 'getopts.pl';
  1226.   &usage unless &Getopts("hquV");
  1227.   
  1228.   if ($opt_V) {
  1229. !     print STDERR "$progname $version PL$patchlevel\n";
  1230.       exit 0;
  1231.   } elsif ($opt_h) {
  1232.       &usage;
  1233. ***************
  1234. *** 104,115 ****
  1235.   $to = join(', ', split(' ', $dest));
  1236.   @ARGV = @argv;
  1237.   
  1238. ! open(PL,"patchlevel.h") || die "Can't open patchlevel.h\n";
  1239.   while (<PL>) {
  1240.       $maxnum = $1 if /^#define\s+PATCHLEVEL\s+(\d+)/;
  1241.   }
  1242.   close PL;
  1243. ! die "Malformed patchlevel.h file.\n" if $maxnum eq '';
  1244.   
  1245.   if ($#ARGV < 0) {
  1246.       @patseq = &patseq($maxnum);
  1247. --- 110,121 ----
  1248.   $to = join(', ', split(' ', $dest));
  1249.   @ARGV = @argv;
  1250.   
  1251. ! open(PL,"patchlevel.h") || die "$progname: can't open patchlevel.h: $!\n";
  1252.   while (<PL>) {
  1253.       $maxnum = $1 if /^#define\s+PATCHLEVEL\s+(\d+)/;
  1254.   }
  1255.   close PL;
  1256. ! die "$progname: malformed patchlevel.h file.\n" if $maxnum eq '';
  1257.   
  1258.   if ($#ARGV < 0) {
  1259.       @patseq = &patseq($maxnum);
  1260. ***************
  1261. *** 123,137 ****
  1262.   $argv =~ s/ $//;
  1263.   
  1264.   if ($#ARGV < 0) {
  1265. !     print STDERR "No patches specified.\n";
  1266.       &usage;
  1267.   } elsif ($#ARGV) {
  1268. !     print "Sending $package $baserev patches $argv to $dest...\n";
  1269.   } else {
  1270. !     print "Sending $package $baserev patch $argv to $dest...\n";
  1271.   }
  1272.   
  1273. ! chdir 'bugs' || die "patsend: can't cd to bugs: $!\n";
  1274.   
  1275.   fork && exit;
  1276.   
  1277. --- 129,143 ----
  1278.   $argv =~ s/ $//;
  1279.   
  1280.   if ($#ARGV < 0) {
  1281. !     print STDERR "$progname: no patches specified.\n";
  1282.       &usage;
  1283.   } elsif ($#ARGV) {
  1284. !     print "$progname: sending $package $baserev patches $argv to $dest...\n";
  1285.   } else {
  1286. !     print "$progname: sending $package $baserev patch $argv to $dest...\n";
  1287.   }
  1288.   
  1289. ! chdir 'bugs' || die "$progname: can't cd to bugs: $!\n";
  1290.   
  1291.   fork && exit;
  1292.   
  1293. ***************
  1294. *** 139,146 ****
  1295.   
  1296.   until ($#ARGV < 0) {
  1297.       $patnum = shift;
  1298. !     open(XHEAD,">.xhead$$") || die "patsend: can't create temp file: $!\n";
  1299. !     print XHEAD
  1300.   "To: $to
  1301.   Subject: $package $baserev patch #$patnum
  1302.   Precedence: bulk
  1303. --- 145,160 ----
  1304.   
  1305.   until ($#ARGV < 0) {
  1306.       $patnum = shift;
  1307. !     # I hate broken mailers! Bust it up into smaller groups of people...
  1308. !     @dest = split(' ', $dest);
  1309. !     while (@smalldest = splice(@dest, 0, 50)) {
  1310. !         $to = join(', ', @smalldest);    # Sensible To: for sendmail
  1311. !         $smalldest = join(' ', @smalldest);
  1312. !         open(MAILER, "|$mailer $opt $smalldest") ||
  1313. !             die "$progname: can't fork $mailer: $!\n";
  1314. !         print MAILER
  1315.   "To: $to
  1316.   Subject: $package $baserev patch #$patnum
  1317.   Precedence: bulk
  1318. ***************
  1319. *** 151,168 ****
  1320.   [The latest patch for $package version $baserev is #$maxnum.]
  1321.   
  1322.   ";
  1323. !     open(PATCH,"patch$patnum") || die "patsend: can't open patch$patnum: $!\n";
  1324. !     while (<PATCH>) {
  1325. !         print XHEAD;
  1326.       }
  1327. -     close XHEAD;
  1328. -     system "$mailer $opt $dest <.xhead$$";
  1329.   }
  1330. - unlink ".xhead$$";
  1331.   
  1332.   sub usage {
  1333.       print STDERR <<EOM;
  1334. ! Usage: patsend [-hquV] [patchlist] [recipients]
  1335.     -h : print this message and exit
  1336.     -q : quick mode, do not offer to edit recipient list
  1337.     -u : add all to-be-mailed users
  1338. --- 165,184 ----
  1339.   [The latest patch for $package version $baserev is #$maxnum.]
  1340.   
  1341.   ";
  1342. !         open(PATCH,"patch$patnum") ||
  1343. !             die "$progname: can't open patch$patnum: $!\n";
  1344. !         while (<PATCH>) {
  1345. !             print MAILER;
  1346. !         }
  1347. !         close PATCH;
  1348. !         close MAILER;
  1349. !         die "$progname: could not mail patch$patnum.\n" if $?;
  1350.       }
  1351.   }
  1352.   
  1353.   sub usage {
  1354.       print STDERR <<EOM;
  1355. ! Usage: $progname [-hquV] [patchlist] [recipients]
  1356.     -h : print this message and exit
  1357.     -q : quick mode, do not offer to edit recipient list
  1358.     -u : add all to-be-mailed users
  1359. ***************
  1360. *** 179,183 ****
  1361. --- 195,200 ----
  1362.   $grep -v '^;#' ../pl/tilde.pl >>patsend
  1363.   $grep -v '^;#' ../pl/editor.pl >>patsend
  1364.   $grep -v '^;#' ../pl/listedit.pl >>patsend
  1365. + $grep -v '^;#' ../pl/profile.pl >>patsend
  1366.   chmod +x patsend
  1367.   $eunicefix patsend
  1368.  
  1369. Index: pl/profile.pl
  1370. *** pl/profile.pl.old    Mon Jan 24 15:35:27 1994
  1371. --- pl/profile.pl    Mon Jan 24 15:35:27 1994
  1372. ***************
  1373. *** 0 ****
  1374. --- 1,73 ----
  1375. + ;# $Id: profile.pl,v 3.0.1.1 1994/01/24 14:33:53 ram Exp $
  1376. + ;#
  1377. + ;#  Copyright (c) 1991-1993, Raphael Manfredi
  1378. + ;#  
  1379. + ;#  You may redistribute only under the terms of the Artistic Licence,
  1380. + ;#  as specified in the README file that comes with the distribution.
  1381. + ;#  You may reuse parts of this distribution only within the terms of
  1382. + ;#  that same Artistic Licence; a copy of which may be found at the root
  1383. + ;#  of the source tree for dist 3.0.
  1384. + ;#
  1385. + ;# $Log: profile.pl,v $
  1386. + ;# Revision 3.0.1.1  1994/01/24  14:33:53  ram
  1387. + ;# patch16: created
  1388. + ;#
  1389. + ;#
  1390. + ;# Dist profile management (works like MH and its ~/.mh_profile):
  1391. + ;# - Profile name is held in the environment variable DIST. If not defined,
  1392. + ;#   use ~/.dist_profile by default.
  1393. + ;# - Each line in the profile not starting with a '#' (comment line) should
  1394. + ;#   have the following format:
  1395. + ;#     progname: additional command line options
  1396. + ;# The profile is parsed once when the command is launched and profile
  1397. + ;# options are added at the beginning of the @ARGV array.
  1398. + ;#
  1399. + ;# Per-program configuration values may be also be added. For instance,
  1400. + ;# program foo may pay attention to a profile component 'bar', which may be
  1401. + ;# set via:
  1402. + ;#     foo-bar: value
  1403. + ;# i.e. the program name is followed by a '-', followed by the profile
  1404. + ;# component.
  1405. + ;#
  1406. + ;# Uses &tilda_expand to perform ~name substitution.
  1407. + ;# Requires shellwords.pl to properly quote shell words (perl library).
  1408. + ;#
  1409. + # Set up profile components into %Profile, add any profile-supplied options
  1410. + # into @ARGV and return the command invocation name.
  1411. + sub profile {
  1412. +     local($profile) = &tilda_expand($ENV{'DIST'} || '~/.dist_profile');
  1413. +     local($me) = $0;        # Command name
  1414. +     $me =~ s|.*/(.*)|$1|;    # Keep only base name
  1415. +     return $me unless -s $profile;
  1416. +     local(*PROFILE);        # Local file descriptor
  1417. +     local($options) = '';    # Options we get back from profile
  1418. +     unless (open(PROFILE, $profile)) {
  1419. +         warn "$me: cannot open $profile: $!\n";
  1420. +         return;
  1421. +     }
  1422. +     local($_);
  1423. +     local($component);
  1424. +     while (<PROFILE>) {
  1425. +         next if /^\s*#/;    # Skip comments
  1426. +         next unless /^$me/o;
  1427. +         if (s/^$me://o) {    # progname: options
  1428. +             chop;
  1429. +             $options .= $_;    # Merge options if more than one line
  1430. +         }
  1431. +         elsif (s/^$me-([^:]+)://o) {    # progname-component: value
  1432. +             $component = $1;
  1433. +             chop;
  1434. +             s/^\s+//;        # Trim leading and trailing spaces
  1435. +             s/\s+$//;
  1436. +             $Profile{$component} = $_;
  1437. +         }
  1438. +     }
  1439. +     close PROFILE;
  1440. +     return unless $options;
  1441. +     require 'shellwords.pl';
  1442. +     local(@opts);
  1443. +     eval '@opts = &shellwords($options)';    # Protect against mismatched quotes
  1444. +     unshift(@ARGV, @opts);
  1445. +     return $me;                # Return our invocation name
  1446. + }
  1447.  
  1448. *** End of Patch 18 ***
  1449.  
  1450. exit 0 # Just in case...
  1451.