Here are two patches addressing comments and suggestions by
megane.

felix

From 652446a34d51f0bcb7f9b05300228e6ad7305237 Mon Sep 17 00:00:00 2001
From: felix <fe...@call-with-current-continuation.org>
Date: Thu, 28 Feb 2019 14:02:12 +0100
Subject: [PATCH] chicken-install: exit with status 3 if no eggs are processed

Suggested by megane. User abort exits with status 2.
---
 chicken-install.mdoc |  3 ++-
 chicken-install.scm  | 28 +++++++++++++++-------------
 2 files changed, 17 insertions(+), 14 deletions(-)

diff --git a/chicken-install.mdoc b/chicken-install.mdoc
index 2cdbac36..e6a8c773 100644
--- a/chicken-install.mdoc
+++ b/chicken-install.mdoc
@@ -138,7 +138,8 @@ defaults to
 )
 .El
 .Sh EXIT STATUS
-.Ex -std
+The tool exits with status 1 on error, 2 after the user aborted an
+operation or 3 if it was invoked with no explicitly given egg names and no 
*.egg files could be found in the current directory.
 .Sh EXAMPLES
 Install
 .Sq regex
diff --git a/chicken-install.scm b/chicken-install.scm
index 3edf293b..ef483cc7 100644
--- a/chicken-install.scm
+++ b/chicken-install.scm
@@ -773,7 +773,7 @@
     (let ((r (trim (read-line))))
       (cond ((string=? r "yes"))
             ((string=? r "no") #f)
-            ((string=? r "abort") (exit 1))
+            ((string=? r "abort") (exit 2))
             (else (loop))))))
 
 (define (trim str)
@@ -1009,18 +1009,20 @@
         (purge-mode (purge-cache eggs))
         (print-repository (print (install-path)))
         ((null? eggs)
-         (when cached-only
-           (error "`-cached' needs explicit egg list"))
-         (if list-versions-only
-             (print "no eggs specified")
-             (let ((files (glob "*.egg" "chicken/*.egg")))
-               (set! canonical-eggs 
-                 (map (lambda (fname)
-                        (list (pathname-file fname) (current-directory) #f))
-                   files))
-               (set! requested-eggs (map car canonical-eggs))
-               (retrieve-eggs '())
-               (unless retrieve-only (install-eggs)))))
+         (cond (cached-only
+                 (error "`-cached' needs explicit egg list"))
+               (list-versions-only
+                 (print "no eggs specified"))
+               (else 
+                 (let ((files (glob "*.egg" "chicken/*.egg")))
+                   (when (null? files) (exit 3))
+                   (set! canonical-eggs 
+                     (map (lambda (fname)
+                            (list (pathname-file fname) (current-directory) 
#f))
+                       files))
+                   (set! requested-eggs (map car canonical-eggs))
+                   (retrieve-eggs '())
+                   (unless retrieve-only (install-eggs))))))
         (else
           (let ((eggs (apply-mappings eggs)))
             (cond (list-versions-only (list-egg-versions eggs))
-- 
2.16.2

From f6241638e1c5f779dbafa994003a6c91b0f4b05c Mon Sep 17 00:00:00 2001
From: felix <fe...@call-with-current-continuation.org>
Date: Thu, 28 Feb 2019 14:03:27 +0100
Subject: [PATCH] correct entry in types.db for `system*'.

Found by megane.
---
 types.db | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/types.db b/types.db
index c443d94e..fcf9d9b0 100644
--- a/types.db
+++ b/types.db
@@ -2066,7 +2066,7 @@
 (chicken.process#process-spawn
  (#(procedure #:clean #:enforce) chicken.process#process-spawn (fixnum string 
#!optional (list-of string) (list-of (pair string string)) boolean) fixnum))
 (chicken.process#system (#(procedure #:clean #:enforce) chicken.process#system 
(string) fixnum))
-(chicken.process#system* (#(procedure #:clean #:enforce) 
chicken.process#system* (string #!rest) undefined))
+(chicken.process#system* (#(procedure #:clean #:enforce) 
chicken.process#system* (string) undefined))
 (chicken.process#process (#(procedure #:clean #:enforce) 
chicken.process#process (string #!optional (list-of string) (list-of (pair 
string string)) boolean) input-port output-port fixnum))
 (chicken.process#process* (#(procedure #:clean #:enforce) 
chicken.process#process* (string #!optional (list-of string) (list-of (pair 
string string)) boolean) input-port output-port fixnum *))
 (chicken.process#process-wait (#(procedure #:clean #:enforce) 
chicken.process#process-wait (#!optional fixnum *) fixnum fixnum fixnum))
-- 
2.16.2

_______________________________________________
Chicken-hackers mailing list
Chicken-hackers@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-hackers

Reply via email to