home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / unix / volume26 / kit / pch21 < prev    next >
Encoding:
Text File  |  1993-05-04  |  8.4 KB  |  376 lines

  1. Newsgroups: comp.sources.unix
  2. From: ram@acri.fr (Raphael Manfredi)
  3. Subject: v26i225: kit - the ultimate mailing kit, Patch21
  4. Sender: unix-sources-moderator@efficacy.home.vix.com
  5. Approved: WhoAmI@efficacy.home.vix.com
  6.  
  7. Submitted-By: ram@acri.fr (Raphael Manfredi)
  8. Posting-Number: Volume 26, Issue 225
  9. Archive-Name: kit/pch21
  10.  
  11. [The latest patch for kit version 2.0 is #28.]
  12.  
  13. System: kit version 2.0
  14. Patch #: 21
  15. Priority: HIGH
  16. Subject: option parsing can now deal with embeded spaces in arguments
  17. Date: Tue Nov  3 10:13:00 PST 1992
  18. From: Raphael Manfredi <ram@eiffel.com>
  19.  
  20. Description:
  21.     Option parsing can now deal with embeded spaces in arguments.
  22.  
  23. Repeat-By:
  24.     kit -s 'some subject with spaces' dir
  25.  
  26. Fix:    From rn, say "| patch -p -N -d DIR", where DIR is your kit source
  27.     directory.  Outside of rn, say "cd DIR; patch -p -N <thisarticle".
  28.     If you don't have the patch program, apply the following by hand,
  29.     or get patch (version 2.0, latest patchlevel).
  30.  
  31.     After patching:
  32.         Configure -d
  33.         make
  34.  
  35.     If patch indicates that patchlevel is the wrong version, you may need
  36.     to apply one or more previous patches, or the patch may already
  37.     have been applied.  See the patchlevel.h file to find out what has or
  38.     has not been applied.  In any event, don't continue with the patch.
  39.  
  40.     If you are missing previous patches they can be obtained from me:
  41.  
  42.         Raphael Manfredi <ram@eiffel.com>
  43.  
  44.     If you send a mail message of the following form it will greatly speed
  45.     processing:
  46.  
  47.         Subject: Command
  48.         @SH mailpatch PATH kit 2.0 LIST
  49.                ^ note the c
  50.  
  51.     where PATH is a return path FROM ME TO YOU either in Internet notation,
  52.     or in bang notation from some well-known host, and LIST is the number
  53.     of one or more patches you need, separated by spaces, commas, and/or
  54.     hyphens.  Saying 35- says everything from 35 to the end.
  55.  
  56.     To get some more detailed instructions, send me the following mail:
  57.  
  58.         Subject: Command
  59.         @SH mailhelp PATH
  60.  
  61.  
  62. Index: patchlevel.h
  63. Prereq: 20
  64. 2c2
  65. < #define PATCHLEVEL 20
  66. ---
  67. > #define PATCHLEVEL 21
  68.  
  69. Index: kit/mailkit.SH
  70. Prereq: 2.0.1.10
  71. *** kit/mailkit.SH.old    Tue Nov  3 10:12:53 1992
  72. --- kit/mailkit.SH    Tue Nov  3 10:12:54 1992
  73. ***************
  74. *** 18,26 ****
  75.   # @(#) Mailer for kit files
  76.   # @(#) (c) R. Manfredi, 1990 1991
  77.   
  78. ! # $Id: mailkit.SH,v 2.0.1.10 92/11/01 15:08:10 ram Exp $
  79.   #
  80.   # $Log:    mailkit.SH,v $
  81.   # Revision 2.0.1.10  92/11/01  15:08:10  ram
  82.   # patch20: added getopt-style option parsing
  83.   # 
  84. --- 18,29 ----
  85.   # @(#) Mailer for kit files
  86.   # @(#) (c) R. Manfredi, 1990 1991
  87.   
  88. ! # $Id: mailkit.SH,v 2.0.1.11 92/11/03 10:12:40 ram Exp $
  89.   #
  90.   # $Log:    mailkit.SH,v $
  91. + # Revision 2.0.1.11  92/11/03  10:12:40  ram
  92. + # patch21: option parsing can now deal with embeded spaces in arguments
  93. + # 
  94.   # Revision 2.0.1.10  92/11/01  15:08:10  ram
  95.   # patch20: added getopt-style option parsing
  96.   # 
  97. ***************
  98. *** 124,130 ****
  99.   '
  100.   
  101.   # Process the command line options
  102. ! set X `for arg in $*; do echo $arg; done | awk '
  103.   BEGIN {
  104.       optstr = "EFVcefhpn:l:r:";    # getopt-style specification
  105.   
  106. --- 127,133 ----
  107.   '
  108.   
  109.   # Process the command line options
  110. ! set X `for arg in "$@"; do echo $arg; done | awk '
  111.   BEGIN {
  112.       optstr = "EFVcefhpn:l:r:";    # getopt-style specification
  113.   
  114. ***************
  115. *** 143,149 ****
  116.       expect = 0;
  117.       str = $0;
  118.       if (substr(str, 1, 1) != "-") {
  119. !         print str;
  120.           next;
  121.       }
  122.       len = length($0);
  123. --- 146,152 ----
  124.       expect = 0;
  125.       str = $0;
  126.       if (substr(str, 1, 1) != "-") {
  127. !         printf("'"'%s'"'\n", str);
  128.           next;
  129.       }
  130.       len = length($0);
  131. ***************
  132. *** 150,162 ****
  133.       for (i = 2; i <= len; i++) {
  134.           c = substr(str, i, 1);
  135.           if (!opt[c]) {
  136. !             print sprintf("-%s", substr(str, i));
  137.               next;
  138.           }
  139. !         print sprintf("-%s", c);
  140.           if (arg[c]) {
  141.               if (i < len)
  142. !                 print substr(str, i + 1);
  143.               else
  144.                   expect = 1;
  145.               next;
  146. --- 153,165 ----
  147.       for (i = 2; i <= len; i++) {
  148.           c = substr(str, i, 1);
  149.           if (!opt[c]) {
  150. !             printf("-%s\n", substr(str, i));
  151.               next;
  152.           }
  153. !         printf("-%s\n", c);
  154.           if (arg[c]) {
  155.               if (i < len)
  156. !                 printf("'"'%s'"'\n", substr(str, i + 1));
  157.               else
  158.                   expect = 1;
  159.               next;
  160. ***************
  161. *** 168,173 ****
  162. --- 171,177 ----
  163.           print "?";
  164.   }
  165.   '`
  166. + eval "set $*"
  167.   shift
  168.   
  169.   # Argument parsing
  170.  
  171. Index: kit/unkit.SH
  172. Prereq: 2.0.1.13
  173. *** kit/unkit.SH.old    Tue Nov  3 10:12:58 1992
  174. --- kit/unkit.SH    Tue Nov  3 10:12:59 1992
  175. ***************
  176. *** 19,27 ****
  177.   # @(#) (c) E. Mogenet April 1990
  178.   # @(#) (c) R. Manfredi, 1990 1991
  179.   
  180. ! # $Id: unkit.SH,v 2.0.1.13 92/11/01 15:08:15 ram Exp $
  181.   #
  182.   # $Log:    unkit.SH,v $
  183.   # Revision 2.0.1.13  92/11/01  15:08:15  ram
  184.   # patch20: added getopt-style option parsing
  185.   # 
  186. --- 19,30 ----
  187.   # @(#) (c) E. Mogenet April 1990
  188.   # @(#) (c) R. Manfredi, 1990 1991
  189.   
  190. ! # $Id: unkit.SH,v 2.0.1.14 92/11/03 10:12:44 ram Exp $
  191.   #
  192.   # $Log:    unkit.SH,v $
  193. + # Revision 2.0.1.14  92/11/03  10:12:44  ram
  194. + # patch21: option parsing can now deal with embeded spaces in arguments
  195. + # 
  196.   # Revision 2.0.1.13  92/11/01  15:08:15  ram
  197.   # patch20: added getopt-style option parsing
  198.   # 
  199. ***************
  200. *** 132,138 ****
  201.   '
  202.   
  203.   # Process the command line options
  204. ! set X `for arg in $*; do echo $arg; done | awk '
  205.   BEGIN {
  206.       optstr = "bhlprVk:";    # getopt-style specification
  207.   
  208. --- 135,141 ----
  209.   '
  210.   
  211.   # Process the command line options
  212. ! set X `for arg in "$@"; do echo $arg; done | awk '
  213.   BEGIN {
  214.       optstr = "bhlprVk:";    # getopt-style specification
  215.   
  216. ***************
  217. *** 151,157 ****
  218.       expect = 0;
  219.       str = $0;
  220.       if (substr(str, 1, 1) != "-") {
  221. !         print str;
  222.           next;
  223.       }
  224.       len = length($0);
  225. --- 154,160 ----
  226.       expect = 0;
  227.       str = $0;
  228.       if (substr(str, 1, 1) != "-") {
  229. !         printf("'"'%s'"'\n", str);
  230.           next;
  231.       }
  232.       len = length($0);
  233. ***************
  234. *** 158,170 ****
  235.       for (i = 2; i <= len; i++) {
  236.           c = substr(str, i, 1);
  237.           if (!opt[c]) {
  238. !             print sprintf("-%s", substr(str, i));
  239.               next;
  240.           }
  241. !         print sprintf("-%s", c);
  242.           if (arg[c]) {
  243.               if (i < len)
  244. !                 print substr(str, i + 1);
  245.               else
  246.                   expect = 1;
  247.               next;
  248. --- 161,173 ----
  249.       for (i = 2; i <= len; i++) {
  250.           c = substr(str, i, 1);
  251.           if (!opt[c]) {
  252. !             printf("-%s\n", substr(str, i));
  253.               next;
  254.           }
  255. !         printf("-%s\n", c);
  256.           if (arg[c]) {
  257.               if (i < len)
  258. !                 printf("'"'%s'"'\n", substr(str, i + 1));
  259.               else
  260.                   expect = 1;
  261.               next;
  262. ***************
  263. *** 176,181 ****
  264. --- 179,185 ----
  265.           print "?";
  266.   }
  267.   '`
  268. + eval "set $*"
  269.   shift
  270.   
  271.   # Option parsing
  272.  
  273. Index: kit/kit.SH
  274. Prereq: 2.0.1.11
  275. *** kit/kit.SH.old    Tue Nov  3 10:12:48 1992
  276. --- kit/kit.SH    Tue Nov  3 10:12:50 1992
  277. ***************
  278. *** 26,34 ****
  279.   !GROK!THIS!
  280.   $spitshell >>kit <<'!NO!SUBS!'
  281.   
  282. ! # $Id: kit.SH,v 2.0.1.11 92/11/01 15:08:04 ram Exp $
  283.   #
  284.   # $Log:    kit.SH,v $
  285.   # Revision 2.0.1.11  92/11/01  15:08:04  ram
  286.   # patch20: added getopt-style option parsing
  287.   # 
  288. --- 26,37 ----
  289.   !GROK!THIS!
  290.   $spitshell >>kit <<'!NO!SUBS!'
  291.   
  292. ! # $Id: kit.SH,v 2.0.1.12 92/11/03 10:12:34 ram Exp $
  293.   #
  294.   # $Log:    kit.SH,v $
  295. + # Revision 2.0.1.12  92/11/03  10:12:34  ram
  296. + # patch21: option parsing can now deal with embeded spaces in arguments
  297. + # 
  298.   # Revision 2.0.1.11  92/11/01  15:08:04  ram
  299.   # patch20: added getopt-style option parsing
  300.   # 
  301. ***************
  302. *** 129,135 ****
  303.   '
  304.   
  305.   # Process the command line options
  306. ! set X `for arg in $*; do echo $arg; done | awk '
  307.   BEGIN {
  308.       optstr = "BEFHMVXefhpxS:a:d:k:l:m:n:s:";    # getopt-style specification
  309.   
  310. --- 132,138 ----
  311.   '
  312.   
  313.   # Process the command line options
  314. ! set X `for arg in "$@"; do echo $arg; done | awk '
  315.   BEGIN {
  316.       optstr = "BEFHMVXefhpxS:a:d:k:l:m:n:s:";    # getopt-style specification
  317.   
  318. ***************
  319. *** 148,154 ****
  320.       expect = 0;
  321.       str = $0;
  322.       if (substr(str, 1, 1) != "-") {
  323. !         print str;
  324.           next;
  325.       }
  326.       len = length($0);
  327. --- 151,157 ----
  328.       expect = 0;
  329.       str = $0;
  330.       if (substr(str, 1, 1) != "-") {
  331. !         printf("'"'%s'"'\n", str);
  332.           next;
  333.       }
  334.       len = length($0);
  335. ***************
  336. *** 155,167 ****
  337.       for (i = 2; i <= len; i++) {
  338.           c = substr(str, i, 1);
  339.           if (!opt[c]) {
  340. !             print sprintf("-%s", substr(str, i));
  341.               next;
  342.           }
  343. !         print sprintf("-%s", c);
  344.           if (arg[c]) {
  345.               if (i < len)
  346. !                 print substr(str, i + 1);
  347.               else
  348.                   expect = 1;
  349.               next;
  350. --- 158,170 ----
  351.       for (i = 2; i <= len; i++) {
  352.           c = substr(str, i, 1);
  353.           if (!opt[c]) {
  354. !             printf("-%s\n", substr(str, i));
  355.               next;
  356.           }
  357. !         printf("-%s\n", c);
  358.           if (arg[c]) {
  359.               if (i < len)
  360. !                 printf("'"'%s'"'\n", substr(str, i + 1));
  361.               else
  362.                   expect = 1;
  363.               next;
  364. ***************
  365. *** 173,178 ****
  366. --- 176,182 ----
  367.           print "?";
  368.   }
  369.   '`
  370. + eval "set $*"
  371.   shift
  372.   
  373.   while test $# -gt 0
  374.  
  375. *** End of Patch 21 ***
  376.