Opened 4 years ago

Closed 4 years ago

#1686 closed enhancement (fixed)

egg install scripts don't have to rm before install

Reported by: Mario Domenech Goulart Owned by:
Priority: not urgent at all Milestone: 5.3
Component: core libraries Version: 5.2.0
Keywords: install, rm, chicken-install Cc:
Estimated difficulty:

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>'

install already unlinks files before copying them, so the call to rm doesn't seem to be necessary.

Change History (2)

comment:1 Changed 4 years ago by Mario Domenech Goulart

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)))

comment:2 Changed 4 years ago by felix winkelmann

Resolution: fixed
Status: newclosed

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.

Note: See TracTickets for help on using tickets.