How identify and remove leftover files on buildbots?

Joshua Root jmr at macports.org
Sun Nov 2 03:49:44 PST 2014


On 2014-11-2 22:21 , Marko Käning wrote:
> Hi Joshua,
> 
> On 02 Nov 2014, at 04:11 , Joshua Root <jmr at macports.org> wrote:
>> Grep the ports tree for 'registry_file_registered' to find examples. One
>> is gdbm. If this isn't on the PortfileRecipes page, it probably should
>> be. (Although new instances of this problem should be rare thanks to
>> sandboxing.)
> 
> oh, yes, this little feature should be on wiki and Guide…
> 
> Thanks to peeks into gdbm and canto I came up with this:
> 
> ---
> pre-activate {
>     foreach file {glob ${prefix}/Library/Frameworks/R.framework/Resources/library/} {
>         set filepath ${prefix}/${file}
>         if {[file exists ${filepath}] && [registry_file_registered ${filepath}] == "0"} {
>             ui_warn “Deleting residual file ${filepath}”
>             file delete -force $filepath
>         }
>     }
> }
> ---
> 
> but it seems to NOT be the right way to go, as it results in
[...]

You're not calling glob properly. You're looping over a list containing
2 elements, the first of which is 'glob'. Print out $filepath right
after it's set to see this.

- Josh


More information about the macports-dev mailing list