bug 361583, support filter commandline argument, and use it from packager.mk, r=bsmedberg
authoraxel@pike.org
Fri, 13 Apr 2007 16:43:36 -0700
changeset 525 480693369f076143d4a022a5e0657373a4128555
parent 524 7f326b1517962ed931aeca24c9591bd9b3af14c6
child 526 0da64bbc757f0c0ff18f8a34a4100ab36d826fa2
push idunknown
push userunknown
push dateunknown
reviewersbsmedberg
bugs361583
milestone1.9a4pre
bug 361583, support filter commandline argument, and use it from packager.mk, r=bsmedberg
config/Preprocessor.py
toolkit/mozapps/installer/packager.mk
--- 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)