<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
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. 
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof ContentPasted0">
Once I know whether a port is installed and its version number, I should be able to use
<b>conflcts_build-append</b> in a tcl block in the Portfile (e.g. in a <b>pre-configure{}</b> or
<b>pre-build{} </b>block.  <b>pre-configure{}</b> probably makes the most sense).</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof ContentPasted0">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof ContentPasted0">
Can someone point me to some docs on how to use the MacPorts registry API or to some example Portfiles?<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof ContentPasted0">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof ContentPasted0">
Rob<br>
</div>
<div id="appendonsend"></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size: 11pt; color: rgb(0, 0, 0);" face="Calibri, sans-serif"><b>From:</b> macports-dev <macports-dev-bounces@lists.macports.org> on behalf of Robert Kennedy <amtor@hotmail.com><br>
<b>Sent:</b> May 20, 2023 9:47 AM<br>
<b>To:</b> macports-dev@lists.macports.org <macports-dev@lists.macports.org><br>
<b>Subject:</b> Need Help with the "conflicts_build" PortGroup</font>
<div> </div>
</div>
<div dir="ltr">
<div class="x_elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I am upgrading a port where only certain installed releases will prevent the building of the upgraded port.
<br>
</div>
<div class="x_elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="x_elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Is there a way to use <b>conflicts_build</b> from the <b>conflicts_build PortGroup</b> with only certain installed releases?  Maybe it could be done by using a
<b>pre-build {}</b> tcl block?</div>
<div class="x_elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="x_elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Is there a global variable available that is set to the installed version number? 
<br>
</div>
<div class="x_elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
And is there an easy way to tell if a port is already installed before upgrading?</div>
<div class="x_elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="x_elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Rob</div>
<div class="x_elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
</div>
</body>
</html>