Closed
Bug 1491931
Opened 7 years ago
Closed 7 years ago
FileFinder matching files that don't end with specified extension (e.g **/*.html)
Categories
(Firefox Build System :: General, defect)
Firefox Build System
General
Tracking
(Not tracked)
RESOLVED
INVALID
People
(Reporter: ahal, Unassigned)
Details
Attachments
(1 file)
|
238 bytes,
text/x-python
|
Details |
I believe I found a bug in the FileFinder matching algorithm (but there's a chance it's expected behaviour).
Essentially with the pattern "**/*.bar", it'll match files like this:
a/b/foo.bar/c.txt
I'd expect that pattern to imply .bar is at the end. If this behavious is actually correct, is there a way to specify EOL? This came up in the real world when I was trying to find html files under 'devtools/client/responsive.html/'.
STR:
Run the attached script from topsrcdir:
$ ./mach python test.py
Comment 1•7 years ago
|
||
**/*.bar matches the a/b/foo.bar directory, which then expands to all its contents. That's how it works. If you want html files under devtools/client/responsive.html/, use devtools/client/responsive.html/**/*.html.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → INVALID
| Reporter | ||
Comment 2•7 years ago
|
||
I guess that makes some sense, though intuitively I'd expect the pattern "**/*.html/**" to be required to match files contained by responsive.html. I'm trying to find every html file in the tree, so it looks like the only way to accomplish this is to post-process the result and manually remove non-html files.
But even if this is working as designed, I think it's worth re-opening. The pattern "**/*.ext" is used to find files by extension in several places:
https://searchfox.org/mozilla-central/search?q=%22**%2F*.&case=true®exp=false&path=
And I'm not sure the authors of all of those are aware that they might be getting more files than they bargained for. There's even a **/*.html in a moz.build in there which is likely applying metadata incorrectly to all the files under responsive.html.
You need to log in
before you can comment on or make changes to this bug.
Description
•