cpython: 2def9ef683da (original) (raw)

Mercurial > cpython

changeset 78894:2def9ef683da 2.7

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 18:47:27 -0700
parents 79f6d4aff39d
children 27837a33790d
files Lib/lib2to3/pgen2/driver.py Makefile.pre.in Misc/NEWS
diffstat 3 files changed, 23 insertions(+), 4 deletions(-)[+] [-] Lib/lib2to3/pgen2/driver.py 17 Makefile.pre.in 8 Misc/NEWS 2

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):

+

+ +if name == "main":

--- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -887,8 +887,6 @@ LIBSUBDIRS= lib-tk lib-tk/test lib-tk/te lib-old [](#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) - ./$(BUILDPYTHON) -Wi -t -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) @@ -966,6 +964,10 @@ libinstall: build_all (srcdir)/Lib/(srcdir)/Lib/(srcdir)/Lib/(PL ./$(BUILDPYTHON) -Wi -t -O (DESTDIR)(DESTDIR)(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) + ./$(BUILDPYTHON) -m lib2to3.pgen2.driver (DESTDIR)(DESTDIR)(DESTDIR)(LIBDEST)/lib2to3/Grammar.txt + -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) [](#l2.18) + ./$(BUILDPYTHON) -m lib2to3.pgen2.driver (DESTDIR)(DESTDIR)(DESTDIR)(LIBDEST)/lib2to3/PatternGrammar.txt

Create the PLATDIR source directory, if one wasn't distributed..

(srcdir)/Lib/(srcdir)/Lib/(srcdir)/Lib/(PLATDIR): @@ -1203,7 +1205,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 profile-removal: find . -name '.gc??' -exec rm -f {} ';'

--- a/Misc/NEWS +++ b/Misc/NEWS @@ -388,7 +388,7 @@ Build