The generic rule is "do not do this" Ports are all intended to work with the current other ports as distributed by MacPorts - when you install or upgrade a port MacPorts will walk the dependency tree and install or upgrade all of the necessary things first, so your port can assume the 'current' version of things it declares to be installed.
> On May 20, 2023, at 11:35 AM, Robert Kennedy <[email protected]> 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 -- Daniel J. Luke
