[Omake] Symlink behavior bugs and related questions
Brian Downing
bdowning at lavos.net
Fri Dec 25 12:38:17 PST 2009
Hi,
I'm trying to use omake for a project at work, and I've come across some
fairly nasty bugs with regard to symlinks. I'm working with 0.9.8.5, as
packaged in Ubuntu.
First of all, $(test -L ...) seems completely broken. As near as I can
tell, it just always returns false. I'd assume that lstat needs to be
used instead of stat.
Worse, however, is that the builtin rm -rf will follow symbolic links to
directories and delete their contents! This could be incredibly
destructive.
I've attached a testcase for these issues.
Another thing I noticed is that the suggestion to define
USE_SYSTEM_COMMANDS = true in your OMakeroot to get rid of the above
broken internal shell commands doesn't seem to work. I'm not sure how
this could work anyway, since Pervasives.om gets loaded before
OMakeroot. It looks like the undocumented ~/.omakeinit file gets run
first, but then you aren't specifing project policy anymore and might
break other omake projects.
Another somewhat related question: Is there any obvious way to remove a
method from an object/class? Because of the USE_SYSTEM_COMMANDS issue,
I wound up doing in my project's OMakeroot:
#
# Throw away broken shell builtins:
#
oldshell = $(Shell)
Shell. =
class Shell
extends $(Object)
oldshell.object-foreach(name, value):
if $(not $(mem $(name), cp mv rm rmdir chmod find))
Shell = $(Shell.object-add $(name), $(value))
export
export
This works, but it seems very convoluted. (Also, for some reason, if I
"export Shell" there instead of "export" it doesnt work.)
I think I can work around most of these issues, but wanted to report the
bugs, especially the rm one.
Thanks,
-bcd
More information about the Omake
mailing list