Hi all,

While testing my previous patch on Windows, I noticed some weird error
output during the installation phase.  It would say several times in a
row:
The filename, directory name, or volume label syntax is incorrect.

If you look at the foo.install.bat file, there's calls to mkdir which
include the chicken PREFIX twice.

Then, I realised this also happens in *nix.  For example, try to install
the "amb" egg.  Just before it emits the egg-info file, it emits several
calls to mkdir -p /path/to/chicken/path/to/chicken/share, which ought
to be just /path/to/chicken/share.

After investigating further, I realised these 5 calls correspond to
the (data ...) components in the egg, which aren't actually installed!

If you install the amb egg and then run the following command from the
target directory: "find -name amb-dwelling.scm", it turns up nothing.
The amb-dwelling.scm file also doesn't even occur in the install script.

It looks like that's actually a bug in the egg though - contrast to the
srfi-19 egg which *does* work, it has (data srf-29-bundles (files ...))
instead.

The attached patch fixes the double call to normalize-destination on the
directory for "share" files (data files)

Cheers,
Peter
From e8341cca08c43e8bac1c5d08aaac670f5c37d211 Mon Sep 17 00:00:00 2001
From: Peter Bex <[email protected]>
Date: Mon, 31 Oct 2022 13:06:26 +0100
Subject: [PATCH] Do not double call normalize-destination on share dir

In install-random-files, don't call normalize-destination on the
destination directory - this is already done in compile-egg-info

Before, we'd see things like in the install script like:
  mkdir -p /path/to/chicken/path/to/chicken/share
With this patch, it becomes:
  mkdir -p /path/to/chicken/share
which is as it should be.
---
 egg-compile.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/egg-compile.scm b/egg-compile.scm
index 6818c6e4..5a59a43f 100644
--- a/egg-compile.scm
+++ b/egg-compile.scm
@@ -990,7 +990,7 @@
          (root (string-append srcdir "/"))
          (mkdir (mkdir-command platform))
          (sfiles (map (cut prefix srcdir <>) files))
-         (dfile (qs* (normalize-destination dest mode) platform #t))
+         (dfile (qs* dest platform #t))
          (ddir (shell-variable "DESTDIR" platform)))
     (print "\n" mkdir " " ddir dfile)
     (let-values (((ds fs) (partition directory? sfiles)))
-- 
2.36.2

Attachment: signature.asc
Description: PGP signature

Reply via email to