How identify and remove leftover files on buildbots?

Ryan Schmidt ryandesign at macports.org
Sun Nov 2 15:12:03 PST 2014


On Nov 2, 2014, at 5:05 PM, Marko Käning wrote:
> 
> OK, it looks that this does the job as expected now. This was achieved with this pre-activate phase:
> ---
> pre-activate {
>    foreach filepath [glob ${frameworks_dir}/R.framework/*] {
>        if {[file exists ${filepath}] && [registry_file_registered ${filepath}] == "0"} {
>            ui_warn "Deleting residual file ${filepath}"
>            delete $filepath
>        }
>    }
> }
> ---
> 
> 
> 
> BTW, does the TCL function registry_file_registered actually check whether the file in question is
> registered only by the current port, or by ANY port installed??

Any port.

Note that the registry only contains files and symlinks, not directories, which some of the items you're globbing are. If you're sure that no port other than R should be installing anything in ${frameworks_dir}/R.framework, but rkward or some other port previously did without registering that, you could just unconditionally delete that pre-activate. Or you could fs-traverse that directory and just delete things not registered to any port.




More information about the macports-dev mailing list