<div dir="ltr">Hi Rainer,<div><br></div><div>Do you have a suggestion of how to accomplish that? That could potentially be a simpler approach than adding include guards.</div><div><br></div><div>If we do go with include guards, anyone want to comment on my particular implementation?</div><div><br></div><div><div>Index: dports/_resources/port1.0/group/active_variants-1.1.tcl</div><div>===================================================================</div><div>--- dports/_resources/port1.0/group/active_variants-1.1.tcl     (revision 141271)</div><div>+++ dports/_resources/port1.0/group/active_variants-1.1.tcl     (working copy)</div><div>@@ -87,6 +87,12 @@</div><div> #     dependencies, e.g., require_active_variants path:foo/bar:standardport</div><div> #     variant</div><div> </div><div>+default active_variants_included {}</div><div>+</div><div>+# only include this PortGroup once</div><div>+if {${active_variants_included} == &quot;&quot;} {</div><div>+    set active_variants_included &quot;yes&quot;</div><div>+</div><div> proc active_variants {depspec required {forbidden {}}} {</div><div>        # get the port which will provide $depspec; this allows us to support e.g.,</div><div>        # path-style dependencies. This comes from port1.0/portutil.tcl and should</div><div>@@ -278,3 +284,5 @@</div><div> pre-activate {</div><div>         _check_require_active_variants activate</div><div> }</div><div>+</div><div>+}</div></div><div><br>David</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Oct 14, 2015 at 9:19 AM, Rainer Müller <span dir="ltr">&lt;<a href="mailto:raimue@macports.org" target="_blank">raimue@macports.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 2015-10-14 05:49, Ryan Schmidt wrote:<br>
&gt; You&#39;re right, it&#39;s probably important for portgroup to guard against multiple inclusion.<br>
&gt;<br>
&gt; <a href="https://en.wikipedia.org/wiki/Include_guard" rel="noreferrer" target="_blank">https://en.wikipedia.org/wiki/Include_guard</a><br>
&gt;<br>
&gt; &quot;port lint&quot; will warn you if you include a portgroup more than once, but that won&#39;t check portgroup inclusion in files other than the portfile itself, can give false positives for portgroups that are included in conditionals (including subports), and even ignores lines with leading whitespace.<br>
&gt;<br>
&gt; We should develop a standard include guard for portgroups (possibly the one you suggested) and use it in every portgroup.<br>
<br>
If we decide that there is no use case for including a port group<br>
multiple times, we could prevent this in base when evaluating PortGroup<br>
statements.<br>
<br>
Rainer<br>
_______________________________________________<br>
macports-dev mailing list<br>
<a href="mailto:macports-dev@lists.macosforge.org">macports-dev@lists.macosforge.org</a><br>
<a href="https://lists.macosforge.org/mailman/listinfo/macports-dev" rel="noreferrer" target="_blank">https://lists.macosforge.org/mailman/listinfo/macports-dev</a><br>
</blockquote></div><br></div>