Bert Huijben wrote:

>>  Author: julianfoad
>>  URL: http://svn.apache.org/r1487954
>>  Log:
>>  * build/generator/gen_base.py
>>    (TargetLinked): Remove some redundant and wrong code.
>>    (_collect_paths): Document what happens if the pattern is not found.
>> 
>>  Modified: subversion/trunk/build/generator/gen_base.py
>>  ==========================================================
>>  @@ -471,10 +471,9 @@ class TargetLinked(Target):
>>       # the specified install area depends upon this target
>>       self.gen_obj.graph.add(DT_INSTALL, self.install, self)
>> 
>>  -    sources = sorted(_collect_paths(self.sources or '*.c' or '*.cpp', 
>> self.path))
>>  +    sources = sorted(_collect_paths(self.sources, self.path))
> 
> I don't understand the use of the "or '*.cpp'" part as 
> that code appears to dead,

Exactly: the "or '*.cpp'" would never be executed, so it was a mistake by 
whoever wrote it.

> but the "or '*.c'" would be used if 
> self.sources would evaluate to false and otherwise the self.sources value.

It's redundant because 'self.sources' never has an empty value at this point, 
because the defaulting is done earlier on by this code (which was not visible 
in the diff):

  def __init__(self, name, options, gen_obj):
    [...]
    self.sources = options.get('sources', '*.c *.cpp')

- Julian

Reply via email to