Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add configuration file option for passing parameters to dh_python3. #186

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -778,6 +778,7 @@ All available options:
Udev-Rules file with rules to install to udev
Python2-Depends-Name override Python 2 Debian package name in
${python:Depends}
Dh-python3-params parameters passed to dh_python3
====================================== =========================================

The option names in stdeb.cfg files are not case sensitive.
Expand Down
13 changes: 10 additions & 3 deletions stdeb/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ def check_call(*popenargs, **kwargs):
('udev-rules=', None, 'file with rules to install to udev'),
('python2-depends-name=', None,
'Python 2 Debian package name used in ${python:Depends}'),
('dh-python3-params=', None, 'parameters passed to dh_python3'),
]

stdeb_cmd_bool_opts = [
Expand Down Expand Up @@ -1011,6 +1012,8 @@ def __init__(self,
self.dh_binary_arch_lines = '\tdh binary-arch'
self.dh_binary_indep_lines = '\tdh binary-indep'

dh_python3_params = parse_val(cfg, module_name, 'dh-python3-params')

conflicts = parse_vals(cfg, module_name, 'Conflicts')
conflicts3 = parse_vals(cfg, module_name, 'Conflicts3')
breaks = parse_vals(cfg, module_name, 'Breaks')
Expand Down Expand Up @@ -1198,18 +1201,22 @@ def __init__(self,
'scripts': scripts
}

scripts = ''
if force_x_python3_version and with_python3 and x_python3_version and \
x_python3_version[0]:
# override dh_python3 target to modify the dependencies
# to ensure that the passed minimum X-Python3-Version is usedby
version = x_python3_version[0]
if not version.endswith('~'):
version += '~'
self.override_dh_python3 = RULES_OVERRIDE_PYTHON3 % {
'scripts': (
scripts = (
' sed -i ' +
r'"s/\([ =]python3:any (\)>= [^)]*\()\)/\\1%s\\2/g" ' +
'debian/%s.substvars') % (version, self.package3)
if len(scripts) or len(dh_python3_params):
self.override_dh_python3 = RULES_OVERRIDE_PYTHON3 % {
'scripts': scripts,
'dh_python3_params': dh_python3_params,
}
else:
self.override_dh_python3 = ''
Expand Down Expand Up @@ -1673,7 +1680,7 @@ def build_dsc(debinfo,
"""
RULES_OVERRIDE_PYTHON3 = """
override_dh_python3:
dh_python3
dh_python3 %(dh_python3_params)s
%(scripts)s
"""

Expand Down