scons icon indicating copy to clipboard operation
scons copied to clipboard

Refactor Glob() and FindFile()

Open bdbaddog opened this issue 7 years ago • 1 comments

This issue was originally created at: 2008-08-28 01:29:24. This issue was reported by: gregnoel.

gregnoel said at 2008-08-28 01:29:25

Glob() and FindFile() have a number of common logical elements, yet they have completely independent implementations. They should be refactored to share code where possible.

One possibility would be to add a dirs= optional parameter to Glob() so that it acts the same as FindFiles. Then FindFiles could be deprecated in favor of Glob(), which would simpify things all around.

gregnoel said at 2008-09-02 14:33:47

Bug party triage.

gregnoel said at 2009-04-15 20:28:30

Copied from issue #2398; it's not obvious from the comments above that this issue is intended to fix the problem described there.

Russel Winder sez:

Glob follows glob.glob and allows globbing -- which is not surprising given the name of the function. So for example *~ or x_*_y.chpl.

Ant allows for a recursive glob pattern, for example **/*~ -- the ** is not treated as two instances of the glob character but as a special token. The basic globbing is the same but the ** instructs there to be a recursive tree walk.

Adding this Ant-style extension to the Glob function would be incredibly useful and should be fairly easy to implement -- and it would save having to explicitly write a wrapper to the standard Python tree walk function to achieve the goal.

gregnoel said at 2009-04-15 20:29:27

*** Issue 2398 has been marked as a duplicate of this issue. ***

garyo said at 2012-09-01 10:04:01

de-assigning all tickets assigned to Greg Noel (no longer working on SCons)

gregnoel said this issue is duplicated by #2398 at 2009-04-15 20:29:27.

bdbaddog avatar Jan 02 '18 12:01 bdbaddog

The #2398 stuff copied here was not really a duplicate - but note #3851 now exists to track the recursive-glob request.

mwichmann avatar May 27 '22 15:05 mwichmann