home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume15 / cshar / patch3 < prev    next >
Encoding:
Internet Message Format  |  1988-06-05  |  13.4 KB

  1. Subject:  v15i041:  Tools to create and unpack shell archives, Patch3
  2. Summary: This is an official patch for cshar 2.0; please apply it.
  3. Newsgroups: comp.sources.unix,comp.sources.bugs
  4. Approved: rsalz@uunet.UU.NET
  5.  
  6. Submitted-by: Rich Salz <rsalz@bbn.com>
  7. Posting-number: Volume 15, Issue 41
  8. Archive-name: cshar/patch3
  9.  
  10.  
  11. This patch introduces two new config parameters, BACKUP_PREFIX and
  12. NEED_RENAME.  If #define'd, the first is used by makekit as a prefix
  13. for the old manifest, so that "manifest.txt" could become "b-manife.txt"
  14. rather than "manifest.bak".  Makekit now uses the modern rename()
  15. call rather than a link()/unlink() combination.  If you don't have
  16. rename() in your C library, #define NEED_RENAME in your config.
  17.  
  18. Description:
  19.     From: Steve Feldman <oliveb!tymix!feldman>
  20.     +There was a return(TRUE) missing after the if that checked for
  21.      "*.[ch]" files in findsrc, so that it wouldn't find sources.
  22.  
  23.     From: Arch-Mage Ged <dalenber@e.cs.uiuc.edu>
  24.     +The makekit program thinks that the -p flag takes an argument.
  25.     +The makekit manpage had a formatting error, giving "[ [ -e ]" in
  26.      the synopsis.
  27.  
  28.     From: Steve Creps <creps@silver.bacs.indiana.edu>
  29.     +MS-DOS uses rename(), not link()/unlink() combinations.
  30.     +Appending a ".BAK" to the old manifest could cause problems on some
  31.      systems.
  32.  
  33. Fix:
  34.     To aid in robustness, patches are not shipped "raw".  If you have the
  35.     patch 10 of patch installed, you can feed this message directly to
  36.     patch, otherwise you will have to unshar it and feed the resulting
  37.     file to patch.  For example, from rn, say "|unshar -d DIR" where DIR
  38.     is your cshar source directory.  Outside of rn, say "cd DIR; unshar
  39.     <thisarticle".  This will create a file called patch03, which you can
  40.     then feed to the patch program.
  41.  
  42.     If you don't have patch and unshar, you are doing things the hard way.
  43.  
  44.     If patch indicates that patchlevel is the wrong version, you may need
  45.     to apply one or more previous patches, or the patch may already have
  46.     been applied.  See the patchlevel.h file to find out what has or has
  47.     not been applied.  In any event, don't continue with the patch.
  48.  
  49.     If any patches are missing, they can be obtained from your nearest
  50.     comp.sources.unix archive.
  51.  
  52. #! /bin/sh
  53. # This is a shell archive.  Remove anything before this line, then unpack
  54. # it by saving it into a file and typing "sh file".  To overwrite existing
  55. # files, type "sh file -c".  You can also feed this as standard input via
  56. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  57. # will see the following message at the end:
  58. #        "End of shell archive."
  59. # Contents:  patch03
  60. # Wrapped by rsalz@fig.bbn.com on Mon Jun  6 22:22:31 1988
  61. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  62. if test -f 'patch03' -a "${1}" != "-c" ; then 
  63.   echo shar: Will not clobber existing file \"'patch03'\"
  64. else
  65. echo shar: Extracting \"'patch03'\" \(10182 characters\)
  66. sed "s/^X//" >'patch03' <<'END_OF_FILE'
  67. Index: patchlevel.h
  68. Prereq: 2.2
  69. X*** /tmp/,RCSt1a01561    Mon Jun  6 22:11:26 1988
  70. X--- patchlevel.h    Mon Jun  6 22:04:35 1988
  71. X***************
  72. X*** 1,17 ****
  73. X  /*
  74. X  **  This file records official patches.  RCS records the edit log.
  75. X  **
  76. X  **  $Log:    patchlevel.h,v $
  77. X  **  Revision 2.2  88/06/03  16:08:37  rsalz
  78. X  **  patch02:  Fix order of chdir/mkdir commands for unshar.
  79. X  **  
  80. X  **  Revision 2.1  88/06/03  12:16:40  rsalz
  81. X! **  patch01:  Add config.x386 and config.sVr3; change "dirent.h" to <dirent.h>
  82. X  **  patch01:  In Makefile, use $(DIRLIB) only in actions, not dependencies;
  83. X  **  patch01:  add /usr/man/local option for MANDIR.
  84. X  **  patch01:  Put isascii() before every use of a <ctype.h> macro. 
  85. X  **  patch01:  Initialize Flist in shar.c/main().
  86. X! **  patch01:  Add -x to synopsis in makekit.man; improve the usage message and
  87. X  **  patch01:  put comments around note after an #endif (ANSI strikes again).
  88. X  **  patch01:  Remove extraneous declaration of Dispatch[] in parser.c
  89. X  **  patch01:  Add missing argument in fprintf call in findsrc.
  90. X--- 1,24 ----
  91. X  /*
  92. X  **  This file records official patches.  RCS records the edit log.
  93. X  **
  94. X+ **  $Header: patchlevel.h,v 2.3 88/06/06 22:04:33 rsalz Exp $
  95. X+ **
  96. X  **  $Log:    patchlevel.h,v $
  97. X+ **  Revision 2.3  88/06/06  22:04:33  rsalz
  98. X+ **  patch03:  Fix typo in makekit manpage, and getopt call in the program.
  99. X+ **  patch03:  Add NEED_RENAME and BACKUP_PREFIX to config.*; edit llib.c
  100. X+ **  patch03:  and makekit.c to use them.
  101. X+ **  
  102. X  **  Revision 2.2  88/06/03  16:08:37  rsalz
  103. X  **  patch02:  Fix order of chdir/mkdir commands for unshar.
  104. X  **  
  105. X  **  Revision 2.1  88/06/03  12:16:40  rsalz
  106. X! **  patch01:  Add config.x386 & config.sVr3; change "dirent.h" to <dirent.h>
  107. X  **  patch01:  In Makefile, use $(DIRLIB) only in actions, not dependencies;
  108. X  **  patch01:  add /usr/man/local option for MANDIR.
  109. X  **  patch01:  Put isascii() before every use of a <ctype.h> macro. 
  110. X  **  patch01:  Initialize Flist in shar.c/main().
  111. X! **  patch01:  Add -x to synopsis in makekit.man; improve the usage message &
  112. X  **  patch01:  put comments around note after an #endif (ANSI strikes again).
  113. X  **  patch01:  Remove extraneous declaration of Dispatch[] in parser.c
  114. X  **  patch01:  Add missing argument in fprintf call in findsrc.
  115. X***************
  116. X*** 19,22 ****
  117. X  **  Revision 2.0  88/05/27  13:32:13  rsalz
  118. X  **  First comp.sources.unix release
  119. X  */
  120. X! #define PATCHLEVEL 2
  121. X--- 26,29 ----
  122. X  **  Revision 2.0  88/05/27  13:32:13  rsalz
  123. X  **  First comp.sources.unix release
  124. X  */
  125. X! #define PATCHLEVEL 3
  126. X*** /tmp/,RCSt1a01561    Mon Jun  6 22:11:23 1988
  127. X--- findsrc.c    Mon Jun  6 22:04:07 1988
  128. X***************
  129. X*** 5,11 ****
  130. X  #include "shar.h"
  131. X  #ifdef    RCSID
  132. X  static char RCS[] =
  133. X!     "$Header: findsrc.c,v 2.1 88/06/03 11:38:51 rsalz Exp $";
  134. X  #endif    /* RCSID */
  135. X  
  136. X  
  137. X--- 5,11 ----
  138. X  #include "shar.h"
  139. X  #ifdef    RCSID
  140. X  static char RCS[] =
  141. X!     "$Header: findsrc.c,v 2.2 88/06/06 22:04:03 rsalz Exp $";
  142. X  #endif    /* RCSID */
  143. X  
  144. X  
  145. X***************
  146. X*** 96,101 ****
  147. X--- 96,102 ----
  148. X  
  149. X      /* C source (*.[ch])? */
  150. X      if ((p = d) && (*++p == 'c' || *p == 'h') && *++p == '\0')
  151. X+     return(TRUE);
  152. X  
  153. X      /* Manpage (*.[1234567890] or *.man)? */
  154. X      if ((p = d) && isascii(s[1]) && isdigit(*p))
  155. X*** /tmp/,RCSt1a01561    Mon Jun  6 22:11:29 1988
  156. X--- makekit.c    Mon Jun  6 22:04:50 1988
  157. X***************
  158. X*** 5,11 ****
  159. X  #include "shar.h"
  160. X  #ifdef    RCSID
  161. X  static char RCS[] =
  162. X!     "$Header: makekit.c,v 2.1 88/06/03 11:38:58 rsalz Exp $";
  163. X  #endif    /* RCSID */
  164. X  
  165. X  
  166. X--- 5,11 ----
  167. X  #include "shar.h"
  168. X  #ifdef    RCSID
  169. X  static char RCS[] =
  170. X!     "$Header: makekit.c,v 2.2 88/06/06 22:04:45 rsalz Exp $";
  171. X  #endif    /* RCSID */
  172. X  
  173. X  
  174. X***************
  175. X*** 160,166 ****
  176. X      /* Collect input. */
  177. X      Value = FALSE;
  178. X      Notkits = FALSE;
  179. X!     while ((i = getopt(ac, av, "1eh:i:k:n:mo:p:s:t:x")) != EOF)
  180. X      switch (i) {
  181. X      default:
  182. X          Fprintf(stderr, "usage: makekit %s\n        %s\n",
  183. X--- 160,166 ----
  184. X      /* Collect input. */
  185. X      Value = FALSE;
  186. X      Notkits = FALSE;
  187. X!     while ((i = getopt(ac, av, "1eh:i:k:n:mo:ps:t:x")) != EOF)
  188. X      switch (i) {
  189. X      default:
  190. X          Fprintf(stderr, "usage: makekit %s\n        %s\n",
  191. X***************
  192. X*** 343,348 ****
  193. X--- 343,351 ----
  194. X      F = stdout;
  195. X      else {
  196. X      if (GetStat(OutName)) {
  197. X+ #ifdef    BACKUP_PREFIX
  198. X+         (void)sprintf(buff, "%s%s", BACKUP_PREFIX, OutName);
  199. X+ #else
  200. X          /* Handle /foo/bar/VeryLongFileName.BAK for non-BSD sites. */
  201. X          (void)sprintf(buff, "%s.BAK", OutName);
  202. X          p = (p = RDX(buff, '/')) ? p + 1 : buff;
  203. X***************
  204. X*** 349,358 ****
  205. X          if (strlen(p) > 14)
  206. X          /* ... well, sort of handle it. */
  207. X          (void)strcpy(&p[10], ".BAK");
  208. X          Fprintf(stderr, "Renaming %s to %s\n", OutName, buff);
  209. X!         (void)unlink(buff);
  210. X!         (void)link(OutName, buff);
  211. X!         (void)unlink(OutName);
  212. X      }
  213. X      if ((F = fopen(OutName, "w")) == NULL) {
  214. X          Fprintf(stderr, "Can't open '%s' for output, %s.\n",
  215. X--- 352,360 ----
  216. X          if (strlen(p) > 14)
  217. X          /* ... well, sort of handle it. */
  218. X          (void)strcpy(&p[10], ".BAK");
  219. X+ #endif    /* BACKUP_PREFIX */
  220. X          Fprintf(stderr, "Renaming %s to %s\n", OutName, buff);
  221. X!         (void)rename(OutName, buff);
  222. X      }
  223. X      if ((F = fopen(OutName, "w")) == NULL) {
  224. X          Fprintf(stderr, "Can't open '%s' for output, %s.\n",
  225. X*** /tmp/,RCSt1a01561    Mon Jun  6 22:11:33 1988
  226. X--- makekit.man    Mon Jun  6 22:05:05 1988
  227. X***************
  228. X*** 1,5 ****
  229. X  .TH MAKEKIT 1l
  230. X! .\" $Header: makekit.man,v 2.1 88/06/03 11:39:05 rsalz Exp $
  231. X  .SH NAME
  232. X  makekit \- split files up into shell archive packages
  233. X  .SH SYNOPSIS
  234. X--- 1,5 ----
  235. X  .TH MAKEKIT 1l
  236. X! .\" $Header: makekit.man,v 2.2 88/06/06 22:05:01 rsalz Exp $
  237. X  .SH NAME
  238. X  makekit \- split files up into shell archive packages
  239. X  .SH SYNOPSIS
  240. X***************
  241. X*** 7,13 ****
  242. X  [
  243. X  .B -1
  244. X  ] [
  245. X- [
  246. X  .B -e
  247. X  ] [
  248. X  .B -x
  249. X--- 7,12 ----
  250. X*** /tmp/,RCSt1a01561    Mon Jun  6 22:11:36 1988
  251. X--- llib.c    Mon Jun  6 22:05:18 1988
  252. X***************
  253. X*** 7,13 ****
  254. X  #include "shar.h"
  255. X  #ifdef    RCSID
  256. X  static char RCS[] =
  257. X!     "$Header: llib.c,v 2.0 88/05/27 13:27:09 rsalz Exp $";
  258. X  #endif    /* RCSID */
  259. X  
  260. X  
  261. X--- 7,13 ----
  262. X  #include "shar.h"
  263. X  #ifdef    RCSID
  264. X  static char RCS[] =
  265. X!     "$Header: llib.c,v 2.1 88/06/06 22:05:14 rsalz Exp $";
  266. X  #endif    /* RCSID */
  267. X  
  268. X  
  269. X***************
  270. X*** 32,37 ****
  271. X--- 32,53 ----
  272. X      return(buff);
  273. X  }
  274. X  
  275. X+ 
  276. X+ #ifdef    NEED_RENAME
  277. X+ /*
  278. X+ **  Give the file "from" the new name "to", removing an old "to"
  279. X+ **  if it exists.
  280. X+ */
  281. X+ int
  282. X+ rename(from, to)
  283. X+     char    *from;
  284. X+     char    *to;
  285. X+ {
  286. X+     (void)unlink(from);
  287. X+     (void)link(to, from);
  288. X+     return(unlink(to));
  289. X+ }
  290. X+ #endif    /* NEED_RENAME */
  291. X  
  292. X  
  293. X  #ifdef    NEED_MKDIR
  294. X*** /tmp/,RCSt1a01561    Mon Jun  6 22:11:39 1988
  295. X--- config.h    Mon Jun  6 22:05:30 1988
  296. X***************
  297. X*** 4,10 ****
  298. X  **  This is known to work on Ultrix1.2 and Sun3.4 machines; it may work
  299. X  **  on other BSD variants, too.
  300. X  **
  301. X! **  $Header: config.h,v 2.1 88/06/03 11:38:40 rsalz Exp $
  302. X  */
  303. X  
  304. X  
  305. X--- 4,10 ----
  306. X  **  This is known to work on Ultrix1.2 and Sun3.4 machines; it may work
  307. X  **  on other BSD variants, too.
  308. X  **
  309. X! **  $Header: config.h,v 2.2 88/06/06 22:05:27 rsalz Exp $
  310. X  */
  311. X  
  312. X  
  313. X***************
  314. X*** 25,33 ****
  315. X--- 25,35 ----
  316. X  #define RDX        rindex        /* Maybe strrchr?        */
  317. X  /*efine NEED_MKDIR            /* Don't have mkdir(2)?        */
  318. X  /*efine NEED_QSORT            /* Don't have qsort(3)?        */
  319. X+ /*efine NEED_RENAME            /* Don't have rename(2 or 3)?    */
  320. X  #define NEED_GETOPT            /* Need local getopt object?    */
  321. X  #define CAN_POPEN            /* Can invoke file(1) command?    */
  322. X  /*efine USE_MY_SHELL            /* Don't popen("/bin/sh")?    */
  323. X+ /*efine BACKUP_PREFIX    "B-"        /* Instead of ".BAK" suffix?    */
  324. X  typedef int         sigret_t;    /* What a signal handler returns */
  325. X  typedef int        *align_t;    /* Worst-case alignment, for lint */
  326. X  /* typedef long        time_t        /* Needed for non-BSD sites?    */
  327. X*** /tmp/,RCSt1a01561    Mon Jun  6 22:11:41 1988
  328. X--- config.sVr3    Mon Jun  6 22:05:43 1988
  329. X***************
  330. X*** 1,10 ****
  331. X  /*
  332. X  **  Configuration file for shar and friends.
  333. X  **
  334. X! **  This is known to work on Ultrix1.2 and Sun3.4 machines; it may work
  335. X! **  on other BSD variants, too.
  336. X  **
  337. X! **  $Header: config.sVr3,v 2.0 88/06/03 11:45:30 rsalz Exp $
  338. X  */
  339. X  
  340. X  
  341. X--- 1,9 ----
  342. X  /*
  343. X  **  Configuration file for shar and friends.
  344. X  **
  345. X! **  This is for System V release 3.1 and 3.2.
  346. X  **
  347. X! **  $Header: config.sVr3,v 2.1 88/06/06 22:05:40 rsalz Exp $
  348. X  */
  349. X  
  350. X  
  351. X***************
  352. X*** 25,33 ****
  353. X--- 24,34 ----
  354. X  #define RDX        strrchr        /* Maybe strrchr?        */
  355. X  /*efine NEED_MKDIR            /* Don't have mkdir(2)?        */
  356. X  /*efine NEED_QSORT            /* Don't have qsort(3)?        */
  357. X+ #define NEED_RENAME            /* Don't have rename(2 or 3)?    */
  358. X  /*efine NEED_GETOPT            /* Need local getopt object?    */
  359. X  #define CAN_POPEN            /* Can invoke file(1) command?    */
  360. X  /*efine USE_MY_SHELL            /* Don't popen("/bin/sh")?    */
  361. X+ /*efine BACKUP_PREFIX    "B-"        /* Instead of ".BAK" suffix?    */
  362. X  typedef void         sigret_t;    /* What a signal handler returns */
  363. X  typedef int        *align_t;    /* Worst-case alignment, for lint */
  364. X  typedef long        time_t;        /* Needed for non-BSD sites?    */
  365. X*** /tmp/,RCSt1a01561    Mon Jun  6 22:11:45 1988
  366. X--- config.x386    Mon Jun  6 22:05:55 1988
  367. X***************
  368. X*** 4,10 ****
  369. X  **  This config file is for Xenix on a 386.
  370. X  **  In the Makefile, set DIRLIB=-lx, and tweak the MANDIR and 1 variables.
  371. X  **
  372. X! **  $Header: config.x386,v 2.0 88/06/03 11:46:28 rsalz Exp $
  373. X  */
  374. X  
  375. X  
  376. X--- 4,10 ----
  377. X  **  This config file is for Xenix on a 386.
  378. X  **  In the Makefile, set DIRLIB=-lx, and tweak the MANDIR and 1 variables.
  379. X  **
  380. X! **  $Header: config.x386,v 2.1 88/06/06 22:05:52 rsalz Exp $
  381. X  */
  382. X  
  383. X  
  384. X***************
  385. X*** 25,33 ****
  386. X--- 25,35 ----
  387. X  #define RDX        strrchr        /* Maybe strrchr?        */
  388. X  #define NEED_MKDIR            /* Don't have mkdir(2)?        */
  389. X  /*efine NEED_QSORT            /* Don't have qsort(3)?        */
  390. X+ #define NEED_RENAME            /* Don't have rename(2 or 3)?    */
  391. X  /*efine NEED_GETOPT            /* Need local getopt object?    */
  392. X  #define CAN_POPEN            /* Can invoke file(1) command?    */
  393. X  /*efine USE_MY_SHELL            /* Don't popen("/bin/sh")?    */
  394. X+ /*efine BACKUP_PREFIX    "B-"        /* Instead of ".BAK" suffix?    */
  395. X  typedef int         sigret_t;    /* What a signal handler returns */
  396. X  typedef int        *align_t;    /* Worst-case alignment, for lint */
  397. X  /* typedef long        time_t        /* Needed for non-BSD sites?    */
  398. END_OF_FILE
  399. if test 10182 -ne `wc -c <'patch03'`; then
  400.     echo shar: \"'patch03'\" unpacked with wrong size!
  401. fi
  402. # end of 'patch03'
  403. fi
  404. echo shar: End of shell archive.
  405. exit 0
  406.