chicken-janitors
[Top][All Lists]
Advanced

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

#1685: shell-variable in egg-compile should quote environment variables


From: Chicken Trac
Subject: #1685: shell-variable in egg-compile should quote environment variables
Date: Mon, 09 Mar 2020 19:43:47 -0000

#1685: shell-variable in egg-compile should quote environment variables
-------------------------------------+-------------------------------------
            Reporter:  Mario         |       Type:  defect
  Domenech Goulart                   |
              Status:  new           |   Priority:  major
           Milestone:  5.3           |  Component:  core libraries
             Version:  5.2.0         |   Keywords:  shell-variable,
                                     |  DESTDIR, chicken-install, egg-
Estimated difficulty:                |  compile
-------------------------------------+-------------------------------------
 Without quoting shell variables, install scripts end up with commands like

 {{{
 mkdir -p ${DESTDIR}'/home/mario/local/chicken-head/lib/chicken/11'
 }}}

 If {{{DESTDIR}}}} happens to contain a space, the command above will not
 do what it is expected to do.

 Double-quoting shell variables on Unix systems is not harmful, as far as I
 can tell.  I have no clue about Windows.

 At the moment, {{{shell-variable}}} seems to be only applied to
 {{{DESTDIR}}}.

 The following patch would improve the situation on Unix:

 {{{
 diff --git a/egg-compile.scm b/egg-compile.scm
 index 4a72d5d0..e6be5d1d 100644
 --- a/egg-compile.scm
 +++ b/egg-compile.scm
 @@ -1227,7 +1227,7 @@ EOF

  (define (shell-variable var platform)
    (case platform
 -    ((unix) (string-append "${" var "}"))
 +    ((unix) (string-append "\"${" var "}\""))
      ((windows) (string-append "%" var "%"))))

  ;; NOTE `cmd' must already be quoted for shell
 }}}

-- 
Ticket URL: <https://bugs.call-cc.org/ticket/1685>
CHICKEN Scheme <https://www.call-cc.org/>
CHICKEN Scheme is a compiler for the Scheme programming language.

reply via email to

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