How identify and remove leftover files on buildbots?

Marko Käning MK-MacPorts at techno.ms
Sun Nov 2 11:35:01 PST 2014


Hi Ryan,

On 02 Nov 2014, at 20:14 , Ryan Schmidt <ryandesign at macports.org> wrote:
> I don't see why the outer ui_info commands wouldn't be invoked. I can try it on my system in a moment.

that puzzled me as well.


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

Oh, I wasn’t aware of that! My bad.

I guess I’d also have to manually delete the folder

	${prefix}/Library/Frameworks/R.framework/

at the end myself...


> Note you should just use "delete" instead of "file delete -force”.

OK, will do.


> And you could just use "foreach filepath" instead of "foreach file" followed by "set filepath ${file}”

Yes, I know, that’s just a residue.


> 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.

Good to know!!! :)
OK, reverted back to pre-activate now.

But, the result is the same. :(


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


Oh, I didn’t know that.

Greets,
Marko


P.S.: I tried to find you on IRC, but learnt that you’re not around there.





$ 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                    6
 
 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
 }
@@ -245,6 +246,18 @@
     ln -s ${resources}/bin/Rscript ${destroot}${prefix}/bin/Rscript
 }
 
+pre-activate {
+    ui_info "pre-activate::start"
+    foreach filepath {[glob ${prefix}${frameworks_dir}/R.framework/*]} {
+        ui_info "Found residual file ${filepath}"
+        if {[file exists ${filepath}] && [registry_file_registered ${filepath}] == "0"} {
+            ui_warn "Deleting residual file ${filepath}"
+            delete $filepath
+        }
+    }
+    ui_info "pre-activate::end"
+}
+
 livecheck.type      regex
 livecheck.url       [lindex ${master_sites} 0]
 livecheck.regex     >${name}-(\[0-9.\]+)${extract.suffix}<



More information about the macports-dev mailing list