[pypy-commit] pypy default: try harder to find license info on windows
mattip
noreply at buildbot.pypy.org
Fri Sep 19 13:43:24 CEST 2014
Author: mattip <matti.picus at gmail.com>
Branch:
Changeset: r73612:0cfa9e069a4c
Date: 2014-09-19 14:29 +0300
http://bitbucket.org/pypy/pypy/changeset/0cfa9e069a4c/
Log: try harder to find license info on windows
diff --git a/pypy/tool/release/package.py b/pypy/tool/release/package.py
--- a/pypy/tool/release/package.py
+++ b/pypy/tool/release/package.py
@@ -297,7 +297,13 @@
argparse = imp.load_source('argparse', 'lib-python/2.7/argparse.py')
if sys.platform == 'win32':
pypy_exe = 'pypy.exe'
- license_base = os.path.join(basedir, r'..\..\..\local') # as on buildbot YMMV
+ for p in [os.path.join(basedir, r'..\..\..\local'), #buildbot
+ os.path.join(basedir, r'..\local')]: # pypy/doc/windows.rst
+ if os.path.exists(p):
+ license_base = p
+ break
+ else:
+ license_base = 'unkown'
else:
pypy_exe = 'pypy'
license_base = '/usr/share/doc'
diff --git a/pypy/tool/release/test/test_package.py b/pypy/tool/release/test/test_package.py
--- a/pypy/tool/release/test/test_package.py
+++ b/pypy/tool/release/test/test_package.py
@@ -115,15 +115,21 @@
check(pypy, 0755)
def test_generate_license():
- from os.path import dirname, abspath, join
+ from os.path import dirname, abspath, join, exists
class Options(object):
pass
options = Options()
basedir = dirname(dirname(dirname(dirname(dirname(abspath(__file__))))))
options.no_tk = False
if sys.platform == 'win32':
- # as on buildbot YMMV
- options.license_base = join(basedir, r'..\..\..\local')
+ for p in [join(basedir, r'..\..\..\local'), #buildbot
+ join(basedir, r'..\local')]: # pypy/doc/windows.rst
+ if exists(p):
+ license_base = p
+ break
+ else:
+ license_base = 'unkown'
+ options.license_base = license_base
else:
options.license_base = '/usr/share/doc'
license = package.generate_license(py.path.local(basedir), options)
More information about the pypy-commit
mailing list