cpython: a829889f96b0 (original) (raw)
Mercurial > cpython
changeset 78897:a829889f96b0
Issue #15822: Fix installation of lib2to3 grammar pickles to ensure they are created in the install locations and with the proper timestamp. (Solution suggested by MvL) [#15822]
Ned Deily nad@acm.org | |
---|---|
date | Sat, 08 Sep 2012 19:04:47 -0700 |
parents | 23118b802f83 |
children | 800507fb0a7e |
files | Lib/lib2to3/pgen2/driver.py Makefile.pre.in Misc/NEWS |
diffstat | 3 files changed, 25 insertions(+), 3 deletions(-)[+] [-] Lib/lib2to3/pgen2/driver.py 17 Makefile.pre.in 8 Misc/NEWS 3 |
line wrap: on
line diff
--- a/Lib/lib2to3/pgen2/driver.py +++ b/Lib/lib2to3/pgen2/driver.py @@ -138,3 +138,20 @@ def _newer(a, b): if not os.path.exists(b): return True return os.path.getmtime(a) >= os.path.getmtime(b) + + +def main(*args):
- Calls load_grammar for each argument, a path to a grammar text file.
- """
- if not args:
args = sys.argv[1:][](#l1.15)
- logging.basicConfig(level=logging.INFO, stream=sys.stdout,
format='%(message)s')[](#l1.17)
- for gt in args:
load_grammar(gt, save=True, force=True)[](#l1.19)
- return True
--- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -1024,8 +1024,6 @@ LIBSUBDIRS= tkinter tkinter/test tkinter venv venv/scripts venv/scripts/posix [](#l2.4) curses pydoc_data $(MACHDEPS) libinstall: build_all (srcdir)/Lib/(srcdir)/Lib/(srcdir)/Lib/(PLATDIR) $(srcdir)/Modules/xxmodule.c - -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) [](#l2.7) - $(PYTHON_FOR_BUILD) -Wi -c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()" @for i in (SCRIPTDIR)(SCRIPTDIR) (SCRIPTDIR)(LIBDEST); [](#l2.9) do [](#l2.10) if test ! -d (DESTDIR)(DESTDIR)(DESTDIR)$i; then [](#l2.11) @@ -1103,6 +1101,10 @@ libinstall: build_all (srcdir)/Lib/(srcdir)/Lib/(srcdir)/Lib/(PL (PYTHONFORBUILD)−Wi−O(PYTHON_FOR_BUILD) -Wi -O (PYTHONFORBUILD)−Wi−O(DESTDIR)$(LIBDEST)/compileall.py [](#l2.13) -d $(LIBDEST)/site-packages -f [](#l2.14) -x badsyntax (DESTDIR)(DESTDIR)(DESTDIR)(LIBDEST)/site-packages + -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) [](#l2.16) + (PYTHONFORBUILD)−mlib2to3.pgen2.driver(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver (PYTHONFORBUILD)−mlib2to3.pgen2.driver(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt + -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) [](#l2.18) + (PYTHONFORBUILD)−mlib2to3.pgen2.driver(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver (PYTHONFORBUILD)−mlib2to3.pgen2.driver(DESTDIR)$(LIBDEST)/lib2to3/PatternGrammar.txt
Create the PLATDIR source directory, if one wasn't distributed..
(srcdir)/Lib/(srcdir)/Lib/(srcdir)/Lib/(PLATDIR): @@ -1347,7 +1349,7 @@ clean: pycremoval find . -name '.so.[0-9].[0-9]*' -exec rm -f {} ';' find build -name 'fficonfig.h' -exec rm -f {} ';' || true find build -name 'fficonfig.py' -exec rm -f {} ';' || true - -rm -f $(srcdir)/Lib/lib2to3/Grammar.pickle + -rm -f Lib/lib2to3/Grammar.pickle -rm -f $(SYSCONFIGDATA) -rm -f Modules/_testembed Modules/_freeze_importlib