An expression like self.spec.find_tag('!BuildRequires') is supposed to return a list of dependencies. However, if the dependency contains spaces, it's returned as a list of chunks, separated on space.
Happens e. g. when parsing the standard perl dependency {{{ Requires: perl(:MODULE_COMPAT_%(eval "%{__perl} -V:version"; echo $version)) }}} returning a list of five chunks.
%{__perl} -V:version
Generally, this is not that easy. Dependencies are separated by ',' and newlines, but a ',' in a quoted string or within parenthesis should not split. Practically, splitting on ',' is still much better than current algorithm.
Current behaviour also split expressions like 'bzip2-devel%{_isa} >= 0.9.0c-2'. How can this have survived for three releases?
Added new functions get_requires and get_build_requires to spec_file using rpmspec -q --requires/buildrequires i 35f4ed0eccb5cb03b
This does '''not''' close bug, all usage of spec_file.find_tag() must be reviewed since this function is badly broken, not just in the BuildRequires/requires cases.
Fixed in a24379b2b2988a525b0de