Reinplace

Craig Treleaven ctreleaven at cogeco.ca
Sun Apr 1 06:53:51 PDT 2012


At 10:20 AM -0400 3/31/12, Jeremy Lavergne wrote:
>  > cd cd 
>"/opt/local/var/macports/build/_Users_craigtreleaven_MacPortsTemp_Myth.25/mythtv/work/mythtv-v0.25-rc-0-g92f7d1f/mythtv"
>>  sudo find . -name "Makefile" -exec sed -i '' 's/ -L / /g' {} \;
>>
>>  This is what MacPorts Reinplace extension is for, right?  Would 
>>this be the right syntax?
>>
>>  post-configure {
>>	reinplace 's/ -L / /g' ${worksrcpath}/Makefile
>>  }
>>
>>  Reinplace will do a recursive search from the specified directory 
>>on down, right?
>
>reinplace will only operate on the files you give to it. You need to 
>give it a complete list or you might use it in conjunction with 
>fs-traverse (see `man portfile`).
>

I'm struggling with this.  Did I mention I'm new to MacPorts AND tcl? 
;)  What I've got so far is this:

post-configure {
    	fs-traverse myfile ${configure.dir} {
			if  { [ file tail $myfile ] == "Makefile" } {
#				ui_info "Removing any spurious -L 
from ${myfile}"
				reinplace "s/ -L / /g" ${myfile}
        	}
    	}
}

The trouble is that it does the reinplace on less than half the 20 or 
so files that need it.

BTW, in debug output, it spews the following for every file that it fixes.

>DEBUG: Executing proc-post-org.macports.configure-configure-0
>DEBUG: euid/egid changed to: 0/0
>DEBUG: chowned 
>/opt/local/var/macports/build/_Users_craigtreleaven_MacPortsTemp_Myth.25/mythtv/work/mythtv-v0.25-rc-0-g92f7d1f/mythtv/Makefile 
>to macports
>DEBUG: euid/egid changed to: 506/502
>DEBUG: euid/egid changed to: 0/0
>DEBUG: setting attributes on 
>/opt/local/var/macports/build/_Users_craigtreleaven_MacPortsTemp_Myth.25/mythtv/work/mythtv-v0.25-rc-0-g92f7d1f/mythtv/Makefile
>DEBUG: euid/egid changed to: 506/502
>DEBUG: euid/egid changed to: 0/0
>DEBUG: chowned 
>/opt/local/var/macports/build/_Users_craigtreleaven_MacPortsTemp_Myth.25/mythtv/work/mythtv-v0.25-rc-0-g92f7d1f/mythtv/bindings/perl/Makefile 
>to macports
>DEBUG: euid/egid changed to: 506/502
>DEBUG: euid/egid changed to: 0/0
>DEBUG: setting attributes on 
>/opt/local/var/macports/build/_Users_craigtreleaven_MacPortsTemp_Myth.25/mythtv/work/mythtv-v0.25-rc-0-g92f7d1f/mythtv/bindings/perl/Makefile
>DEBUG: euid/egid changed to: 506/502

I noticed the ".asroot" whatchamacallit but I don't seem to be able 
to add that to post-configure.  Is there some way to run the whole 
segment with appropriate permissions?

Thanks for the hand-holding!

Craig



More information about the macports-dev mailing list