bug 361583, support filter commandline argument, and use it from packager.mk, r=bsmedberg
--- a/config/Preprocessor.py
+++ b/config/Preprocessor.py
@@ -164,29 +164,33 @@ class Preprocessor:
def handleD(option, opt, value, parser):
vals = value.split('=')
assert len(vals) < 3
if len(vals) == 1:
vals.append(1)
self.context[vals[0]] = vals[1]
def handleU(option, opt, value, parser):
del self.context[value]
+ def handleF(option, opt, value, parser):
+ self.do_filter(value)
def handleLE(option, opt, value, parser):
self.setLineEndings(value)
def handleMarker(option, opt, value, parser):
self.setMarker(value)
p = OptionParser()
p.add_option('-I', action='callback', callback=handleI, type="string",
metavar="FILENAME", help='Include file')
p.add_option('-E', action='callback', callback=handleE,
help='Import the environment into the defined variables')
p.add_option('-D', action='callback', callback=handleD, type="string",
metavar="VAR[=VAL]", help='Define a variable')
p.add_option('-U', action='callback', callback=handleU, type="string",
metavar="VAR", help='Undefine a variable')
+ p.add_option('-F', action='callback', callback=handleF, type="string",
+ metavar="FILTER", help='Enabble the specified filter')
p.add_option('--line-endings', action='callback', callback=handleLE,
type="string", metavar="[cr|lr|crlf]",
help='Use the specified line endings [Default: OS dependent]')
p.add_option('--marker', action='callback', callback=handleMarker,
type="string",
help='Use the specified marker instead of #')
(options, args) = p.parse_args(args=args)
if defaultToStdin and len(args) == 0:
--- a/toolkit/mozapps/installer/packager.mk
+++ b/toolkit/mozapps/installer/packager.mk
@@ -241,17 +241,17 @@ libs:: make-package
endif
DEFINES += -DDLL_PREFIX=$(DLL_PREFIX) -DDLL_SUFFIX=$(DLL_SUFFIX)
ifdef MOZ_PKG_REMOVALS
MOZ_PKG_REMOVALS_GEN = removed-files
$(MOZ_PKG_REMOVALS_GEN): $(MOZ_PKG_REMOVALS) Makefile Makefile.in
- $(PERL) $(topsrcdir)/config/preprocessor.pl -Fsubstitution $(DEFINES) $(ACDEFINES) $(MOZ_PKG_REMOVALS) > $(MOZ_PKG_REMOVALS_GEN)
+ $(PYTHON) $(topsrcdir)/config/Preprocessor.py -Fsubstitution $(DEFINES) $(ACDEFINES) $(MOZ_PKG_REMOVALS) > $(MOZ_PKG_REMOVALS_GEN)
endif
GARBAGE += $(DIST)/$(PACKAGE) $(PACKAGE)
ifeq ($(OS_ARCH),IRIX)
STRIP_FLAGS = -f
endif
ifeq ($(OS_ARCH),BeOS)