Commits (4)
......@@ -112,4 +112,6 @@ Description: in-depth comparison of files, archives, and directories
compare two tarballs, ISO images, or PDF just as easily. The differences can
be shown in a text or HTML report.
.
${diffoscope:Description}
.
diffoscope is developed as part of the “reproducible builds” project.
......@@ -69,7 +69,7 @@ override_dh_auto_clean:
@echo "# EDIT debian/tests/control.in INSTEAD!" >> debian/tests/control.tmp
@echo "#" >> debian/tests/control.tmp
@cat debian/tests/control.in >> debian/tests/control.tmp
@sed -i "s#%RECOMMENDS%#$(shell bin/diffoscope --list-debian-substvars | cut -d= -f2)#" debian/tests/control.tmp
@sed -i "s#%RECOMMENDS%#$(shell bin/diffoscope --list-debian-substvars | awk -F= '/diffoscope:Recommends/ { print $$2 }')#" debian/tests/control.tmp
@sed -i "s#%PYRECOMMENDS%#$(shell python3 -c "import distutils.core; \
setup = distutils.core.run_setup('setup.py'); \
print(', '.join(sorted(['python3-{}'.format(x) for y in setup.extras_require.values() for x in y])))" \
......
......@@ -152,9 +152,14 @@ class ComparatorManager:
logger.debug("Loaded %d comparator classes", len(self.classes))
def get_descriptions(self):
for x in self.classes:
try:
yield x.DESCRIPTION
except AttributeError:
pass
def format_descriptions(self):
def gen_descriptions():
for x in self.classes:
try:
yield x.DESCRIPTION
except AttributeError:
pass
xs = list(sorted(set(gen_descriptions())))
return '{} and {}.\n'.format(', '.join(xs[:-1]), xs[-1])
......@@ -474,12 +474,9 @@ class HelpFormatter(argparse.HelpFormatter):
title, textwrap.indent(wrapped, ' ' * indent)
)
descriptions = list(sorted(ComparatorManager().get_descriptions()))
append(
'file formats supported',
'{} and {}.\n'.format(
', '.join(descriptions[:-1]), descriptions[-1]
),
ComparatorManager().format_descriptions(),
)
append('diffoscope homepage', '<https://diffoscope.org/>')
......@@ -581,6 +578,13 @@ class ListDebianSubstvarsAction(argparse._StoreTrueAction):
for x in ('gzip', 'tar', 'coreutils', 'diffutils', 'findutils'):
packages.discard(x)
description = 'File formats supported include: {}'.format(
ComparatorManager().format_descriptions(),
)
wrapped = '${Newline}'.join(textwrap.wrap(description, 79))
wrapped = wrapped.replace('${Newline}.', '${Newline}')
print('diffoscope:Description={}'.format(wrapped))
print('diffoscope:Recommends={}'.format(', '.join(sorted(packages))))
sys.exit(0)
......