[Omake] Announcing OMake 0.9.8
Aleksey Nogin
nogin at metaprl.org
Tue Dec 12 09:25:40 PST 2006
On 12.12.2006 01:00, Michael Vanier wrote:
> Follow-up. In osh:
>
> % Shell.rm(main/*.o)
> *** omake error:
> File -: line 1, characters 0-18
> unlink(/home/mvanier/proj/src/main/*.o): No such file or directory
Right, the globbing happens only if you use the Unix-style command line.
Direct function call is just that - a function call; no globbing happens.
On 12.12.2006 01:28, David Kågedal wrote:
> This is from the release notes:
>
> + The Shell. aliases will now receive the values passed on the
> shell command line as is, not the string-expanded version. Also,
> if some of the arguments are the result of a glob-expansion, the
> alias function will receive the appropriate file values, not the
> strings.
>
> The problem is that it's hard to understand what the second sentence
> means.
If you have two files - foo and fooz - then
rm f*
used to be equivalent to
Shell.rm($(array foo, fooz))
but now it is equivalent to
Shell.rm($(array $(file foo), $(file fooz)))
(same as Shell.rm($(file foo fooz)) )
> Who does the glob expansion, and when?
Anytime you have a shell command line (anything that's not a function
call, rule, section heading, etc - see Section 10.8 "What is a shell
command?" - http://omake.metaprl.org/omake-shell.html#toc89 ), the glob
patterns in the command line are expanded before the control is passed
to the external program xyz or a Shell.xyz function. See Section 10.2
"Globbing" - http://omake.metaprl.org/omake-shell.html#toc83 and 9.4
"Globbing and file listings" -
http://omake.metaprl.org/omake-system.html#toc74 for detail.
On 12.12.2006 01:46, Michael Vanier wrote:
> Huh, I fixed the problem by changing
>
> CLEANFILES = $`(file *.opt *.run *.o *.obj *.lib *.cm* *.a *~)
>
> to
>
> CLEANFILES = $`(glob *.opt *.run *.o *.obj *.lib *.cm* *.a *~)
Right, it always was the case that $(file *.o) meant``literal file
"./*.o" ''. The problem was that pre-0.9.8 the command line translation
would turn the file value into a string and then _inappropriately_
expand the *. In 0.9.8 this problem is finally fixed (unfortunately, it
had to be at the expense of backward compatibility).
Also note that there is no reason to manually force the globbing - a simple
CLEANFILES = *.opt *.run *.o *.obj *.lib *.cm* *.a *~
would do the trick as well.
Aleksey
More information about the Omake
mailing list