Hi Felix,

On Tue, 07 Sep 2021 10:16:12 +0200 [email protected] wrote:

>> I could not apply this patch on master.  `install-executable-command'
>> and `install-file-command'  don't have a `case' form matching
>> `platform' in master.  Maybe another patch is missing?
>> 
>
> Here is another version. I forgot to clean up my repository from previous
> work - I'm still able to screw up nearly every non-trivial git workflow.
>
> I hope this one works.

Thanks.  It didn't work on Linux, as there was a spurious `d' given as
argument to string-append.  `d' is bound to a procedure (probably in
chicken-install.scm, which includes egg-compile.scm).  That caused the
following error when installing eggs:

  Error: (string-append) bad argument type - not a string: #<procedure>

After I removed the `d' given as argument to string-append things worked
fine on Linux.  I haven't tested the patch on Windows (it looks fine to
me, though).

Since I touched the patch, I went ahead and performed some additional
editorial nitpickery (nuked spurious whitespaces, fixed indentation and
broke the commit message into summary and body).

The revised and signed-off patch is attached.  Feel free to push it if
you agree with the modifications.

All the best.
Mario
-- 
http://parenteses.org/mario
>From 0c0cc019076bca3f85d393384f6294d6f12702db Mon Sep 17 00:00:00 2001
From: felix <[email protected]>
Date: Tue, 7 Sep 2021 10:12:36 +0200
Subject: [PATCH] Ensure platform identifier is used when determining install
 command for files on windows

Previously the defaults from chicken-config.h where used, but
depending on the shell used during installation, this may be a UNIX
command if the MSYS shell was used.

Thanks to Mark Fisher for his tremendous help in fixing this bug.

Signed-off-by: Mario Domenech Goulart <[email protected]>
---
 egg-compile.scm         | 19 +++++++++++++++----
 manual/Acknowledgements |  2 +-
 2 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/egg-compile.scm b/egg-compile.scm
index 205505a6..dd2e8103 100644
--- a/egg-compile.scm
+++ b/egg-compile.scm
@@ -80,18 +80,29 @@
     ((unix) "cp -r")
     ((windows) "xcopy /y /i /e")))
 
+(define (copy-file-command platform)
+  (case platform
+    ((unix) "cp")
+    ((windows) "copy /y")))
+
 (define (mkdir-command platform)
   (case platform
     ((unix) "mkdir -p")
     ((windows) "mkdir")))
 
 (define (install-executable-command platform)
-  (string-append default-install-program " "
-		 default-install-program-executable-flags))
+  (case platform
+    ((windows) (copy-file-command 'windows))
+    (else
+     (string-append default-install-program " "
+                    default-install-program-executable-flags))))
 
 (define (install-file-command platform)
-  (string-append default-install-program " "
-		 default-install-program-data-flags))
+  (case platform
+    ((windows) (copy-file-command 'windows))
+    (else
+     (string-append default-install-program " "
+                    default-install-program-data-flags))))
 
 (define (remove-file-command platform)
   (case platform
diff --git a/manual/Acknowledgements b/manual/Acknowledgements
index 0489a0eb..fcaaa92f 100644
--- a/manual/Acknowledgements
+++ b/manual/Acknowledgements
@@ -17,7 +17,7 @@ Forero Cuervo, Peter Danenberg, Linh Dang, Brian Denheyer, Sean
 D'Epagnier, "dgym", "Don", Chris Double, "Brown Dragon", David
 Dreisigmeyer, Jarod Eells, Petter Egesund, Stephen Eilert, Steve
 Elkins, Daniel B. Faken, Erik Falor, Will Farr, Graham Fawcett, Marc
-Feeley, "Fizzie", Matthew Flatt, Kimura Fuyuki, Tony Garnock-Jones,
+Feeley, Mark Fisher, "Fizzie", Matthew Flatt, Kimura Fuyuki, Tony Garnock-Jones,
 Martin Gasbichler, Abdulaziz Ghuloum, Joey Gibson, Stephen C. Gilardi,
 Mario Domenech Goulart, Joshua Griffith, Johannes Groedem, Damian
 Gryski, Matt Gushee, Andreas Gustafsson, Sven Hartrumpf, Jun-ichiro
-- 
2.30.2

Reply via email to