[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r1487954 - /subversion/trunk/build/generator/gen_base.py

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: Fri, 31 May 2013 13:52:44 +0100 (BST)

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
Received on 2013-05-31 14:54:44 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.