projects
/
rrq
/
newlisp
/
packnl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
235b4a0
)
implemented -C option
author
Ralph Ronnquist
<ralph.ronnquist@gmail.com>
Sat, 18 Dec 2021 01:23:59 +0000
(12:23 +1100)
committer
Ralph Ronnquist
<ralph.ronnquist@gmail.com>
Sat, 18 Dec 2021 01:23:59 +0000
(12:23 +1100)
packnl.lsp
patch
|
blob
|
history
diff --git
a/packnl.lsp
b/packnl.lsp
index 333d54e24dbf6b8ef196f102ef7f6fa7b7ab6203..d8adb2ea947258a04cf207b7f208e14dc55b37d6 100644
(file)
--- a/
packnl.lsp
+++ b/
packnl.lsp
@@
-2,7
+2,7
@@
;; binary, which is an embedded newlisp binary with the same embedding
;; script as binnl itself.
;;
;; binary, which is an embedded newlisp binary with the same embedding
;; script as binnl itself.
;;
-;; Usage: [ -r ] binary (
-a archive | membe
r )*
+;; Usage: [ -r ] binary (
member | -a archive | -C di
r )*
;;
;; The script processes the arguments from left to right to form then
;; named binary with the named members appended.
;;
;; The script processes the arguments from left to right to form then
;; named binary with the named members appended.
@@
-13,6
+13,8
@@
;; Use '-A archive' to embed all members of the nominated ar style
;; archive.
;;
;; Use '-A archive' to embed all members of the nominated ar style
;; archive.
;;
+;; Use '-C dir' to change source directory
+;;
;; Use '-r' to overwrite an existing binary
;; The first embedded member will be the "main script".
;; Use '-r' to overwrite an existing binary
;; The first embedded member will be the "main script".
@@
-39,16
+41,26
@@
(if (= A "-A") (dolist (M MEMBERS) (compile-file M)))))
(define (compile BINARY MEMBERS)
(if (= A "-A") (dolist (M MEMBERS) (compile-file M)))))
(define (compile BINARY MEMBERS)
+ (unless (starts-with BINARY "/")
+ (setf BINARY (format "%s/%s" (real-path) BINARY)))
(write-file BINARY (0 archive:incore core)) ; includes the marker
(exec (format "chmod a+x %s" BINARY))
(write-file BINARY (0 archive:incore core)) ; includes the marker
(exec (format "chmod a+x %s" BINARY))
- (let ((A nil))
+ (let ((A nil)
(C nil)
)
(dolist (M MEMBERS)
;;(write-line 1 (string "[" M "]" (archives)))
(case M
("-a" (setf A "-a"))
("-A" (setf A "-A"))
(dolist (M MEMBERS)
;;(write-line 1 (string "[" M "]" (archives)))
(case M
("-a" (setf A "-a"))
("-A" (setf A "-A"))
- (true (if A (compile-ar A M) (compile-file M))
- (setf A nil))))
+ ("-C" (setf C "-C"))
+ (true (if A (compile-ar A M)
+ C (unless (change-dir M)
+ (write-line 2 (string "** directory is " (real-path)))
+ (write-line 2 (string "Cannot change to " M))
+ (exit 1))
+ (compile-file M))
+ (setf A nil)
+ (setf C nil)
+ )))
))
(define (decompile BINARY DIR)
))
(define (decompile BINARY DIR)