#| -*-Scheme-*-
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/infutl.scm,v 1.39 1992/05/28 18:58:44 mhwu Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/infutl.scm,v 1.40 1992/05/28 22:41:02 mhwu Exp $
Copyright (c) 1988-91 Massachusetts Institute of Technology
(define (process-binf-filename binf-filename com-pathname)
(and binf-filename
- (->namestring
- (rewrite-directory
- (let ((binf-pathname (merge-pathnames binf-filename))
- (com-pathname (merge-pathnames com-pathname)))
- (if (and (equal? (pathname-name binf-pathname)
- (pathname-name com-pathname))
- (not (equal? (pathname-type binf-pathname)
- (pathname-type com-pathname)))
- (equal? (pathname-version binf-pathname)
- (pathname-version com-pathname)))
- (pathname-new-type com-pathname (pathname-type binf-pathname))
- binf-pathname))))))
+ (rewrite-directory
+ (let ((binf-pathname (merge-pathnames binf-filename))
+ (com-pathname (merge-pathnames com-pathname)))
+ (if (and (equal? (pathname-name binf-pathname)
+ (pathname-name com-pathname))
+ (not (equal? (pathname-type binf-pathname)
+ (pathname-type com-pathname)))
+ (equal? (pathname-version binf-pathname)
+ (pathname-version com-pathname)))
+ (pathname-new-type com-pathname (pathname-type binf-pathname))
+ binf-pathname)))))
(define directory-rewriting-rules
'())
(define (add-directory-rewriting-rule! match replace)
- (let ((match (merge-pathnames match)))
+ (let ((match (pathname-as-directory (merge-pathnames match))))
(let ((rule
(list-search-positive directory-rewriting-rules
(lambda (rule)
(lambda (rule)
(directory-prefix? (pathname-directory pathname)
(pathname-directory (car rule)))))))
- (if rule
- (let ((replacement-directory (merge-pathnames (cdr rule))))
- (pathname-new-device
- (pathname-new-directory
+ (->namestring
+ (if rule
+ (let ((replacement (cdr rule))
+ (remaining-directories
+ (list-tail (pathname-directory pathname)
+ (length (pathname-directory (car rule))))))
+ ;; Moby kludge: we are going to fool the pathname abstraction
+ ;; into giving us a namestring that might contain uncanonicalized
+ ;; characters in them. This will break if the pathname abstraction
+ ;; cares at all.
+ (pathname-new-directory
pathname
- (append (pathname-directory replacement-directory)
- (list-tail (pathname-directory pathname)
- (length (pathname-directory (car rule))))))
- (pathname-device replacement-directory)))
- pathname)))
+ `(relative ,replacement ,@remaining-directories)))
+ pathanme))))
(define (directory-prefix? x y)
(and (pair? x)
false)))
(define (read-bsm-file name)
- (let ((filename (process-bsym-filename name)))
- (if (file-exists? filename)
- (fasload-loader filename)
- (let ((pathname (merge-pathnames filename)))
- (find-alternate-file-type pathname
- `(("bsm" . ,fasload-loader)
- ("bcs" . ,compressed-loader)))))))
+ (let ((pathname (merge-pathnames (process-bsym-filename name))))
+ (if (file-exists? pathname)
+ (fasload-loader pathname)
+ (find-alternate-file-type pathname
+ `(("bsm" . ,fasload-loader)
+ ("bcs" . ,compressed-loader))))))
(define (process-bsym-filename name)
- (->namestring
- (rewrite-directory (merge-pathnames name))))
+ (rewrite-directory (merge-pathnames name)))
\f;;; The conversion hack.
#| -*-Scheme-*-
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/site.scm.dos,v 1.4 1992/05/28 18:46:41 mhwu Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/site.scm.dos,v 1.5 1992/05/28 22:43:20 mhwu Exp $
Copyright (c) 1988-1992 Massachusetts Institute of Technology
(->environment '(runtime compiler-info)))))
(for-each
(lambda (path)
- (add-directory-rewriting-rule! path "$mitscheme_inf_directory/"))
- '("/scheme/")))
-
-(set-environment-variable! "mitscheme_inf_directory" "c:/scheme") ; default
+ (add-directory-rewriting-rule! path "$mitscheme_inf_directory"))
+ '("/scheme")))
;;; Dos specific:
;;; Timer hook to get interrupt keys
#| -*-Scheme-*-
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/site.scm.unix,v 1.8 1992/03/03 23:24:39 jinx Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/site.scm.unix,v 1.9 1992/05/28 22:42:48 mhwu Exp $
Copyright (c) 1988-1992 Massachusetts Institute of Technology
(->environment '(runtime compiler-info)))))
(for-each
(lambda (path)
- (add-directory-rewriting-rule! path "/usr/local/lib/mit-scheme/SRC/"))
- '("/scheme/300/"
- "/altdorf/scheme/300/"
- "/nfs/altdorf/root/scheme/300/"
- "/scheme/800/"
- "/altdorf/scheme/800"
- "/nfs/altdorf/root/scheme/800/"
- "/scheme/700/"
+ (add-directory-rewriting-rule! path "/usr/local/lib/mit-scheme/SRC"))
+ '("/scheme/300"
+ "/altdorf/scheme/300"
+ "/nfs/altdorf/root/scheme/300"
+ "/scheme/700"
"/altdorf/scheme/700"
- "/nfs/altdorf/root/scheme/700/"
- "/scheme/SONY/"
- "/nfs/altdorf/root/scheme/SONY/")))
\ No newline at end of file
+ "/nfs/altdorf/root/scheme/700"
+ "/scheme/SONY"
+ "/nfs/altdorf/root/scheme/SONY"
+ )
+ ))
#| -*-Scheme-*-
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/runtime/infutl.scm,v 1.39 1992/05/28 18:58:44 mhwu Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/runtime/infutl.scm,v 1.40 1992/05/28 22:41:02 mhwu Exp $
Copyright (c) 1988-91 Massachusetts Institute of Technology
(define (process-binf-filename binf-filename com-pathname)
(and binf-filename
- (->namestring
- (rewrite-directory
- (let ((binf-pathname (merge-pathnames binf-filename))
- (com-pathname (merge-pathnames com-pathname)))
- (if (and (equal? (pathname-name binf-pathname)
- (pathname-name com-pathname))
- (not (equal? (pathname-type binf-pathname)
- (pathname-type com-pathname)))
- (equal? (pathname-version binf-pathname)
- (pathname-version com-pathname)))
- (pathname-new-type com-pathname (pathname-type binf-pathname))
- binf-pathname))))))
+ (rewrite-directory
+ (let ((binf-pathname (merge-pathnames binf-filename))
+ (com-pathname (merge-pathnames com-pathname)))
+ (if (and (equal? (pathname-name binf-pathname)
+ (pathname-name com-pathname))
+ (not (equal? (pathname-type binf-pathname)
+ (pathname-type com-pathname)))
+ (equal? (pathname-version binf-pathname)
+ (pathname-version com-pathname)))
+ (pathname-new-type com-pathname (pathname-type binf-pathname))
+ binf-pathname)))))
(define directory-rewriting-rules
'())
(define (add-directory-rewriting-rule! match replace)
- (let ((match (merge-pathnames match)))
+ (let ((match (pathname-as-directory (merge-pathnames match))))
(let ((rule
(list-search-positive directory-rewriting-rules
(lambda (rule)
(lambda (rule)
(directory-prefix? (pathname-directory pathname)
(pathname-directory (car rule)))))))
- (if rule
- (let ((replacement-directory (merge-pathnames (cdr rule))))
- (pathname-new-device
- (pathname-new-directory
+ (->namestring
+ (if rule
+ (let ((replacement (cdr rule))
+ (remaining-directories
+ (list-tail (pathname-directory pathname)
+ (length (pathname-directory (car rule))))))
+ ;; Moby kludge: we are going to fool the pathname abstraction
+ ;; into giving us a namestring that might contain uncanonicalized
+ ;; characters in them. This will break if the pathname abstraction
+ ;; cares at all.
+ (pathname-new-directory
pathname
- (append (pathname-directory replacement-directory)
- (list-tail (pathname-directory pathname)
- (length (pathname-directory (car rule))))))
- (pathname-device replacement-directory)))
- pathname)))
+ `(relative ,replacement ,@remaining-directories)))
+ pathanme))))
(define (directory-prefix? x y)
(and (pair? x)
false)))
(define (read-bsm-file name)
- (let ((filename (process-bsym-filename name)))
- (if (file-exists? filename)
- (fasload-loader filename)
- (let ((pathname (merge-pathnames filename)))
- (find-alternate-file-type pathname
- `(("bsm" . ,fasload-loader)
- ("bcs" . ,compressed-loader)))))))
+ (let ((pathname (merge-pathnames (process-bsym-filename name))))
+ (if (file-exists? pathname)
+ (fasload-loader pathname)
+ (find-alternate-file-type pathname
+ `(("bsm" . ,fasload-loader)
+ ("bcs" . ,compressed-loader))))))
(define (process-bsym-filename name)
- (->namestring
- (rewrite-directory (merge-pathnames name))))
+ (rewrite-directory (merge-pathnames name)))
\f;;; The conversion hack.