summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2020-03-28 14:28:54 +0100
committerwolfbeast <mcwerewolf@wolfbeast.com>2020-03-28 14:40:49 +0100
commit2dfd75f7f8addc0fa2e892824d31d0f6c00cbf25 (patch)
treeef6f4e29636cfeb6dba8701c745fe851b396044b
parente9723a6fdbf15f7d61b5a32b0931507ee2cb772e (diff)
downloaduxp-2dfd75f7f8addc0fa2e892824d31d0f6c00cbf25.tar.gz
Issue #1497 Revert "MoonchildProductions#1251 - Part 19"
"Make the unpreprocessed file script work on Solaris." This reverts commit e51afbcc2fe7360bbcf5654f6e31752c48098ca0.
-rw-r--r--python/mozbuild/mozbuild/mach_commands.py11
1 files changed, 3 insertions, 8 deletions
diff --git a/python/mozbuild/mozbuild/mach_commands.py b/python/mozbuild/mozbuild/mach_commands.py
index 5933a5aa98..43c189dd97 100644
--- a/python/mozbuild/mozbuild/mach_commands.py
+++ b/python/mozbuild/mozbuild/mach_commands.py
@@ -544,14 +544,9 @@ class Build(MachCommandBase):
# Check if there are any unpreprocessed files in '@MOZ_OBJDIR@/dist/bin'
# See python/mozbuild/mozbuild/preprocessor.py#L293-L309 for the list of directives
# We skip if, ifdef, ifndef, else, elif, elifdef and elifndef, because they are never used alone
- #
- # The original version of this script only worked with GNU grep because of the --include flag.
- # Not a problem in and of itself, except that it didn't take TOOLCHAIN_PREFIX and simply assumed
- # all operating systems use GNU grep as the system grep (often it's called ggrep or something).
- # This script is a bit slower, but should do the same thing on all Unix platforms.
-
- grepcmd = 'find ' + self.topobjdir + '/dist/bin' + ' -name \'\*.{css,dtd,html,js,jsm,xhtml,xml,xul,manifest,properties,rdf}\' ' + '| xargs grep -E "^(#|%)(define|endif|error|expand|filter|include|literal|undef|unfilter)" '\
- + '| awk "/\.css:%/ || (!/\.css/ && /:#/)"'
+ grepcmd = 'grep -E -r "^(#|%)(define|endif|error|expand|filter|include|literal|undef|unfilter)" '\
+ + '--include=\*.{css,dtd,html,js,jsm,xhtml,xml,xul,manifest,properties,rdf} '\
+ + self.topobjdir + '/dist/bin | awk "/\.css:%/ || (!/\.css/ && /:#/)"'
grepresult = subprocess.Popen(grepcmd, stdout=subprocess.PIPE, shell=True).communicate()[0]
if grepresult:
print('\nERROR: preprocessor was not applied to the following files:\n\n' + grepresult)