(FILECREATED " 1-Apr-86 16:13:07" {ERIS}<JAMES>LISP>ARCLEANUP.;1 7657   

      changes to:  (VARS ARCLEANUPCOMS)

      previous date: "21-Mar-86 15:11:16" {ERIS}<LISP>KOTO>LIBRARY>ARCLEANUP.;5)


(* Copyright (c) 1984, 1985, 1986 by Xerox Corporation. All rights reserved.)

(PRETTYCOMPRINT ARCLEANUPCOMS)

(RPAQQ ARCLEANUPCOMS [(FNS AR.CLEANUP AR.GET.NUMS.FROM.TDS AR.PRINT.AND.IP.FILE)
	(FILES AREDIT)
	(INITVARS (AR.CLEANUP.HACKER.NAMES (QUOTE (Bane Blum Burton Charnley Common-Lisp Cude Daniels 
							Fischer Herring James Jellinek JFung Kaplan 
							Krivacic Lichtenberg Loops Masinter Mueller 
							Murage Nuyens Pavel Pedersen Prolog Purcell 
							Raim Rhoades Roach Sannella Santosa Schoen 
							Shih Sybalsky vanMelle Weisblatt Wessling 
							Wozencraft])
(DEFINEQ

(AR.CLEANUP
  [LAMBDA (UPDATE.FLG INDEX.LOCAL.DIR SUMMARY.FLG SUMMARY.LOCAL.DIR)
                                                             (* mjs "10-Jun-85 17:01")
    (PROG ((LOCAL.AR.INDEX.NAME (if INDEX.LOCAL.DIR
				    then (PACK* INDEX.LOCAL.DIR (QUOTE AR.INDEX))
				  else NIL))
	   INDEX.WINDOW)
          (if LOCAL.AR.INDEX.NAME
	      then (printout T "copying old AR index to " LOCAL.AR.INDEX.NAME "...")
		   (COPYFILE AR.INDEX.DEFAULT.FILE.NAME LOCAL.AR.INDEX.NAME)
		   (printout T "done" T))
          [if UPDATE.FLG
	      then (PROG ((SAVED.TDS.NAME (PACK* AR.INFO.FILE.NAME (QUOTE -PROCESSED)))
			  NUMBERS INDEX.WINDOW)
		         (if (NOT (INFILEP AR.INFO.FILE.NAME))
			     then (printout T "No TDS file --- AR update aborted" T)
				  (RETURN))
		         (until (NLSETQ (RENAMEFILE AR.INFO.FILE.NAME SAVED.TDS.NAME))
			    do (printout T "Can't rename TDS file --- trying again" T)
			       (BLOCK 5000))
		         (SETQ NUMBERS (AR.GET.NUMS.FROM.TDS SAVED.TDS.NAME))
		         (SETQ NUMBERS (SORT (INTERSECTION NUMBERS NUMBERS)))
		         (if (NULL NUMBERS)
			     then (printout T "No numbers found in TDS file --- AR update aborted" T)
				  (RETURN))
		         (printout T "Will update AR numbers:" T NUMBERS T)

          (* * update AR index)


		         (SETQ INDEX.WINDOW (CREATEW (CREATEREGION 660 100 350 132)
						     "old index"))
		         (AR.QFORM.GROUP.CREATE (if LOCAL.AR.INDEX.NAME
						  else AR.INDEX.DEFAULT.FILE.NAME)
						INDEX.WINDOW)
		         (printout T "updating AR index....")
		         (AR.INDEX.UPDATE INDEX.WINDOW NUMBERS)
		         (CLOSEW INDEX.WINDOW)
		         (printout T "done" T)
		         (if LOCAL.AR.INDEX.NAME
			     then (printout T "deleting old AR index from " LOCAL.AR.INDEX.NAME "...")
				  (DELFILE LOCAL.AR.INDEX.NAME)
				  (printout T "done" T)
				  (printout T "copying new index to file server...")
				  (COPYFILE LOCAL.AR.INDEX.NAME AR.INDEX.DEFAULT.FILE.NAME)
				  (printout T "done" T]
          (SETQ INDEX.WINDOW (CREATEW (CREATEREGION 660 100 350 132)))
          (AR.QFORM.GROUP.CREATE (if LOCAL.AR.INDEX.NAME
				   else AR.INDEX.DEFAULT.FILE.NAME)
				 INDEX.WINDOW)               (* make main unsorted summary)
          (if (NULL SUMMARY.FLG)
	      then (RETURN))                                 (* print summaries for each person)
                                                             (* make report for LispCore↑)
          (AR.QUERY INDEX.WINDOW (QUOTE (Attn: HAS LISP)))
          (AR.SORT INDEX.WINDOW (QUOTE (System: Subsystem: Status: Priority: Impact:)))
          (AR.PRINT.AND.IP.FILE INDEX.WINDOW (QUOTE LispSummary)
				SUMMARY.LOCAL.DIR)           (* make report for Release)
          [AR.QUERY INDEX.WINDOW (QUOTE (OR (Status: IS Fixed)
					    (Attn: HAS release]
          (AR.SORT INDEX.WINDOW (QUOTE (System: Subsystem: Status: Priority: Impact:)))
          (AR.PRINT.AND.IP.FILE INDEX.WINDOW (QUOTE ReleaseSummary)
				SUMMARY.LOCAL.DIR)           (* make Action Item report)
          [AR.QUERY INDEX.WINDOW (QUOTE (AND (OR (Status: IS Open)
						 (Status: IS Fixed))
					     (OR (Priority: IS Absolutely)
						 (Priority: IS Hopefully))
					     (OR (Impact: IS Fatal)
						 (Impact: IS Serious]
          (AR.SORT INDEX.WINDOW (QUOTE (Status: Priority: Impact:)))
          (AR.PRINT.AND.IP.FILE INDEX.WINDOW (QUOTE ActionItemSummary)
				SUMMARY.LOCAL.DIR)
          (for HACKER.NAME in AR.CLEANUP.HACKER.NAMES bind SEARCH.NAME
	     do (SETQ SEARCH.NAME (SUBSTRING HACKER.NAME 1 4))
		(AR.QUERY INDEX.WINDOW (LIST (QUOTE Attn:)
					     (QUOTE HAS)
					     SEARCH.NAME))
		(AR.SORT INDEX.WINDOW (QUOTE (System: Subsystem: Status: Priority: Impact:)))
		(AR.PRINT.AND.IP.FILE INDEX.WINDOW (PACK* HACKER.NAME (QUOTE Summary))
				      SUMMARY.LOCAL.DIR])

(AR.GET.NUMS.FROM.TDS
  [LAMBDA (FILENAME)                                         (* edited: "30-Aug-84 11:48")
    (PROG ((FILE (OPENSTREAM FILENAME (QUOTE INPUT)
			     (QUOTE OLD)))
	   NUMBERS)
          (SETQ NUMBERS (while (FILEPOS "  --  (" FILE NIL NIL NIL T) bind NUM?
			   when [NUMBERP (SETQ NUM? (PROGN (READ FILE)
							   (READ FILE]
			   collect NUM?))
          (CLOSEF FILE)
          (RETURN NUMBERS])

(AR.PRINT.AND.IP.FILE
  [LAMBDA (QFORM FILENAME SUMMARY.LOCAL.DIR)                 (* mjs "11-Jun-85 10:05")
    (PROG ((LOCALTXTFILE (PACK* SUMMARY.LOCAL.DIR FILENAME (QUOTE .TXT)))
	   (REMOTETXTFILE (PACK* AR.DIRECTORY FILENAME (QUOTE .TXT)))
	   (LOCALIPFILE (PACK* SUMMARY.LOCAL.DIR FILENAME (QUOTE .IP)))
	   (REMOTEIPFILE (PACK* AR.DIRECTORY FILENAME (QUOTE .IP)))
	   PRINTSTREAM)
          (if (NULL SUMMARY.LOCAL.DIR)
	      then (SETQ LOCALTXTFILE REMOTETXTFILE)
		   (SETQ LOCALIPFILE REMOTEIPFILE))
          (printout T "Generating summary file: " FILENAME "... ")
          (SETQ PRINTSTREAM (OPENSTREAM LOCALTXTFILE (QUOTE OUTPUT)
					(QUOTE NEW)))
          (AR.PRINT QFORM PRINTSTREAM)
          (CLOSEF PRINTSTREAM)
          (if SUMMARY.LOCAL.DIR
	      then (printout T "copying... ")
		   (COPYFILE LOCALTXTFILE REMOTETXTFILE))
          (printout T "Creating Interpress file... ")
          (PROG (TXT IP)
	        (SETQ TXT (OPENSTREAM LOCALTXTFILE (QUOTE INPUT)
				      (QUOTE OLD)))
	        [SETQ IP (OPENIMAGESTREAM LOCALIPFILE (QUOTE INTERPRESS)
					  (QUOTE (LANDSCAPE T]
	        (DSPFONT (QUOTE (TERMINAL 6))
			 IP)
	        (for I from 1 to (GETFILEINFO TXT (QUOTE LENGTH)) do (\OUTCHAR IP (\BIN TXT)))
	        (CLOSEF IP)
	        (CLOSEF TXT))
          (if SUMMARY.LOCAL.DIR
	      then (printout T "copying... ")
		   (COPYFILE LOCALIPFILE REMOTEIPFILE)
		   (DELFILE LOCALTXTFILE)
		   (DELFILE LOCALIPFILE))
          (printout T "done" T])
)
(FILESLOAD AREDIT)

(RPAQ? AR.CLEANUP.HACKER.NAMES (QUOTE (Bane Blum Burton Charnley Common-Lisp Cude Daniels Fischer 
					      Herring James Jellinek JFung Kaplan Krivacic 
					      Lichtenberg Loops Masinter Mueller Murage Nuyens Pavel 
					      Pedersen Prolog Purcell Raim Rhoades Roach Sannella 
					      Santosa Schoen Shih Sybalsky vanMelle Weisblatt 
					      Wessling Wozencraft)))
(PUTPROPS ARCLEANUP COPYRIGHT ("Xerox Corporation" 1984 1985 1986))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (789 7162 (AR.CLEANUP 799 . 5019) (AR.GET.NUMS.FROM.TDS 5021 . 5469) (
AR.PRINT.AND.IP.FILE 5471 . 7160)))))
STOP