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.


_______________________________________________
macports-dev mailing list
[email protected]
https://lists.macosforge.org/mailman/listinfo/macports-dev

Reply via email to