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:
parent
ba5cdcf6fb
commit
8dfdf2c868
10
RELEASE
10
RELEASE
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
|
42
scsh/top.scm
42
scsh/top.scm
|
@ -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,17 +490,18 @@
|
|||
|
||||
;;; Parse up the $SCSH_LIB_DIRS path list.
|
||||
(define (parse-lib-dirs-env-var)
|
||||
(let ((s (getenv "SCSH_LIB_DIRS")))
|
||||
(if (not s) default-lib-dirs
|
||||
(map resolve-file-name
|
||||
(let ((s (getenv "SCSH_LIB_DIRS")))
|
||||
(if (not s) default-lib-dirs
|
||||
|
||||
(with-current-input-port (make-string-input-port s)
|
||||
(let recur ()
|
||||
(let ((val (read)))
|
||||
(cond ((eof-object? val) '())
|
||||
((string? val) (cons val (recur)))
|
||||
((not val) (append default-lib-dirs (recur)))
|
||||
(else (error "Illegal path element in $SCSH_LIB_DIRS"
|
||||
s val)))))))))
|
||||
(with-current-input-port (make-string-input-port s)
|
||||
(let recur ()
|
||||
(let ((val (read)))
|
||||
(cond ((eof-object? val) '())
|
||||
((string? val) (cons val (recur)))
|
||||
((not val) (append default-lib-dirs (recur)))
|
||||
(else (error "Illegal path element in $SCSH_LIB_DIRS"
|
||||
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.
|
||||
|
|
Loading…
Reference in New Issue