home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume25 / remind / patch04 next >
Encoding:
Text File  |  1991-11-11  |  16.1 KB  |  522 lines

  1. Newsgroups: comp.sources.misc
  2. From: dfs@doe.carleton.ca (David F. Skoll)
  3. Subject:  v25i044:  remind - A replacement for calendar, Patch04
  4. Message-ID: <1991Nov10.214035.25123@sparky.imd.sterling.com>
  5. X-Md4-Signature: e7a741b7d16b90fa769d6069d8e92873
  6. Date: Sun, 10 Nov 1991 21:40:35 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: dfs@doe.carleton.ca (David F. Skoll)
  10. Posting-number: Volume 25, Issue 44
  11. Archive-name: remind/patch04
  12. Environment: UNIX, MS-DOS
  13. Patch-To: remind: Volume 17, Issue 3-6
  14.  
  15. This is Patch 4 for Remind version 2.3, a replacement for calendar(1).
  16.  
  17. Before applying this patch, make sure you have Remind 2.3.3 source code.
  18. Check the file patchlevel.h to ensure this
  19.  
  20. Change to the Remind source directory, unshar the patch file, and type:
  21.  
  22.     patch < patch.04.
  23.  
  24. Re-make and re-install Remind.  To make sure that everything worked, type:
  25.  
  26.     make test
  27.  
  28. This patch does not add any features to Remind.  If you don't feel
  29. like it, there's no need to apply this patch.  It simply adds a few
  30. useful targets to the Makefile, tidies up the code somewhat, and
  31. corrects a compile-time warning issued by a particular finicky
  32. compiler.  It also makes the Makefile easier to configure.
  33.  
  34. You probably want to keep this patch around even if you don't apply it
  35. now, since subsequent patches will depend on it.
  36.  
  37. You can FTP a copy of remind 2.3.3 from alfred.ccs.carleton.ca
  38. (134.117.1.1) in the directory /pub.  I'll try to get 2.3.4 uploaded
  39. there ASAP.
  40.  
  41. David F. Skoll
  42.  
  43. -------------- Cut Here ---------- Cut Here ---------- Cut Here -------------
  44. #!/bin/sh
  45. # This is Remind 2.3 Official Patch #4, a shell archive (shar 3.32)
  46. # made 11/05/1991 21:03 UTC by dfs@riker
  47. # Source directory /enterprise/transporter/dfs/work/.rem/patch4-work
  48. #
  49. # existing files will NOT be overwritten
  50. #
  51. # This shar contains:
  52. # length  mode       name
  53. # ------ ---------- ------------------------------------------
  54. #  13305 -rw------- patch.04
  55. #
  56. if touch 2>&1 | fgrep 'amc' > /dev/null
  57.  then TOUCH=touch
  58.  else TOUCH=true
  59. fi
  60. # ============= patch.04 ==============
  61. if test X"$1" != X"-c" -a -f 'patch.04'; then
  62.     echo "File already exists: skipping 'patch.04'"
  63. else
  64. echo "x - extracting patch.04 (Text)"
  65. sed 's/^X//' << 'SHAR_EOF' > patch.04 &&
  66. XPatch the Makefile to include many new and useful targets, like make tar,
  67. Xmake shar, make test, etc.
  68. X*** ../patch3-work/Makefile    Wed Jul 17 12:48:49 1991
  69. X--- ./Makefile    Tue Nov  5 15:41:46 1991
  70. X***************
  71. X*** 2,10 ****
  72. X  
  73. X  #--------------- BEGINNING OF THINGS YOU CAN CHANGE --------------
  74. X  
  75. X- #If you need more than one of the following definitions for CDEFS,
  76. X- #concatenate the necessary definitions.
  77. X- 
  78. X  #If you have a BSD system:
  79. X  CDEFS= -DUNIX
  80. X  
  81. X--- 2,7 ----
  82. X***************
  83. X*** 12,30 ****
  84. X  #CDEFS= -DUNIX -DSYSV
  85. X  
  86. X  #If your system does not include <malloc.h>, uncomment next line:
  87. X! #CDEFS= -DNO_MALLOC_H
  88. X  
  89. X  #If you have a SYSV system which does not implement the pid_t type,
  90. X  #uncomment the next line:
  91. X! #CDEFS= -Dpid_t=int
  92. X  
  93. X  #If your system doesn't print return w/ newline for background processes:
  94. X! #CDEFS= -DNL=\"\\r\\n\"
  95. X  
  96. X  #If you want to use gcc:
  97. X  #CC= gcc
  98. X  
  99. X! CFLAGS = -O $(CDEFS)
  100. X  
  101. X  #Where do you want it installed?
  102. X  BINDIR= /usr/local/bin
  103. X--- 9,28 ----
  104. X  #CDEFS= -DUNIX -DSYSV
  105. X  
  106. X  #If your system does not include <malloc.h>, uncomment next line:
  107. X! #MDEFS= -DNO_MALLOC_H
  108. X  
  109. X  #If you have a SYSV system which does not implement the pid_t type,
  110. X  #uncomment the next line:
  111. X! #PDEFS= -Dpid_t=int
  112. X  
  113. X  #If your system doesn't print return w/ newline for background processes:
  114. X! #NDEFS= -DNL=\"\\r\\n\"
  115. X  
  116. X  #If you want to use gcc:
  117. X  #CC= gcc
  118. X  
  119. X! #Any extra compiler flags, etc go here.
  120. X! EXTRAFLAGS= -O
  121. X  
  122. X  #Where do you want it installed?
  123. X  BINDIR= /usr/local/bin
  124. X***************
  125. X*** 44,82 ****
  126. X  
  127. X  #--------------- SHOULDN'T CHANGE STUFF BELOW HERE ---------------
  128. X  
  129. X! all: dorem.o files.o main.o nextdate.o init.o dosubst.o timed.o calendar.o cache.o omits.o
  130. X!     $(CC) -o remind dorem.o files.o main.o nextdate.o init.o dosubst.o timed.o calendar.o cache.o omits.o
  131. X  
  132. X! dorem.o: dorem.c
  133. X  
  134. X! files.o: files.c
  135. X  
  136. X! main.o:  main.c
  137. X  
  138. X! omits.o: omits.c
  139. X  
  140. X! nextdate.o: nextdate.c
  141. X  
  142. X! init.o: init.c
  143. X  
  144. X! dosubst.o: dosubst.c
  145. X  
  146. X! timed.o: timed.c
  147. X  
  148. X! calendar.o: calendar.c
  149. X  
  150. X! cache.o: cache.c
  151. X  
  152. X! clean:
  153. X      rm -f *.o core *~ remind
  154. X  
  155. X! install:
  156. X      $(INSTALL) remind $(BINDIR)
  157. X      $(INSTALL) kall $(SCRIPTDIR)
  158. X      $(INSTALL) rem $(SCRIPTDIR)
  159. X  
  160. X! install.man:
  161. X      $(INSTALL) remind.1 $(MANDIR)/man$(MANSECTION)/remind.$(MANSECTION)
  162. X      $(INSTALL) rem.1 $(MANDIR)/man$(MANSECTION)/rem.$(MANSECTION)
  163. X      $(INSTALL) kall.1 $(MANDIR)/man$(MANSECTION)/kall.$(MANSECTION)
  164. X  
  165. X--- 42,125 ----
  166. X  
  167. X  #--------------- SHOULDN'T CHANGE STUFF BELOW HERE ---------------
  168. X  
  169. X! CFLAGS= $(EXTRAFLAGS) $(CDEFS) $(MDEFS) $(PDEFS) $(NDEFS)
  170. X  
  171. X! HEADERS= cache.h defines.h globals.h patchlevel.h protos.h
  172. X  
  173. X! MANIFEST= COPYRIGHT Makefile README.DOS README.UNIX WHATSNEW.23 cache.c \
  174. X! cache.h calendar.c defines.h dorem.c dosubst.c files.c globals.h init.c \
  175. X! kall kall.1 main.c makefile.tc nextdate.c omits.c patchlevel.h protos.h \
  176. X! rem rem.1 remind-all.csh remind-all.sh remind.1 remind.mak remind.rsp \
  177. X! test.out test.rem timed.c turboc.c turboc.h
  178. X  
  179. X! all: manifest_check remind
  180. X  
  181. X! remind: dorem.o files.o main.o nextdate.o init.o dosubst.o timed.o calendar.o \
  182. X! cache.o omits.o
  183. X!     $(CC) -o remind dorem.o files.o main.o nextdate.o init.o dosubst.o \
  184. X!     timed.o calendar.o cache.o omits.o
  185. X  
  186. X! dorem.o: dorem.c $(HEADERS)
  187. X  
  188. X! files.o: files.c $(HEADERS)
  189. X  
  190. X! main.o:  main.c $(HEADERS)
  191. X  
  192. X! omits.o: omits.c $(HEADERS)
  193. X  
  194. X! nextdate.o: nextdate.c $(HEADERS)
  195. X  
  196. X! init.o: init.c $(HEADERS)
  197. X  
  198. X! dosubst.o: dosubst.c $(HEADERS)
  199. X! 
  200. X! timed.o: timed.c $(HEADERS)
  201. X! 
  202. X! calendar.o: calendar.c $(HEADERS)
  203. X! 
  204. X! cache.o: cache.c $(HEADERS)
  205. X! 
  206. X! clean: FORCE
  207. X      rm -f *.o core *~ remind
  208. X  
  209. X! emacs_clean: FORCE
  210. X!     rm -f *~
  211. X! 
  212. X! install: FORCE
  213. X      $(INSTALL) remind $(BINDIR)
  214. X      $(INSTALL) kall $(SCRIPTDIR)
  215. X      $(INSTALL) rem $(SCRIPTDIR)
  216. X  
  217. X! install.man: FORCE
  218. X      $(INSTALL) remind.1 $(MANDIR)/man$(MANSECTION)/remind.$(MANSECTION)
  219. X      $(INSTALL) rem.1 $(MANDIR)/man$(MANSECTION)/rem.$(MANSECTION)
  220. X      $(INSTALL) kall.1 $(MANDIR)/man$(MANSECTION)/kall.$(MANSECTION)
  221. X  
  222. X+ tar: manifest_check
  223. X+     tar cvf ./remind-2.3.4.tar $(MANIFEST)
  224. X+ 
  225. X+ tarZ: tar
  226. X+     compress -v ./remind-2.3.4.tar
  227. X+ 
  228. X+ shar: manifest_check
  229. X+     shar -x -n"Remind 2.3.4" -l45 -o./Shar $(MANIFEST)
  230. X+ 
  231. X+ test: manifest_check remind
  232. X+     @./remind -dv test.rem 16 FEB 1991 > ./test.out.2 2>&1
  233. X+     @tail +3 ./test.out > ./test.out.3
  234. X+     @tail +3 ./test.out > ./test.out.4
  235. X+     @if cmp -s ./test.out.3 ./test.out.4 ; then echo "Passed test" ; \
  236. X+         rm -f ./test.out.2 ./test.out.3 ./test.out.4; \
  237. X+         else echo "Failed test" ; rm -f ./test.out.3 ./test.out.4 ; fi
  238. X+ 
  239. X+ manifest_check: FORCE
  240. X+     @miss=0 ; \
  241. X+     for i in $(MANIFEST);\
  242. X+         do if test ! -r $$i ; then\
  243. X+             echo Distribution is missing file $$i ; miss=1;\
  244. X+         fi;\
  245. X+     done;\
  246. X+     if test $$miss = 1 ; then exit 1 ; \
  247. X+     else echo "Good... all required files seem to be present..."; fi
  248. X+ 
  249. X+ FORCE:
  250. X*** ../patch3-work/WHATSNEW.23    Tue Sep 10 10:49:33 1991
  251. X--- ./WHATSNEW.23    Thu Oct  3 12:16:38 1991
  252. X***************
  253. X*** 68,70 ****
  254. X--- 68,73 ----
  255. X  * Version 2.3 Patch 3 - Added a command-line option for Remind to process
  256. X  queued reminders in the foreground.  This makes automatic termination
  257. X  of Remind processes from within X-Windows and Sunview easier.
  258. X+ 
  259. X+ * Version 2.3 Patch 4 - Made the init.c file nicer.  Made the Makefile
  260. X+ prettier.  Added "make test", "make tar" and "make shar" Makefile targets.
  261. X*** ../patch3-work/init.c    Tue Sep 10 10:25:35 1991
  262. X--- ./init.c    Mon Sep 30 16:40:04 1991
  263. X***************
  264. X*** 12,17 ****
  265. X--- 12,22 ----
  266. X  static char DPMsg[] = "Debug and Purge options conflict - Purge chosen.\n";
  267. X  static char DPCMsg[] = "Calendar overrides Debug and Purge options.\n";
  268. X  static char NMsg[] = "Next overrides Calendar, Debug and Purge options.\n";
  269. X+ #ifdef __STDC__
  270. X+ void ShowUsage(void);
  271. X+ #else
  272. X+ void ShowUsage();
  273. X+ #endif
  274. X  
  275. X  /***************************************************************/
  276. X  /*                                                             */
  277. X***************
  278. X*** 51,79 ****
  279. X     Foreground = 0;
  280. X  
  281. X     if(argc == 1) {
  282. X!      fprintf(stderr,
  283. X!         "\nREMIND %d.%d Patch Level %d (C) 1990, 1991 by David Skoll.\n\n", 
  284. X!            VERSION_MAJOR, VERSION_MINOR, PATCHLEVEL);
  285. X! #ifdef UNIX
  286. X!      fprintf(stderr, "Usage: remind [-n | -d | -p | -c# [-w# | -s]] [-voraqthf] filename [date]\n\n");
  287. X! #else
  288. X!      fprintf(stderr, "Usage: remind [-n | -d | -p | -c# [-w# | -s]] [-vorth] filename [date]\n\n");
  289. X! #endif
  290. X!      fprintf(stderr, "-n   Output next occurrence of reminders in simple format\n");
  291. X!      fprintf(stderr, "-d   Debug reminder file\n-p   Purge reminder file\n");
  292. X!      fprintf(stderr, "-c#  Produce calendar for # months\n");
  293. X!      fprintf(stderr, "-w#  Make calendar # columns wide\n");
  294. X!      fprintf(stderr, "-s   Produce simple calendar listing (used with -c)\n");
  295. X!      fprintf(stderr, "-v   Verbose messages\n-o   Ignore ONCE directives\n");
  296. X!      fprintf(stderr, "-r   Ignore RUN directives\n");
  297. X! #ifdef UNIX
  298. X!      fprintf(stderr, "-a   Do not trigger current AT reminders until specified time\n");
  299. X!      fprintf(stderr, "-q   Do not queue current AT reminders\n");
  300. X!      fprintf(stderr, "-f   Process queued reminders in the foreground.\n");
  301. X! #endif
  302. X!      fprintf(stderr, "-t   Trigger all non-expired reminders regardless of delta\n");
  303. X!      fprintf(stderr, "-h   'Hush' mode - don't display anything if no reminders triggered\n\n");
  304. X!      exit(1);
  305. X     }
  306. X  
  307. X     i = 1;
  308. X--- 56,63 ----
  309. X     Foreground = 0;
  310. X  
  311. X     if(argc == 1) {
  312. X!       ShowUsage();
  313. X!       /* NOTREACHED */
  314. X     }
  315. X  
  316. X     i = 1;
  317. X***************
  318. X*** 167,174 ****
  319. X        }
  320. X        i++;
  321. X        if (i >= argc) {
  322. X!     fprintf(stderr, "Missing filename - type 'remind' for usage information.\n");
  323. X!      exit(1);
  324. X        }
  325. X        s = argv[i];
  326. X     }     
  327. X--- 151,158 ----
  328. X        }
  329. X        i++;
  330. X        if (i >= argc) {
  331. X!          ShowUsage();
  332. X!      /* NOTREACHED */
  333. X        }
  334. X        s = argv[i];
  335. X     }     
  336. X***************
  337. X*** 249,251 ****
  338. X--- 233,275 ----
  339. X     }
  340. X     return;
  341. X  }
  342. X+ 
  343. X+ /***************************************************************/
  344. X+ /*                                                             */
  345. X+ /*  ShowUsage                                                  */
  346. X+ /*                                                             */
  347. X+ /*  Print usage information for REMIND.                        */
  348. X+ /*                                                             */
  349. X+ /***************************************************************/
  350. X+ #ifdef __STDC__
  351. X+ static void ShowUsage(void)
  352. X+ #else
  353. X+ static void ShowUsage()
  354. X+ #endif
  355. X+ {
  356. X+   fprintf(stderr,
  357. X+      "\nREMIND %d.%d Patch Level %d Copyright 1990, 1991 by David Skoll.\n\n", 
  358. X+         VERSION_MAJOR, VERSION_MINOR, PATCHLEVEL);
  359. X+ #ifdef UNIX
  360. X+   fprintf(stderr, "Usage: remind [-n | -d | -p | -c# [-w# | -s]] [-voraqthf] filename [date]\n\n");
  361. X+ #else
  362. X+   fprintf(stderr, "Usage: remind [-n | -d | -p | -c# [-w# | -s]] [-vorth] filename [date]\n\n");
  363. X+ #endif
  364. X+   fprintf(stderr, "-n   Output next occurrence of reminders in simple format\n");
  365. X+   fprintf(stderr, "-d   Debug reminder file\n-p   Purge reminder file\n");
  366. X+   fprintf(stderr, "-c#  Produce calendar for # months\n");
  367. X+   fprintf(stderr, "-w#  Make calendar # columns wide\n");
  368. X+   fprintf(stderr, "-s   Produce simple calendar listing (used with -c)\n");
  369. X+   fprintf(stderr, "-v   Verbose messages\n-o   Ignore ONCE directives\n");
  370. X+   fprintf(stderr, "-r   Ignore RUN directives\n");
  371. X+ #ifdef UNIX
  372. X+   fprintf(stderr, "-a   Do not trigger current AT reminders until specified time\n");
  373. X+   fprintf(stderr, "-q   Do not queue current AT reminders\n");
  374. X+   fprintf(stderr, "-f   Process queued reminders in the foreground.\n");
  375. X+ #endif
  376. X+   fprintf(stderr, "-t   Trigger all non-expired reminders regardless of delta\n");
  377. X+   fprintf(stderr, "-h   'Hush' mode - don't display anything if no reminders triggered\n\n");
  378. X+   exit(1);
  379. X+ /* NOTREACHED */
  380. X+ }
  381. X+ 
  382. X*** ../patch3-work/patchlevel.h    Tue Sep 10 11:01:34 1991
  383. X--- ./patchlevel.h    Fri Sep 13 15:25:40 1991
  384. X***************
  385. X*** 3,6 ****
  386. X  #define VERSION_MAJOR 2
  387. X  #define VERSION_MINOR 3
  388. X  
  389. X! #define PATCHLEVEL 3
  390. X--- 3,6 ----
  391. X  #define VERSION_MAJOR 2
  392. X  #define VERSION_MINOR 3
  393. X  
  394. X! #define PATCHLEVEL 4
  395. X*** ../patch3-work/remind.1    Tue Sep 10 10:47:40 1991
  396. X--- ./remind.1    Fri Sep 13 15:25:35 1991
  397. X***************
  398. X*** 146,153 ****
  399. X  The
  400. X  .B \-f
  401. X  flag causes \fBremind\fR to remain in the foreground when handling queued
  402. X! AT reminders, rather than forking into the background.  This is useful in
  403. X! .xinitrc or .suntools scripts, because you can start \fBremind\fR and have
  404. X  it automatically killed when you exit X-Windows or Sunview.  For example,
  405. X  in your .xinitrc script, you could have:
  406. X  .PP
  407. X--- 146,153 ----
  408. X  The
  409. X  .B \-f
  410. X  flag causes \fBremind\fR to remain in the foreground when handling queued
  411. X! AT reminders, rather than forking into the background.  This is useful
  412. X! in .xinitrc or .suntools scripts, because you can start \fBremind\fR and have
  413. X  it automatically killed when you exit X-Windows or Sunview.  For example,
  414. X  in your .xinitrc script, you could have:
  415. X  .PP
  416. X*** ../patch3-work/test.out    Tue Feb 19 10:04:10 1991
  417. X--- ./test.out    Mon Sep 30 17:22:44 1991
  418. X***************
  419. X*** 1,5 ****
  420. X  
  421. X! File test.rem last accessed on Tuesday, 19 February, 1991
  422. X  
  423. X  --- REM MSG Every Day
  424. X  --- test.rem(19): *Trigger date: Saturday, 16 February, 1991.
  425. X--- 1,5 ----
  426. X  
  427. X! File test.rem last accessed on Monday, 30 September, 1991
  428. X  
  429. X  --- REM MSG Every Day
  430. X  --- test.rem(19): *Trigger date: Saturday, 16 February, 1991.
  431. X*** ../patch3-work/test.rem    Mon Feb 18 13:05:20 1991
  432. X--- ./test.rem    Mon Sep 30 17:22:16 1991
  433. X***************
  434. X*** 4,18 ****
  435. X  # of the REMIND program by typing:
  436. X  #
  437. X  # (UNIX version):
  438. X! #     remind -dv test.rem 16 FEB 1991 >& temp 
  439. X  #
  440. X  # (DOS version):
  441. X  #    e2o remind -dv test.rem 16 FEB 1991 > temp
  442. X  #
  443. X! # and comparing the results with test.out.
  444. X  #
  445. X! # The only differences should be the date of last
  446. X! # modification/access
  447. X  
  448. X  # Test each possible case of the basic reminders.
  449. X  
  450. X--- 4,18 ----
  451. X  # of the REMIND program by typing:
  452. X  #
  453. X  # (UNIX version):
  454. X! #     make test
  455. X  #
  456. X  # (DOS version):
  457. X  #    e2o remind -dv test.rem 16 FEB 1991 > temp
  458. X  #
  459. X! #       and compare the results with test.out.
  460. X  #
  461. X! #       The only differences should be the date of last
  462. X! #       modification/access
  463. X  
  464. X  # Test each possible case of the basic reminders.
  465. X
  466. XMake timed.c compile without complaints on sysv5.3  
  467. X*** ../patch3-work/timed.c    Tue Sep 10 10:22:44 1991
  468. X--- ./timed.c    Tue Nov  5 15:43:46 1991
  469. X***************
  470. X*** 167,173 ****
  471. X     unsigned NotSlept;
  472. X  #endif
  473. X  
  474. X!    if (!Foreground) signal(SIGINT, SigIntHandler);
  475. X  
  476. X      /* If we are not connected to a tty, then we must close the
  477. X       * standard file descriptors. This is to prevent someone
  478. X--- 167,173 ----
  479. X     unsigned NotSlept;
  480. X  #endif
  481. X  
  482. X!    if (!Foreground) signal(SIGINT, (void *) SigIntHandler);
  483. X  
  484. X      /* If we are not connected to a tty, then we must close the
  485. X       * standard file descriptors. This is to prevent someone
  486. X***************
  487. X*** 237,243 ****
  488. X     AtEntry *e;
  489. X  
  490. X  #ifdef SYSV
  491. X!    signal(SIGINT, SigIntHandler);
  492. X  #endif
  493. X  
  494. X     printf("Contents of AT queue:%s", NL);
  495. X--- 237,243 ----
  496. X     AtEntry *e;
  497. X  
  498. X  #ifdef SYSV
  499. X!    signal(SIGINT, (void *) SigIntHandler);
  500. X  #endif
  501. X  
  502. X     printf("Contents of AT queue:%s", NL);
  503. SHAR_EOF
  504. $TOUCH -am 1105155791 patch.04 &&
  505. chmod 0600 patch.04 ||
  506. echo "restore of patch.04 failed"
  507. set `wc -c patch.04`;Wc_c=$1
  508. if test "$Wc_c" != "13305"; then
  509.     echo original size 13305, current size $Wc_c
  510. fi
  511. fi
  512. exit 0
  513.   
  514.  
  515.  
  516. exit 0 # Just in case...
  517. -- 
  518. Kent Landfield                   INTERNET: kent@sparky.IMD.Sterling.COM
  519. Sterling Software, IMD           UUCP:     uunet!sparky!kent
  520. Phone:    (402) 291-8300         FAX:      (402) 291-4362
  521. Please send comp.sources.misc-related mail to kent@uunet.uu.net.
  522.