License Flag Matching
- The definition of "matching" in reference to a
- recipe's LICENSE_FLAGS setting is simple.
- However, some things exist that you should know about in order to
- correctly and effectively use it.
+ In general, license flag matching is simple.
+ However, understanding some concepts will help you
+ correctly and effectively use matching.
Before a flag
defined by a particular recipe is tested against the
contents of the LICENSE_FLAGS_WHITELIST variable, the
- string _${PN} (with
- PN expanded of course) is
- appended to the flag, thus automatically making each
- LICENSE_FLAGS value recipe-specific.
- That string is
- then matched against the whitelist.
- So if you specify LICENSE_FLAGS = "commercial" in recipe
- "foo" for example, the string "commercial_foo"
- would normally be what is specified in the whitelist in order for it to
- match.
+ expanded string _${PN} is
+ appended to the flag.
+ This expansion makes each LICENSE_FLAGS
+ value recipe-specific.
+ After expansion, the string is then matched against the
+ whitelist.
+ Thus, specifying LICENSE_FLAGS = "commercial"
+ in recipe "foo" for example, results in the string
+ "commercial_foo".
+ And that string would normally be appears in the whitelist
+ in order for a match to occur.
- You can broaden the match by
- putting any "_"-separated beginning subset of a
- LICENSE_FLAGS flag in the whitelist, which will also
- match.
- For example, simply specifying "commercial" in
- the whitelist would match any expanded LICENSE_FLAGS
- definition starting with "commercial" such as
- "commercial_foo" and "commercial_bar", which are the
- strings that would be automatically generated for
- hypothetical "foo" and "bar" recipes assuming those
- recipes had simply specified the following:
+ Judicious use of the LICENSE_FLAGS
+ strings and the contents of the
+ LICENSE_FLAGS_WHITELIST variable
+ allows you a lot of flexibility for matching license
+ flags.
+ For example, you can broaden the matching capabilities by
+ using string subsets from the LICENSE_FLAGS
+ variables in the whitelist.
+ Be sure to use the part of the expanded
+ string that precedes
+ the underscore character (e.g.
+ usethispart_1.3,
+ usethispart_1.4, and so forth).
+
+ For example, simply specifying the string "commercial" in
+ the whitelist matches any expanded
+ LICENSE_FLAGS definition that starts with
+ the string "commercial" such as "commercial_foo" and
+ "commercial_bar", which are the strings the build system
+ automatically generates for hypothetical recipes named
+ "foo" and "bar" assuming those recipes simply specify the
+ following:
LICENSE_FLAGS = "commercial"
- Broadening the match allows for a range of specificity for the items
- in the whitelist, from more general to perfectly
+ Judicious use of the strings with the
+ LICENSE_FLAGS variable and the Broadening the match allows for a range of specificity for the
+ items in the whitelist, from more general to perfectly
specific.
So you have the choice of exhaustively
enumerating each license flag in the whitelist to