aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools
diff options
context:
space:
mode:
authorGravatar Andrew Jorgensen <andrew@andrewjorgensen.com>2016-01-12 08:54:54 +0000
committerGravatar Damien Martin-Guillerez <dmarting@google.com>2016-01-12 14:26:12 +0000
commit8d64a6c130dbfafa89159fa795877822ad645437 (patch)
tree8b202432c8dadce95a7d57cbc97d5838af2866a3 /tools
parent7e8a284cb87d5f4bcb4653e65b00915b0104ccc3 (diff)
Don't break long words for debian control fields
By default wrapping can split on `-` characters which creates the chance that any dependency with a `-` in it that falls near the wrap threshold will get split along two lines and render the control file invalid. > Text is preferably wrapped on whitespaces and right after the hyphens > in hyphenated words; only then will long words be broken if necessary, > unless TextWrapper.break_long_words is set to false. https://docs.python.org/3.1/library/textwrap.html#textwrap.TextWrapper.break_long_words Fixes #772. -- Reviewed-on: https://github.com/bazelbuild/bazel/pull/777 MOS_MIGRATED_REVID=111925490
Diffstat (limited to 'tools')
-rw-r--r--tools/build_defs/pkg/make_deb.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/build_defs/pkg/make_deb.py b/tools/build_defs/pkg/make_deb.py
index db804409ee..6ea859c0b6 100644
--- a/tools/build_defs/pkg/make_deb.py
+++ b/tools/build_defs/pkg/make_deb.py
@@ -101,7 +101,9 @@ def MakeDebianControlField(name, value, wrap=False):
value = ', '.join(value)
if wrap:
result += ' '.join(value.split('\n'))
- result = textwrap.fill(result)
+ result = textwrap.fill(result,
+ break_on_hyphens=False,
+ break_long_words=False)
else:
result += value
return result.replace('\n', '\n ') + '\n'