Skip to content

Instantly share code, notes, and snippets.

@splbio
Created April 17, 2014 06:42
Show Gist options
  • Save splbio/10958423 to your computer and use it in GitHub Desktop.
Save splbio/10958423 to your computer and use it in GitHub Desktop.
radio killed the port star
diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk
index c56f7e0..120957f 100644
--- a/Mk/bsd.port.mk
+++ b/Mk/bsd.port.mk
@@ -5911,17 +5911,34 @@ OPTIONS_WRONG_SINGLE+= ${single}
.endfor
.undef single
+#
+# Iterate through each OPTIONS_RADIO
+# Check to see if there are multiple options specified in PORT_OPTIONS
+# for a single radio.
+#
+# If so, build up an error string noting the offending radio and options
+# to be emitted later.
+#
.for radio in ${OPTIONS_RADIO}
. for opt in ${OPTIONS_RADIO_${radio}}
. if !empty(PORT_OPTIONS:M${opt})
. if defined(OPTFOUND)
-OPTIONS_WRONG_RADIO+= ${radio}
+. if !defined(SECONDOPT)
+OPTIONS_WRONG_RADIO:= ${OPTIONS_WRONG_RADIO}${radio}(options:${OPTFOUND},${opt}
+SECONDOPT= true
+. else
+OPTIONS_WRONG_RADIO:= ${OPTIONS_WRONG_RADIO},${opt}
+. endif
. else
-OPTFOUND= true
+OPTFOUND:= ${opt}
. endif
. endif
. endfor
+. if defined(SECONDOPT)
+OPTIONS_WRONG_RADIO:= ${OPTIONS_WRONG_RADIO})
+. endif
. undef OPTFOUND
+. undef SECONDOPT
.endfor
.for multi in ${OPTIONS_MULTI}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment