Added -lel switch. There is currently no way to deal with relative

file names in the exec scripts so this might just get removed again.
This commit is contained in:
mainzelm 2003-11-13 14:44:40 +00:00
parent ba5cdcf6fb
commit 8dfdf2c868
3 changed files with 43 additions and 16 deletions

10
RELEASE
View File

@ -25,6 +25,8 @@ New in this release
./configure option to set default scsh library directories
Support for DESTDIR for easier packaging
New SRFI
Switch to load exec scripts from library path
Removed scheme/infix/
Bug fixes
API changes
New in 0.6.4
@ -190,6 +192,14 @@ We manage the project using SourceForge:
** New SRFI
This release adds support for SRFI 42.
** Switch to load exec scripts from library path
The new switch -lel searches the library path for a file and loads
the file into the exec package.
** Removed scheme/infix/
The directory scheme/infix/ had a non-free copyright licence and
has been removed.
** Bug fixes
- SEEK currently works on unbuffered ports only. Check this in the
implementation and oopsify it in the manual.

View File

@ -214,6 +214,8 @@ where
& \ex{-ll} \var{module-file-name}
& As in -lm, but search the library path list.\\
& \ex{-lel} \var{exec-file-name}
& As in -le, but search the library path list.\\
& \ex{+lp} \var{dir}
& Add dir to front of library path list.\\
& \ex{lp+} \var{dir}
@ -455,6 +457,11 @@ SCSH_LIB_DIRS='"." "/usr/contrib/lib/scsh/" #f "/home/shivers/lib/scsh"'
Directory search can be recursive. A directory name that ends
with a slash is recursively searched.
\Item{-lel \var{exec-file-name}}
As above, but load the specified file into scsh's exec package.
This is just like the \ex{-le} switch, except that it searches the
library-directory path list for the file to load.
\Item{+lp \var{lib-dir},lp+ \var{lib-dir}}
Add directory \var{lib-dir} to the beginning or end of the
\textit{library-directories} path list, respectively.

View File

@ -60,6 +60,7 @@
;;; -lm <file> Load <file> into config package.
;;; -le <file> Load <file> into exec package.
;;; -ll <file> As in -lm, but search the library path list.
;;; -lel <file> As in -le, but search the library path list.
;;;
;;; +lp <dir> Add <dir> onto start of library path list.
;;; lp+ <dir> Add <dir> onto end of library path list.
@ -147,6 +148,7 @@
(string=? arg "-lm")
(string=? arg "-le")
(string=? arg "-ll")
(string=? arg "-lel")
(string=? arg "lp+")
(string=? arg "+lp")
(string=? arg "lpe+")
@ -256,7 +258,13 @@
(lp switches script-loaded?))
((string=? (car switch) "-ll")
(load-library-file (cdr switch) (mod-dirs) script-file)
(load-library-file (cdr switch) (mod-dirs) script-file
(config-package))
(lp switches script-loaded?))
((string=? (car switch) "-lel")
(load-library-file (cdr switch) (mod-dirs) script-file
(user-command-environment))
(lp switches script-loaded?))
((string=? (car switch) "+lp")
@ -417,17 +425,17 @@
(add-narrowed-exit-hook! flush-all-ports-no-threads)
(define (load-library-file file lib-dirs script-file)
(define (load-library-file file lib-dirs script-file package)
; (format (error-output-port) "Load-library-file: ~a ~s\n" file lib-dirs)
(cond ((file-name-absolute? file)
(load-quietly file (config-package)))
(load-quietly file package))
;; Search library dirs for FILE.
((find-library-file file lib-dirs script-file) =>
(lambda (iport)
(load-quietly iport (config-package)))) ; Load it.
(lambda (file)
(load-quietly file package))) ; Load it.
(else (error "Couldn't find library module file" file lib-dirs))))
(else (error "Couldn't find library file" file lib-dirs))))
;;; Search library dirs for FILE.
(define (find-library-file file lib-dirs script-file)
@ -482,6 +490,7 @@
;;; Parse up the $SCSH_LIB_DIRS path list.
(define (parse-lib-dirs-env-var)
(map resolve-file-name
(let ((s (getenv "SCSH_LIB_DIRS")))
(if (not s) default-lib-dirs
@ -492,7 +501,7 @@
((string? val) (cons val (recur)))
((not val) (append default-lib-dirs (recur)))
(else (error "Illegal path element in $SCSH_LIB_DIRS"
s val)))))))))
s val))))))))))
(define (bad-arg . msg)
(with-current-output-port (current-error-port)
@ -513,6 +522,7 @@ switch: -e <entry-point> Specify top-level entry point.
-l <file-name> Load file into current package.
-ll <module-file-name> As in -lm, but search the library path list.
-lel <exec-file-name> As in -le, but search the library path list.
+lp <dir> Add <dir> to front of library path list.
lp+ <dir> Add <dir> to end of library path list.
+lpe <dir> +lp, with env var and ~user expansion.