combining directories / moving files within Portfile

Michael Dickens michaelld at macports.org
Fri Jul 21 02:59:16 UTC 2017


On Thu, Jul 20, 2017, at 10:46 AM, Rainer Müller wrote:
> On 2017-07-19 23:09, Michael Dickens wrote:
> > I have an issue with SIP that needs to be addressed, that I'm not sure
> > how do execute in port via Portfiles. I have a solution, but it's kinda
> > a hack.
> 
> This confused me a lot as I first assumed you are talking about
> System Integrity Protection... :-)

LOL

> > My Hack
> > ---
> > My "hack" is to have SIP check in pre-activate for the directory
> > "$prefix/share/pyXY-sip/" and if found then create an archive of its
> > contents (into /tmp/something.tar), and "cd $prefix/share && rm -rf
> > pyXY-sip". Then the 'activate' takes place, which creates the symlink to
> > the "$PYTHON_PREFIX/share/sip/$subport" directory. Then in post-activate
> > check for the archive & if found restore the contents into the directory
> > "$PYTHON_PREFIX/share/sip/" && remove the archive.
> 
> These files would no longer be properly attributed to the port in the
> registry, so they might be left behind on uninstall.

The registry seemed OK with the move, since port follows links correctly
for installing or removing files. That said, I can't do "port provides
..." on any of those files any longer, but I don't care since they will
be dealt with via their port upgrades anyway.

> It sounds like you need the deactivate hack that is already in use for
> some ports that needed to replace files:
> https://trac.macports.org/wiki/PortfileRecipes#deactivatehack
> 
> I would deactivate all ports known to install files there in a
> pre-activate phase in the main sip port.

Yes! That's the trick.

Instead of deactivating all ports known to install files there, is there
a way to query the registry for which port owns the files present (e.g.,
"port provides ..." except in TCL registry function calls)? - MLD


More information about the macports-dev mailing list