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
|
./configure option to set default scsh library directories
|
||||||
Support for DESTDIR for easier packaging
|
Support for DESTDIR for easier packaging
|
||||||
New SRFI
|
New SRFI
|
||||||
|
Switch to load exec scripts from library path
|
||||||
|
Removed scheme/infix/
|
||||||
Bug fixes
|
Bug fixes
|
||||||
API changes
|
API changes
|
||||||
New in 0.6.4
|
New in 0.6.4
|
||||||
|
@ -190,6 +192,14 @@ We manage the project using SourceForge:
|
||||||
** New SRFI
|
** New SRFI
|
||||||
This release adds support for SRFI 42.
|
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
|
** Bug fixes
|
||||||
- SEEK currently works on unbuffered ports only. Check this in the
|
- SEEK currently works on unbuffered ports only. Check this in the
|
||||||
implementation and oopsify it in the manual.
|
implementation and oopsify it in the manual.
|
||||||
|
|
|
@ -214,6 +214,8 @@ where
|
||||||
|
|
||||||
& \ex{-ll} \var{module-file-name}
|
& \ex{-ll} \var{module-file-name}
|
||||||
& As in -lm, but search the library path list.\\
|
& 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}
|
& \ex{+lp} \var{dir}
|
||||||
& Add dir to front of library path list.\\
|
& Add dir to front of library path list.\\
|
||||||
& \ex{lp+} \var{dir}
|
& \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
|
Directory search can be recursive. A directory name that ends
|
||||||
with a slash is recursively searched.
|
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}}
|
\Item{+lp \var{lib-dir},lp+ \var{lib-dir}}
|
||||||
Add directory \var{lib-dir} to the beginning or end of the
|
Add directory \var{lib-dir} to the beginning or end of the
|
||||||
\textit{library-directories} path list, respectively.
|
\textit{library-directories} path list, respectively.
|
||||||
|
|
24
scsh/top.scm
24
scsh/top.scm
|
@ -60,6 +60,7 @@
|
||||||
;;; -lm <file> Load <file> into config package.
|
;;; -lm <file> Load <file> into config package.
|
||||||
;;; -le <file> Load <file> into exec package.
|
;;; -le <file> Load <file> into exec package.
|
||||||
;;; -ll <file> As in -lm, but search the library path list.
|
;;; -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 start of library path list.
|
||||||
;;; lp+ <dir> Add <dir> onto end of library path list.
|
;;; lp+ <dir> Add <dir> onto end of library path list.
|
||||||
|
@ -147,6 +148,7 @@
|
||||||
(string=? arg "-lm")
|
(string=? arg "-lm")
|
||||||
(string=? arg "-le")
|
(string=? arg "-le")
|
||||||
(string=? arg "-ll")
|
(string=? arg "-ll")
|
||||||
|
(string=? arg "-lel")
|
||||||
(string=? arg "lp+")
|
(string=? arg "lp+")
|
||||||
(string=? arg "+lp")
|
(string=? arg "+lp")
|
||||||
(string=? arg "lpe+")
|
(string=? arg "lpe+")
|
||||||
|
@ -256,7 +258,13 @@
|
||||||
(lp switches script-loaded?))
|
(lp switches script-loaded?))
|
||||||
|
|
||||||
((string=? (car switch) "-ll")
|
((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?))
|
(lp switches script-loaded?))
|
||||||
|
|
||||||
((string=? (car switch) "+lp")
|
((string=? (car switch) "+lp")
|
||||||
|
@ -417,17 +425,17 @@
|
||||||
|
|
||||||
(add-narrowed-exit-hook! flush-all-ports-no-threads)
|
(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)
|
; (format (error-output-port) "Load-library-file: ~a ~s\n" file lib-dirs)
|
||||||
(cond ((file-name-absolute? file)
|
(cond ((file-name-absolute? file)
|
||||||
(load-quietly file (config-package)))
|
(load-quietly file package))
|
||||||
|
|
||||||
;; Search library dirs for FILE.
|
;; Search library dirs for FILE.
|
||||||
((find-library-file file lib-dirs script-file) =>
|
((find-library-file file lib-dirs script-file) =>
|
||||||
(lambda (iport)
|
(lambda (file)
|
||||||
(load-quietly iport (config-package)))) ; Load it.
|
(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.
|
;;; Search library dirs for FILE.
|
||||||
(define (find-library-file file lib-dirs script-file)
|
(define (find-library-file file lib-dirs script-file)
|
||||||
|
@ -482,6 +490,7 @@
|
||||||
|
|
||||||
;;; Parse up the $SCSH_LIB_DIRS path list.
|
;;; Parse up the $SCSH_LIB_DIRS path list.
|
||||||
(define (parse-lib-dirs-env-var)
|
(define (parse-lib-dirs-env-var)
|
||||||
|
(map resolve-file-name
|
||||||
(let ((s (getenv "SCSH_LIB_DIRS")))
|
(let ((s (getenv "SCSH_LIB_DIRS")))
|
||||||
(if (not s) default-lib-dirs
|
(if (not s) default-lib-dirs
|
||||||
|
|
||||||
|
@ -492,7 +501,7 @@
|
||||||
((string? val) (cons val (recur)))
|
((string? val) (cons val (recur)))
|
||||||
((not val) (append default-lib-dirs (recur)))
|
((not val) (append default-lib-dirs (recur)))
|
||||||
(else (error "Illegal path element in $SCSH_LIB_DIRS"
|
(else (error "Illegal path element in $SCSH_LIB_DIRS"
|
||||||
s val)))))))))
|
s val))))))))))
|
||||||
|
|
||||||
(define (bad-arg . msg)
|
(define (bad-arg . msg)
|
||||||
(with-current-output-port (current-error-port)
|
(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.
|
-l <file-name> Load file into current package.
|
||||||
|
|
||||||
-ll <module-file-name> As in -lm, but search the library path list.
|
-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 front of library path list.
|
||||||
lp+ <dir> Add <dir> to end of library path list.
|
lp+ <dir> Add <dir> to end of library path list.
|
||||||
+lpe <dir> +lp, with env var and ~user expansion.
|
+lpe <dir> +lp, with env var and ~user expansion.
|
||||||
|
|
Loading…
Reference in New Issue