How identify and remove leftover files on buildbots?

Ryan Schmidt ryandesign at macports.org
Sun Nov 2 11:14:51 PST 2014


> On Nov 2, 2014, at 1:05 PM, Marko Käning <MK-MacPorts at techno.ms> wrote:
> 
> On 02 Nov 2014, at 14:44 , Marko Käning <MK-MacPorts at techno.ms> wrote:
>> But just now I saw that the last portfile I ran had two (2) post-destroot phases…
>> 
>> Trying again…
> 
> My goodness, although I have my code now inserted at the end of the existing post-destroot
> phase it still doesn’t work as it is supposed to:
> 
> 
> 
> 
> 
> $ sudo port upgrade
> --->  Computing dependencies for R
> --->  Fetching archive for R
> --->  Attempting to fetch R-3.1.1_4+accelerate+cairo+gfortran48+recommended.darwin_13.x86_64.tbz2 from http://nue.de.packages.macports.org/macports/packages/R
> --->  Attempting to fetch R-3.1.1_4+accelerate+cairo+gfortran48+recommended.darwin_13.x86_64.tbz2 from http://lil.fr.packages.macports.org/R
> --->  Attempting to fetch R-3.1.1_4+accelerate+cairo+gfortran48+recommended.darwin_13.x86_64.tbz2 from http://mse.uk.packages.macports.org/sites/packages.macports.org/R
> --->  Fetching distfiles for R
> --->  Verifying checksums for R
> --->  Extracting R
> --->  Configuring R
> --->  Building R
> --->  Staging R into destroot
> --->  Installing R @3.1.1_4+accelerate+cairo+gfortran48+recommended
> --->  Cleaning R
> --->  Computing dependencies for R
> --->  Activating R @3.1.1_4+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/_Users_marko_WC_SVN_MacPorts_dports_math_R/R/main.log
> --->  Scanning binaries for linking errors
> --->  No broken files found.                    
> 
> 
> 
> 
> 
> !!!I am sure that I must be making some mistake here!!!   ??? WHERE ON EARTH is it???
> 
> 
> 
> 
> 
> $ svn diff
> Index: Portfile
> ===================================================================
> --- Portfile	(revision 127729)
> +++ Portfile	(working copy)
> @@ -12,6 +12,7 @@
> 
> #Remember to remove revision line when bumping version
> version                     ${major}.${minor}.${point}
> +revision                    4
> 
> categories                  math science
> maintainers                 me.com:kjell.konis
> @@ -92,7 +93,7 @@
>                             path:lib/pkgconfig/glib-2.0.pc:glib2 \
>                             port:freetype \
>                             port:fontconfig \
> -                            port:gettext 
> +                            port:gettext
>     configure.args-delete   --without-cairo
>     configure.args-append   --with-cairo
> }
> @@ -243,6 +244,17 @@
> 
>     ln -s ${resources}/bin/R ${destroot}${prefix}/bin/R
>     ln -s ${resources}/bin/Rscript ${destroot}${prefix}/bin/Rscript
> +
> +    ui_info "post-destroot::start"
> +    foreach file {[glob ${prefix}${frameworks_dir}/R.framework/]} {
> +        set filepath ${file}
> +        ui_info "Found residual file ${filepath}"
> +        if {[file exists ${filepath}] && [registry_file_registered ${filepath}] == "0"} {
> +            ui_warn "Deleting residual file ${filepath}"
> +            file delete -force $filepath
> +        }
> +    }
> +    ui_info "post-destroot::end"
> }
> 
> livecheck.type      regex
> 
> 

I don't see why the outer ui_info commands wouldn't be invoked. I can try it on my system in a moment.

The glob doesn't match anything, does it? There's no point calling "glob" unless you have an asterisk somewhere in the argument.

Note you should just use "delete" instead of "file delete -force". And you could just use "foreach filepath" instead of "foreach file" followed by "set filepath ${file}"

Of course the correct location for this block is pre-activate. MacPorts won't have permission to do things outside of the work directory in previous phases such as destroot.

Having multiple pre- or post- blocks per phase is fine, by the way.




More information about the macports-dev mailing list