diff options
author | athenian200 <athenian200@outlook.com> | 2019-10-04 02:59:26 -0500 |
---|---|---|
committer | athenian200 <athenian200@outlook.com> | 2019-10-21 04:53:42 -0500 |
commit | e51afbcc2fe7360bbcf5654f6e31752c48098ca0 (patch) | |
tree | c538455ae1ca6e4cba2e33d57d0dd5658fac1abf /xpcom/reflect/xptcall | |
parent | 7e5ff857eefd66008c78f2bcda62b28316e71f09 (diff) | |
download | UXP-e51afbcc2fe7360bbcf5654f6e31752c48098ca0.tar UXP-e51afbcc2fe7360bbcf5654f6e31752c48098ca0.tar.gz UXP-e51afbcc2fe7360bbcf5654f6e31752c48098ca0.tar.lz UXP-e51afbcc2fe7360bbcf5654f6e31752c48098ca0.tar.xz UXP-e51afbcc2fe7360bbcf5654f6e31752c48098ca0.zip |
MoonchildProductions#1251 - Part 19: Make the unpreprocessed file script work on Solaris.
https://www.tachytelic.net/2019/01/grep-recursively/
During testing, I tried simply replacing grep with ggrep, which was non-portable but worked fine. Using an environment variable with os.getenv set to 'g' also worked, but the problem with that approach is that you have to set it manually and some times the script will mess up if you don't explictly define it to an empty string for platforms that don't need it.
Setting TOOLCHAIN_PREFIX to 'g' seemed to solve all of my problems except this one, and it appears to be the only non-portable use of GNU grep in the whole tree. To understand what I tried to do here, let me present with you with two commands that yield the same output on my machine:
find . -name '*.xul' | xargs grep -E "#include"
ggrep -E -r "#include" --include="*.xul" .
I just tried to make the Python script follow the logic of those two commands, though I'm not sure how well I succeeded since I got no errors. I visualized everything this way:
ggrep -E -r "<strings>" --include="<filesuffixes>" <path>
find <path> -name '<filesuffixes>' | xargs grep -E "<strings>"
And arranged it all accordingly to the best of my ability, though I should point out that Python is not my strong suit.
Diffstat (limited to 'xpcom/reflect/xptcall')
0 files changed, 0 insertions, 0 deletions