Re: [Chicken-hackers] Proposed patch for destination egg property

2019-01-14 Thread felix . winkelmann
> When porting chickadee to Chicken 5, I hit a roadblock when installing data 
> files into a namespaced directory — /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.

In 5.0.1 (or somewhere between 5.0.0 and 5.0.1) this feature was explicitly
added, so the option given last above is what you should do (and I must say 
that I 
don't find it particularly ugly). "destination" is actually rather useless and 
should
be removed, IMO.


felix


___
Chicken-hackers mailing list
Chicken-hackers@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-hackers


[Chicken-hackers] Proposed patch for destination egg property

2019-01-14 Thread Jim Ursetto
Hi folks,When porting chickadee to Chicken 5, I hit a roadblock when installing data files into a namespaced directory — /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 /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, slatexThe 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

0001-Enable-destination-egg-property-and-accept-relative-.patch
Description: Binary data
___
Chicken-hackers mailing list
Chicken-hackers@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-hackers