[Omake] unbound variable error
Christopher L Conway
cconway at cs.nyu.edu
Tue May 13 12:22:36 PDT 2008
The attached file gives the following error for "omake uninstall" with
OMake 0.9.8.5:
*** omake error:
File OMakefile: line 48, characters 38-47
unbound variable: global.parent
Line 48 is in an uninstall rule:
uninstall:
println(Removing $(path))
rm -f $(path)
parent = $(dirof $(path))
println( $"dname=$(dname) dir=$(parent)" ) # Line 48
while $(not $(or $(equal $(dname), $(parent)), \
$(glob i, $(path_concat $(parent) $"*"))))
println(Removing $(parent))
rm -f $(parent)
parent = $(dir $(path_concat $(parent) ..))
println( dname=$(dname) dir=$(parent) )
So, somehow, the definition of parent on Line 47 isn't visible on Line
48. Moving the relevant logic to a function fixes the problem:
cleanup_dirs(root,subdir) =
root = $(dir $(root))
subdir = $(dir $(subdir))
while $(not $(or $(equal $(root), $(subdir)), \
$(glob i, $(path_concat $(subdir) $"*"))))
println(Removing $(subdir))
rmdir -f $(subdir)
subdir = $(dir $(path_concat $(subdir) ..))
println( dname=$(root) dir=$(subdir) )
uninstall:
println(Removing $(path))
rm -f $(path)
cleanup_dirs( $(dname), $(dirof $(path)) )
This seems like it might be related to
http://bugzilla.metaprl.org/show_bug.cgi?id=500
Regards,
Chris
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OMakefile
Type: application/octet-stream
Size: 1798 bytes
Desc: not available
Url : http://lists.metaprl.org/pipermail/omake/attachments/20080513/1c97deb4/OMakefile.obj
More information about the Omake
mailing list