[Omake] Symlink behavior bugs and related questions
Aleksey Nogin
nogin at metaprl.org
Tue Feb 9 12:59:07 PST 2010
Brian,
Thanks a lot for your report. I've just fixed the "rm -r" bug on the
0.9.8 branch in rev. 13184. The "test -L" bug was already fixed on this
branch earlier.
Aleksey
On 25.12.2009 12:38, Brian Downing wrote:
> 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
> _______________________________________________
> Omake mailing list
> Omake at metaprl.org
> https://lists.metaprl.org/mailman/listinfo/omake
>
More information about the Omake
mailing list