From patchwork Tue Mar 8 05:33:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [6,of,6] setup: write mercurial/modulepolicy for pure installs From: timeless@mozdev.org X-Patchwork-Id: 13669 Message-Id: <7c21b7f1e2233ea8d88b.1457415204@waste.org> To: mercurial-devel@mercurial-scm.org Date: Mon, 07 Mar 2016 23:33:24 -0600 # HG changeset patch # User timeless # Date 1452574025 0 # Tue Jan 12 04:47:05 2016 +0000 # Node ID 7c21b7f1e2233ea8d88bcbba9dcee58de7f2e375 # Parent e907f1a7b27764981a1858c2d32396f34230439d setup: write mercurial/modulepolicy for pure installs This file tells the Mercurial loader to use Python libraries, which is what the user wanted when they ran setup --pure. diff --git a/.hgignore b/.hgignore --- a/.hgignore +++ b/.hgignore @@ -58,6 +58,7 @@ mercurial/mpatch.py mercurial/osutil.py mercurial/parsers.py +mercurial/modulepolicy syntax: regexp ^\.pc/ diff --git a/Makefile b/Makefile --- a/Makefile +++ b/Makefile @@ -64,7 +64,7 @@ rm -f $(addprefix mercurial/,$(notdir $(wildcard mercurial/pure/[a-z]*.py))) rm -f MANIFEST MANIFEST.in hgext/__index__.py tests/*.err if test -d .hg; then rm -f mercurial/__version__.py; fi - rm -rf build mercurial/locale + rm -rf build mercurial/locale mercurial/modulepolicy $(MAKE) -C doc clean install: install-bin install-doc diff --git a/setup.py b/setup.py --- a/setup.py +++ b/setup.py @@ -367,6 +367,10 @@ modulepolicy.encode(libdir_escape)) with open(dst, 'wb') as fh: fh.write(content) + else: + policy = os.path.join(os.path.dirname(dst), 'modulepolicy') + with open(policy, 'wb') as fh: + fh.write(modulepolicy) return dst, copied