chicken-hackers
[Top][All Lists]
Advanced

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

[Chicken-hackers] Proposed patch for destination egg property


From: Jim Ursetto
Subject: [Chicken-hackers] Proposed patch for destination egg property
Date: Mon, 14 Jan 2019 14:38:53 -0600

Hi folks,

When porting chickadee to Chicken 5, I hit a roadblock when installing data files into a namespaced directory — <PREFIX>/share/chicken/chickadee. 

In Chicken 4, we can execute code in .setup to obtain this directory — (make-pathname (chicken-home) "chickadee”) — and use copy-file. In Chicken 5, we can’t execute code in .egg files, and the (data) component copies files directly into the shared directory.

The destination property can override the install directory, but is only defined for absolute paths, and you can’t compute the absolute shared path in an .egg. (Also, chicken-install fails if the destination property is present.)

There is a workaround for Chicken 5, where I can place all my data files into a directory “chickadee” inside the egg “chickadee”, then specify chickadee as the directory in the data component. Ugly, but effective.

I feel a better solution is demonstrated by the attached patch, which accepts relative paths for destination. If relative, the provided directory is relative to the default install location, so (destination “chickadee”) now namespaces data files under <PREFIX>/share/chicken/chickadee. Absolute paths still work as expected.

The issue will affect at minimum these other eggs once they are ported to Chicken 5. They all namespace themselves using their egg name and copy-file:

formular, mistie, html-form, nemo, sigma, sigma-diagram, slatex

The downside is that any egg using destination will fail on major release 5.0.0. So for some amount of time, until 5.1.0 or maybe much longer, you would need to use the named directory workaround I mentioned above.

An alternative way of solving this would be to transparently namespace the install into a directory based on the egg name. This might be better for general hygiene, although it breaks with long tradition. On the other hand, this would result in an unwelcome surprise (no namespace) when using 5.0.0 — whereas the destination property safely throws an error.

Jim

Attachment: 0001-Enable-destination-egg-property-and-accept-relative-.patch
Description: Binary data


reply via email to

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