From 5b30a51b6b67508be646d86bafc786979f21b053 Mon Sep 17 00:00:00 2001 From: Andrew Straw Date: Fri, 20 Mar 2015 14:30:18 +0100 Subject: [PATCH] finish pypy support --- stdeb/command/common.py | 3 +++ stdeb/util.py | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/stdeb/command/common.py b/stdeb/command/common.py index 7dbd8ad4..b2a2bcd1 100644 --- a/stdeb/command/common.py +++ b/stdeb/command/common.py @@ -30,6 +30,7 @@ def initialize_options (self): self.with_pypy = 'False' self.no_python2_scripts = 'False' self.no_python3_scripts = 'False' + self.no_pypy_scripts = 'False' self.allow_virtualenv_install_location = False self.sign_results = False @@ -69,6 +70,7 @@ def str_to_bool(mystr): self.with_pypy = str_to_bool(self.with_pypy) self.no_python2_scripts = str_to_bool(self.no_python2_scripts) self.no_python3_scripts = str_to_bool(self.no_python3_scripts) + self.no_pypy_scripts = str_to_bool(self.no_pypy_scripts) if self.maintainer is not None: # Get the locale specifying the encoding in sys.argv import locale, codecs @@ -220,6 +222,7 @@ def get_debinfo(self): with_pypy = self.with_pypy, no_python2_scripts = self.no_python2_scripts, no_python3_scripts = self.no_python3_scripts, + no_pypy_scripts = self.no_pypy_scripts, allow_virtualenv_install_location=self.allow_virtualenv_install_location, ) return debinfo diff --git a/stdeb/util.py b/stdeb/util.py index 2312abd4..0230e88c 100644 --- a/stdeb/util.py +++ b/stdeb/util.py @@ -105,6 +105,8 @@ def check_call(*popenargs, **kwargs): 'If True, do not install scripts for python 2. (Default=False).'), ('no-python3-scripts=',None, 'If True, do not install scripts for python 3. (Default=False).'), + ('no-pypy-scripts=',None, + 'If True, do not install scripts for pypy. (Default=False).'), ('allow-virtualenv-install-location',None, 'Allow installing into /some/random/virtualenv-path'), ('sign-results',None, @@ -713,6 +715,7 @@ def __init__(self, with_pypy = None, no_python2_scripts = None, no_python3_scripts = None, + no_pypy_scripts = None, allow_virtualenv_install_location=False, ): if cfg_files is NotGiven: raise ValueError("cfg_files must be supplied") @@ -1114,6 +1117,12 @@ def __init__(self, self.exports += '\n' no_script_lines.append( 'rm -rf debian/%s/trash'%(self.package3,)) + if no_pypy_scripts: + # install to a location where debian tools do not find them + self.exports += 'export PYBUILD_INSTALL_ARGS_pypy=--install-scripts=/trash' + self.exports += '\n' + no_script_lines.append( + 'rm -rf debian/%s/trash'%(self.package_pypy,)) self.scripts_cleanup = '\n'.join([' '+s for s in no_script_lines]) @@ -1171,6 +1180,7 @@ def __init__(self, self.with_pypy = with_pypy self.no_python2_scripts = no_python2_scripts self.no_python3_scripts = no_python3_scripts + self.no_pypy_scripts = no_pypy_scripts def _make_cfg_defaults(self, module_name=NotGiven,