~ chicken-core (chicken-5) 7f3a0f5795ec120819fbb35b8c7786ab1f256846
commit 7f3a0f5795ec120819fbb35b8c7786ab1f256846
Author: felix <felix@call-with-current-continuation.org>
AuthorDate: Wed Oct 18 10:26:18 2017 +0200
Commit: Evan Hanson <evhan@foldling.org>
CommitDate: Thu Oct 19 07:11:19 2017 +1300
Add "-from-list" option to chicken-install and allow entries with no version
Signed-off-by: Evan Hanson <evhan@foldling.org>
diff --git a/chicken-install.scm b/chicken-install.scm
index c515fc35..0162feb7 100644
--- a/chicken-install.scm
+++ b/chicken-install.scm
@@ -372,13 +372,17 @@
(let ((name (string->symbol (if (pair? egg) (car egg) egg))))
(cond ((assq name override) =>
(lambda (a)
- (cond ((and (pair? egg) (not (equal? (cadr a) (cdr egg))))
- (warning
- (sprintf
- "version `~a' of extension `~a' overrides explicitly given version `~a'"
- (cadr a) name (cdr egg))))
- (else (d "overriding: ~a~%" a)))
- (cadr a)))
+ (if (and (pair? egg)
+ (pair? (cdr a))
+ (not (equal? (cadr a) (cdr egg))))
+ (warning
+ (sprintf
+ "version `~a' of extension `~a' overrides explicitly given version `~a'"
+ (cadr a) name (cdr egg)))
+ (d "overriding: ~a~%" a))
+ (if (null? (cdr a))
+ (and (pair? egg) (cdr egg))
+ (cadr a))))
((pair? egg) (cdr egg))
(else #f))))
@@ -727,7 +731,8 @@
(lambda (e)
(cond ((assq (string->symbol (car e)) override) =>
(lambda (a)
- (unless (equal? (cadr a) (cdr e))
+ (when (and (pair? (cdr a))
+ (not (equal? (cadr a) (cdr e))))
(warning
(sprintf "version `~a' of extension `~a' overrides required version `~a'"
(cadr a) (car a) (cdr e))))
@@ -1016,6 +1021,7 @@ usage: chicken-install [OPTION ...] [NAME[:VERSION] ...]
-u -update-db update export database
-repository print path used for egg installation
-override FILENAME override versions for installed eggs with information from file
+ -from-list FILENAME install eggs from list obtained by `chicken-status -list'
-v -verbose be verbose
chicken-install recognizes the SUDO, http_proxy and proxy_auth environment variables, if set.
@@ -1093,6 +1099,17 @@ EOF
((equal? arg "-purge")
(set! purge-mode #t)
(loop (cdr args)))
+ ((equal? arg "-from-list")
+ (unless (pair? (cdr args)) (usage 1))
+ (set! eggs
+ (append eggs
+ (map (lambda (p)
+ (if (null? (cdr p))
+ (->string (car p))
+ (cons (->string (car p))
+ (cadr p))))
+ (with-input-from-file (cadr args) read-all))))
+ (loop (cddr args)))
((equal? arg "-override")
(unless (pair? (cdr args)) (usage 1))
(set! override
diff --git a/chicken-status.scm b/chicken-status.scm
index d19f0680..cc8be19f 100644
--- a/chicken-status.scm
+++ b/chicken-status.scm
@@ -172,7 +172,8 @@
(for-each
(lambda (egg)
(let ((version (get-egg-property (read-info egg) 'version)))
- (pp (list (string->symbol egg) (or version "???")))))
+ (pp (cons (string->symbol egg)
+ (if version (list version) '())))))
(gather-eggs)))
(define (usage code)
diff --git a/manual/Extensions b/manual/Extensions
index 9a397dee..ba6536ec 100644
--- a/manual/Extensions
+++ b/manual/Extensions
@@ -581,6 +581,7 @@ Available options:
; {{-u -update-db}} : update export database
; {{-repository}} : print path to egg repository
; {{-override FILENAME}} : override versions for installed eggs with information given in {{FILENAME}}, which can be generated by {{-scan}} or by the {{-list}} option of the {{chicken-status}} program
+: {{-from-list FILENAME}} : install eggs given in {{FILENAME}}, in the same format as produced by the {{-list}} option in {{chicken-status}}; this option may be given multiple times
; {{-v -verbose}} : be verbose
{{chicken-install}} recognizes the {{SUDO}}, {{http_proxy}} and {{proxy_auth}} environment variables, if set.
@@ -604,7 +605,7 @@ Available options:
; {{-match}} : treat egg-names as glob patterns
; {{-host}} : when cross-compiling, show eggs for host system only
; {{-target}} : when cross-compiling, show eggs for target system only
-; {{-list}} : list installed egg version in format suitable for {{chicken-install -override}}
+; {{-list}} : list installed egg version in format suitable for {{chicken-install -override}} or {{-from-list}}
; {{-c -components}} : list installed components
Trap