Fix multiple execution of python do ... end blocks

Only run the `python do ... end` loop once even if
multiple `depends_on :python => 'module-name'` are
present.
This commit is contained in:
Samuel John 2013-07-15 21:28:37 +02:00
parent 6b299c4207
commit e143c3a799

View File

@ -39,7 +39,8 @@ def python_helper(options={:allowed_major_versions => [2, 3]}, &block)
if !filtered_python_reqs.map{ |fpr| fpr.binary }.include?(py.binary) &&
py.satisfied? &&
options[:allowed_major_versions].include?(py.version.major) &&
self.build.with?(py.name) || !(py.optional? || py.recommended?)
# if optional or recommended then check the build.with?
(self.build.with?(py.name) || !(py.optional? || py.recommended?))
then
filtered_python_reqs << py
end