On 5/20/23 at 10:36 AM, Robert Kennedy wrote:
> It looks like I can tell whether a port is installed and get the version of a
> installed port in question via the MacPorts registry API. But I do not see
> any docs on how to use the MacPorts registry API in a Portfile.
>
> Once I know whether a port is installed and its version number, I should be
> able to use conflcts_build-append in a tcl block in the Portfile (e.g. in a
> pre-configure{} or pre-build{} block. pre-configure{} probably makes the
> most sense).
>
> Can someone point me to some docs on how to use the MacPorts registry API or
> to some example Portfiles?
>
> Rob
>
> ________________________________
> From: macports-dev <[email protected]> on behalf of
> Robert Kennedy <[email protected]>
> Sent: May 20, 2023 9:47 AM
> To: [email protected] <[email protected]>
> Subject: Need Help with the "conflicts_build" PortGroup
>
> I am upgrading a port where only certain installed releases will prevent the
> building of the upgraded port.
>
> Is there a way to use conflicts_build from the conflicts_build PortGroup with
> only certain installed releases? Maybe it could be done by using a pre-build
> {} tcl block?
>
> Is there a global variable available that is set to the installed version
> number?
> And is there an easy way to tell if a port is already installed before
> upgrading?
>
> Rob
This sounds like what the “deactivate hack” is for:
https://trac.macports.org/wiki/PortfileRecipes#deactivatehack
Some ports use this to forcibly deactivate older versions of a port; no need
for conflicts_build.
Christopher