]> code.ossystems Code Review - openembedded-core.git/commit
oe.types: give the regex type more sane semantics
authorChristopher Larson <chris_larson@mentor.com>
Wed, 16 May 2012 01:26:25 +0000 (20:26 -0500)
committerSaul Wold <sgw@linux.intel.com>
Thu, 17 May 2012 16:42:55 +0000 (19:42 +0300)
commitdc7e4a79d9a1884b4c5705ef3173613958204b50
tree64de9725f37fdf5614ff5477144438adcc4ae71e
parent3c18344e8a6a4a0b7aad1d1322d02ab8accc9db1
oe.types: give the regex type more sane semantics

Currently, if a variable is unset or has an empty value, the regex type
will return a match object which always matches. Not all variable types
will necessarily have the same behavior for handling defaults. I believe
that returning a match object which matches nothing when a variable is
unset is superior to returning one which matches anything, and the user
can always explicitly request anything via '.*', if that's what they
want.

This constructs a null pattern object which will never match, and uses
it when encountering an unset or empty variable (currently, these two
things are one and the same, as maketype is handling the default. we may
well want to shift that logic into the individual types, giving them
more control over default behavior, but currently the behavior is at
least relatively consistent -- no difference between unset and empty
variables).

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
meta/lib/oe/types.py