~ chicken-core (chicken-5) 036a17b4164848ff3048039c63e50fa91ecee14b
commit 036a17b4164848ff3048039c63e50fa91ecee14b
Author: felix <bunny351@gmail.com>
AuthorDate: Mon May 3 09:45:51 2010 +0200
Commit: felix <bunny351@gmail.com>
CommitDate: Mon May 3 09:45:51 2010 +0200
-host options for chicken-status and chicken-install (untested)
diff --git a/chicken-status.scm b/chicken-status.scm
index eba2b3b4..c81f5c1f 100644
--- a/chicken-status.scm
+++ b/chicken-status.scm
@@ -29,13 +29,23 @@
(module main ()
- (import scheme chicken)
+ (import scheme chicken foreign)
(import srfi-1 posix data-structures utils ports regex
files setup-api)
+ (define-foreign-variable C_TARGET_LIB_HOME c-string)
+ (define-foreign-variable C_BINARY_VERSION c-string)
+
+ (define *host-extensions* #f)
+
+ (define (repo-path)
+ (if (and (feature? #:cross-chicken) (not *host-extensions*))
+ (make-pathname C_TARGET_LIB_HOME (sprintf "chicken/~a" C_BINARY_VERSION))
+ (repository-path)))
+
(define (gather-eggs patterns)
(let ((eggs (map pathname-file
- (glob (make-pathname (repository-path) "*" "setup-info")))))
+ (glob (make-pathname (repo-path) "*" "setup-info")))))
(delete-duplicates
(concatenate (map (cut grep <> eggs) patterns))
string=?)))
@@ -92,6 +102,7 @@ usage: chicken-status [OPTION | PATTERN] ...
-h -help show this message
-v -version show version and exit
-f -files list installed files
+ -host when cross-compiling, show status of host extensions
EOF
);|
(exit code))
@@ -112,6 +123,9 @@ EOF
(string=? arg "-h")
(string=? arg "--help"))
(usage 0))
+ ((string=? arg "-host")
+ (set! *host-extensions* #t)
+ (loop (cdr args) pats))
((or (string=? arg "-f") (string=? arg "-files"))
(set! files #t)
(loop (cdr args) pats))
diff --git a/chicken-uninstall.scm b/chicken-uninstall.scm
index 96ea4a0b..1b73534c 100644
--- a/chicken-uninstall.scm
+++ b/chicken-uninstall.scm
@@ -31,15 +31,25 @@
(module main ()
- (import scheme chicken)
+ (import scheme chicken foreign)
(import setup-api)
(import srfi-1 posix data-structures utils ports regex srfi-13 files)
+ (define-foreign-variable C_TARGET_LIB_HOME c-string)
+ (define-foreign-variable C_BINARY_VERSION c-string)
+
+ (define *host-extensions* #f)
+
+ (define (repo-path)
+ (if (and (feature? #:cross-chicken) (not *host-extensions*))
+ (make-pathname C_TARGET_LIB_HOME (sprintf "chicken/~a" C_BINARY_VERSION))
+ (repository-path)))
+
(define *force* #f)
(define (gather-eggs patterns)
(let ((eggs (map pathname-file
- (glob (make-pathname (repository-path) "*" "setup-info")))))
+ (glob (make-pathname (repo-path) "*" "setup-info")))))
(delete-duplicates
(concatenate (map (cut grep <> eggs) patterns))
string=?)))
@@ -80,6 +90,7 @@ usage: chicken-uninstall [OPTION | PATTERN] ...
-v -version show version and exit
-force don't ask, delete whatever matches
-s -sudo use sudo(1) for deleting files
+ -host when cross-compiling, uninstall host extensions
EOF
);|
(exit code))
@@ -98,6 +109,9 @@ EOF
((or (string=? arg "-v") (string=? arg "-version"))
(print (chicken-version))
(exit 0))
+ ((string=? arg "-host")
+ (set! *host-extensions* #t)
+ (loop (cdr args) pats))
((string=? arg "-force")
(set! *force* #t)
(loop (cdr args) pats))
diff --git a/manual/Extensions b/manual/Extensions
index 94f5c2c5..0fd33ac7 100644
--- a/manual/Extensions
+++ b/manual/Extensions
@@ -579,6 +579,7 @@ Available options:
; {{-v -version}} : show version and exit
; {{-force}} : don't ask, delete whatever matches
; {{-s -sudo}} : use {{sudo(1)}} for deleting files
+; {{-host}} : when cross-compiling, remove extensions for host system (the default for cross-compiling is to remove the extensions of the target system).
=== chicken-status reference
@@ -586,6 +587,7 @@ Available options:
; {{-h -help}} : show usage information and exit
; {{-v -version}} : show version and exit
; {{-f -files}} : list installed files
+; {{-host}} : when cross-compiling, show extensions for host system (the default for cross-compiling is to show the extensions of the target system).
=== Security
Trap