Skip to content

Commit

Permalink
Add dh_python3_params to override_dh_python3.
Browse files Browse the repository at this point in the history
  • Loading branch information
nuclearsandwich committed Apr 21, 2022
1 parent 675ac02 commit b747e71
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions stdeb/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -1012,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 @@ -1199,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 @@ -1674,7 +1680,7 @@ def build_dsc(debinfo,
"""
RULES_OVERRIDE_PYTHON3 = """
override_dh_python3:
dh_python3
dh_python3 %(dh_python3_params)
%(scripts)s
"""

Expand Down

0 comments on commit b747e71

Please sign in to comment.