;;; -*- Mode:LISP; Package:USER; Base:10; READTABLE:CL -*-

;;;Define FALCON logical host for Falcon software:
;;;
;;;$$$Modified (by almost unamimous request) to parameterize the release
;;;hierarchy.  Loading this file will ask you what hierarchy on the
;;;physical host you want; the default can be taken by pressing <return>
;;;or waiting for the query to time out.  <keith 31oct88>

(defparameter *falcon-host* "JB")

(defparameter *falcon-source-release* "K")

(defun switch-k-release (&optional source-release source-host (timeout 2.))
  "Redefine the FALCON logical host to point to directory SOURCE-RELEASE 
  on physical host SOURCE-HOST.
Default values for SOURCE-RELEASE and SOURCE-HOST are taken from the current values
  of *FALCON-HOST* and *FALCON-SOURCE-RELEASE*, respectively, after TIMEOUT minutes."
  (setq *falcon-host*
	(si:parse-host
	  (or source-host
	      (with-timeout ((* 60. 60. timeout))
		(prompt-and-read
		  :string-or-nil
		  "~&Falcon system host (defaults to ~A after ~D. minutes) > "
		  *falcon-host* timeout))
	      *falcon-host*)))
  (setq  *falcon-source-release*
	 (or source-release
	     (with-timeout ((* 60. 60. timeout))
	       (prompt-and-read
		 :string-or-nil
		 "~&Falcon source release (defaults to ~S after ~D. minutes) > "
		 *falcon-source-release* timeout))
	     *falcon-source-release*))
  (format t "~&Setting Falcon release hierarchy to ~:@(~A:~A;~)" *falcon-host* *falcon-source-release*)
  (fs:set-logical-pathname-host "FALCON"
    :physical-host *falcon-host*
    :nicknames '("K-SYS")
    :translations
    (loop for translist in 
	  `(("K;"           "<~A>")
	    ("k.*;"         "<~A.*>")
	    ("k.*.*;"       "<~A.*.*>")
	    ("kbug;"        "<~A.kbug>")
	    ("kbug2;"       "<~A.kbug2>")
	    ("kdoc;"        "<~A.kdoc>")
	    ("kdoc.*;"      "<~A.kdoc.*>")
	    ("kdoc.*.*;"    "<~A.kdoc.*.*>")
	    ("fleabit;"     "<~A.fleabit>")
	    ("fleabit.*;"   "<~A.fleabit.*>")
	    ("fleabit.*.*;" "<~A.fleabit.*.*>")
	    ("compiler"     "<~A.compiler>")
	    ("bus-coupler"  "<~A.bus-coupler>")
	    ("cold"         "<~A.cold>")
	    ("warm"         "<~A.warm>")
	    ("hot"          "<~A.hot>")
	    ("NCOLD"	    "<~A.NCOLD>"))
	  as trans  = (first translist)
	  as real = (second translist)
	  collect (list trans (format nil real *falcon-source-release*))))
    (si:describe-host "FALCON"))

(switch-k-release)

;;;FALCON documentation directories:

(fs:set-logical-pathname-host "FALCON-DOCS"
  :physical-host "JB"
  :translations '(("KWARE;*.botex" "JB:KDOC.falcon;*.botex")
		  ("KWARE;*.dvi" "BRAHMS:SAZ;RELEASED-MANUALS;*.dvi")
		  ("*" "JB:KDOC.FALCON;*.botex")))
