Requirement: callers are responsible for invoking #satisfied?
This hack was necessary since requirements were not checked again in the forked build process, but now they are, and calling it again after the build environment has been set up can produce incorrect results. In fact, if it happens to return false the second time, the env modification will be skipped altogether.
This commit is contained in:
parent
371c1acfe4
commit
553b1a0dbb
@ -43,8 +43,10 @@ class Requirement
|
||||
|
||||
# Overriding #modify_build_environment is deprecated.
|
||||
# Pass a block to the the env DSL method instead.
|
||||
# Note: #satisfied? should be called before invoking this method
|
||||
# as the env modifications may depend on its side effects.
|
||||
def modify_build_environment
|
||||
satisfied? and env.modify_build_environment(self)
|
||||
env.modify_build_environment(self)
|
||||
end
|
||||
|
||||
def env
|
||||
|
||||
@ -81,6 +81,7 @@ class RequirementTests < Test::Unit::TestCase
|
||||
ENV.expects(:userpaths!)
|
||||
ENV.expects(:append).with("PATH", which_path.parent, ":")
|
||||
|
||||
req.satisfied?
|
||||
req.modify_build_environment
|
||||
end
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user