1
0
mirror of https://github.com/roytam1/UXP.git synced 2026-05-26 13:58:49 +00:00
Files
UXP/python
athenian200 362f15fbfc 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.
2019-11-04 11:53:54 +08:00
..

This directory contains common Python code.

The basic rule is that if Python code is cross-module (that's "module" in the
Mozilla meaning - as in "module ownership") and is MPL-compatible, it should
go here.

What should not go here:

* Python that is not MPL-compatible (see other-licenses/)
* Python that has good reason to remain close to its "owning" (Mozilla)
  module (e.g. it is only being consumed from there).

Historical information can be found at
https://bugzilla.mozilla.org/show_bug.cgi?id=775243

## pyyaml | pystache

Used in taskcluster related mach commands to update download from github
and remove .git and tests.

Then run tests in taskcluster/tests/