How identify and remove leftover files on buildbots?
Ryan Schmidt
ryandesign at macports.org
Sun Nov 2 04:20:45 PST 2014
On Nov 2, 2014, at 6:07 AM, Marko Käning wrote:
>
> On 02 Nov 2014, at 12:49 , Joshua Root wrote:
>> 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.
>
> Oh, I see I missed the brackets. :/
>
> Well, after fixing this I tried again and finally have to realise that my pre-activate phase doesn’t seem
> to get called at all:
>
> ---
> pre-activate {
> ui_warn "pre-activate::start"
> foreach file {[glob ${prefix}/Library/Frameworks/R.framework/]} {
> set filepath ${prefix}/${file}
> ui_warn "Found residual file ${filepath}"
> if {[file exists ${filepath}] && [registry_file_registered ${filepath}] == "0"} {
> ui_warn "Deleting residual file ${filepath}"
> file delete -force $filepath
> }
> }
> ui_warn "pre-activate::end”
> }
> ---
>
> as you can see here:
>
> ---
> $ sudo port activate
> ---> Computing dependencies for R
> ---> Activating R @3.1.1_0+accelerate+cairo+gfortran48+recommended
> Error: org.macports.activate for port R returned: Image error: /opt/local/Library/Frameworks/R.framework/Resources already exists and does not belong to a registered port. Unable to activate port R. Use 'port -f activate R' to force the activation.
> Please see the log file for port R for details:
> /opt/local/var/macports/logs/_opt_local_var_macports_registry_portfiles_R-3.1.1_0_b7a977ec04f3cf13705119222720f517ea82db667f1b01c418883c442bac4545-9666/R/main.log
> Warning: Failed to execute portfile from registry for R @3.1.1_0+accelerate+cairo+gfortran48+recommended
> ---> Activating R @3.1.1_0+accelerate+cairo+gfortran48+recommended
> Error: port activate failed: Image error: /opt/local/Library/Frameworks/R.framework/Resources already exists and does not belong to a registered port. Unable to activate port R. Use 'port -f activate R' to force the activation.
> $ grep "pre-activate::" /opt/local/var/macports/logs/_opt_local_var_macports_registry_portfiles_R-3.1.1_0_b7a977ec04f3cf13705119222720f517ea82db667f1b01c418883c442bac4545-9666/R/main.log
> $
> ---
>
> At least I can’t spot those ui_warn messages as you can see above. :(
Try uninstalling R before trying again. When activating, it may be using the pre-activate block in the portfile that was current at the time the archive was built, rather than the pre-activate block in the latest version of the portfile.
Try running port with the debug (-d) flag.
Try using ui_info or ui_debug instead of ui_warn.
Look at the value you're setting filepath to. You're prepending ${prefix} though it should already begin with ${prefix}, so now you've got a double prefix.
Don't hardcode /Library/Frameworks; use ${frameworks_dir} (unless the port previously used a hardcoded /Library/Frameworks when installing these files).
More information about the macports-dev
mailing list