chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-hackers] [PATCH] add -all option to chicken-uninstall


From: Mario Domenech Goulart
Subject: Re: [Chicken-hackers] [PATCH] add -all option to chicken-uninstall
Date: Fri, 02 Aug 2013 14:12:33 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Hi Felix,

Please, see some comments below.

On Fri, 02 Aug 2013 14:25:22 +0200 (CEST) Felix <address@hidden> wrote:

> This patch adds the "-all" option to chicken-uninstall. This may be a
> bit more intuitive than using a ".*" regular-expression.
>
>
> cheers,
> felix
>>From ff90930f99a2a0c627df27fea49ec0c9d94e6ed4 Mon Sep 17 00:00:00 2001
> From: felix <address@hidden>
> Date: Thu, 1 Aug 2013 12:01:37 +0200
> Subject: [PATCH] Add "-all" option to "chicken-install", which is somewhat
>  more intuitive than using the regular expression ".*" to
>  name the extensions to be removed.
>
> ---
>  chicken-uninstall.scm |    6 ++++++
>  manual/Extensions     |    1 +
>  2 files changed, 7 insertions(+)
>
> diff --git a/chicken-uninstall.scm b/chicken-uninstall.scm
> index f982c0b..477ab3c 100644
> --- a/chicken-uninstall.scm
> +++ b/chicken-uninstall.scm
> @@ -47,6 +47,7 @@
>       (make-pathname C_TARGET_LIB_HOME (sprintf "chicken/~a" 
> C_BINARY_VERSION))
>       (repository-path)))
>  
> +  (define *all* #t)

Shouldn't it be initialized to #f?


>    (define *force* #f)
>  
>    (define (grep rx lst)
> @@ -99,6 +100,7 @@ usage: chicken-uninstall [OPTION | PATTERN] ...
>  
>    -h   -help                    show this message and exit
>         -version                 show version and exit
> +       -all                     remove all installed eggs
>         -force                   don't ask, delete whatever matches
>         -exact                   treat PATTERN as exact match (not a pattern)
>    -s   -sudo                    use sudo(1) for deleting files
> @@ -114,6 +116,7 @@ EOF
>      (let ((exact #f))
>        (let loop ((args args) (pats '()))
>       (cond ((null? args)
> +            (when *all* (set! pats '(".*")))

Shouldn't the pattern be "*", since it goes through ##sys#glob->regexp ?


>              (when (null? pats) (usage 1))
>              (uninstall
>               (reverse 
> @@ -141,6 +144,9 @@ EOF
>                      ((string=? arg "-force")
>                       (set! *force* #t)
>                       (loop (cdr args) pats))
> +                    ((string=? arg "-all")
> +                     (set! *all* #t)
> +                     (loop (cdr args) pats))
>                      ((string=? arg "-exact")
>                       (set! exact #t)
>                       (loop (cdr args) pats))
> diff --git a/manual/Extensions b/manual/Extensions
> index 5e612c0..701f79b 100644
> --- a/manual/Extensions
> +++ b/manual/Extensions
> @@ -589,6 +589,7 @@ Available options:
>  ; {{-h   -help}} : show usage information and exit
>  ; {{-version}} : show version and exit
>  ; {{-force}} : don't ask, delete whatever matches
> +; {{-all}} : remove all installed eggs
>  ; {{-s   -sudo}} : use {{sudo(1)}} for deleting files
>  ; {{-host}} : when cross-compiling, remove extensions for host system only
>  ; {{-target}} : when cross-compiling, remove extensions for target system 
> only

Best wishes.
Mario
-- 
http://parenteses.org/mario



reply via email to

[Prev in Thread] Current Thread [Next in Thread]