(FILECREATED " 9-Jun-85 23:56:27" {ERIS}<LISPCORE>LIBRARY>SAMEDIR.;3 3189   

      changes to:  (FNS CHECKSAMEDIR)

      previous date: "20-Mar-84 15:52:52" {ERIS}<LISPCORE>LIBRARY>SAMEDIR.;1)


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

(PRETTYCOMPRINT SAMEDIRCOMS)

(RPAQQ SAMEDIRCOMS ((FNS CHECKSAMEDIR HOST&DIRECTORYFIELD)
		    (ADDVARS [MAKEFILEFORMS (OR (NLSETQ (CHECKSAMEDIR FILE))
						(RETFROM (QUOTE MAKEFILE]
			     (MIGRATIONS))
		    (GLOBALVARS MIGRATIONS)))
(DEFINEQ

(CHECKSAMEDIR
  [LAMBDA (FILE)                                             (* lmm " 9-Jun-85 23:26")
    (PROG ((DATES (GETP FILE (QUOTE FILEDATES)))
	   HOST/DIR HOST DIR LST NEWV OKHOST/DIRS)
      AGAIN
          (OR (LISTP DATES)
	      (RETURN))
          [SETQ OKHOST/DIRS (CONS (SETQ HOST/DIR (DIRECTORYNAME T T))
				  (MKLIST (CDR (FASSOC HOST/DIR MIGRATIONS]
          (COND
	    ((for OLDFILE in DATES bind HOST DIR never (FMEMB (HOST&DIRECTORYFIELD (CDR OLDFILE))
							      OKHOST/DIRS))
	      (SELECTQ [ASKUSER 10 (QUOTE Y)
				(LIST (QUOTE "You haven't loaded or written")
				      FILE
				      (QUOTE "in your connected directory")
				      HOST/DIR
				      (QUOTE "-- should I write it out anyway"))
				(BQUOTE ((O , (CONCAT "ops!  Connect to " (SETQ HOST/DIR
							(HOST&DIRECTORYFIELD (CDAR DATES)))
						      " [confirm] ")
					    CONFIRMFLG T)
					 (C "onnect to other directory: ")
					 (Y "es, write it here
")
					 (N "o, abort MAKEFILE
"]
		       (Y (RETURN))
		       (N (ERROR!))
		       (C (SETQ HOST/DIR))
		       (O)
		       (SHOULDNT))
	      [NLSETQ (CNDIR (OR HOST/DIR (READ T T]
	      (GO AGAIN))
	    ((AND [SETQ NEWV (INFILEP (PACKFILENAME (QUOTE VERSION)
						    NIL
						    (QUOTE BODY)
						    (CDAR DATES]
		  (NEQ NEWV (CDAR DATES)))
	      (SELECTQ (ASKUSER 15 (QUOTE Y)
				(LIST (CDAR DATES)
				      "is not the most recent version (version"
				      (MKSTRING (FILENAMEFIELD NEWV (QUOTE VERSION)))
				      "has since appeared)." "Do you want to make the file anyway"))
		       (Y)
		       (N (ERROR!))
		       (SHOULDNT])

(HOST&DIRECTORYFIELD
  [LAMBDA (FILENAME)                                         (* bvm: "20-Mar-84 15:23")
                                                             (* Returns the host&dir fields packed together)
    (for TAIL on (UNPACKFILENAME FILENAME) by (CDDR TAIL) do [COND
							       ((FMEMB (CAR TAIL)
								       (QUOTE (HOST DIRECTORY DEVICE))
								       )
								 (push $$VAL (CAR TAIL)
								       (CADR TAIL]
       finally (RETURN (PACKFILENAME $$VAL])
)

(ADDTOVAR MAKEFILEFORMS (OR (NLSETQ (CHECKSAMEDIR FILE))
			    (RETFROM (QUOTE MAKEFILE))))

(ADDTOVAR MIGRATIONS )
(DECLARE: DOEVAL@COMPILE DONTCOPY

(GLOBALVARS MIGRATIONS)
)
(PUTPROPS SAMEDIR COPYRIGHT ("Xerox Corporation" 1982 1984 1985))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (524 2914 (CHECKSAMEDIR 534 . 2389) (HOST&DIRECTORYFIELD 2391 . 2912)))))
STOP