Summary

egg install scripts don't have to rm before install

Metadata

Description

Currently, chicken-install generates egg install scripts with the following pattern to install files:

 rm -f ${DESTDIR}'<dest file>'
 install -m 755 '<orig file>' ${DESTDIR}'<dest file>'

Changes and comments

[2020-03-09 21:08:31 UTC] mario wrote:

Maybe something like the following patch would improve things (only quickly tested with a single egg).

 diff --git a/egg-compile.scm b/egg-compile.scm
 index 4a72d5d0..f6de778c 100644
 --- a/egg-compile.scm
 +++ b/egg-compile.scm
 @@ -940,7 +940,6 @@
                                      output-file)
           srcdir platform)
    (let* ((cmd (install-executable-command platform))
 -         (dcmd (remove-file-command platform))
           (mkdir (mkdir-command platform))
           (sname (prefix srcdir name))
           (out (qs* (target-file (conc sname ext) mode) platform #t))
 @@ -949,8 +948,6 @@
           (ddir (shell-variable "DESTDIR" platform))
           (destf (qs* (conc dest "/" output-file ext) platform #t)))
      (print "\n" mkdir " " ddir dfile)
 -    (when (eq? platform 'unix)
 -      (print dcmd " " ddir destf))
      (print cmd " " out " " ddir destf)
      (print-end-command platform)))
 
 @@ -1005,7 +1002,6 @@
 
  (define ((install-program name #!key mode output-file) srcdir platform)
    (let* ((cmd (install-executable-command platform))
 -         (dcmd (remove-file-command platform))
           (mkdir (mkdir-command platform))
           (ext (executable-extension platform))
           (sname (prefix srcdir name))
 @@ -1017,8 +1013,6 @@
           (ddir (shell-variable "DESTDIR" platform))
           (destf (qs* (conc dest "/" output-file ext) platform #t)))
      (print "\n" mkdir " " ddir dfile)
 -    (when (eq? platform 'unix)
 -      (print dcmd " " ddir destf))
      (print cmd " " out " " ddir destf)
      (print-end-command platform)))

[2020-04-19 16:01:36 UTC] felix changed status from new to closed

[2020-04-19 16:01:36 UTC] felix set resolution to fixed

[2020-04-19 16:01:36 UTC] felix wrote:

Thanks - I have pushed this patch. I was initially concerned about Windows platforms (which do not have install(1)), but on Windows either removal or overwrite is not allowed anyway, so nothing is list.