The following commit has been merged in the debian-experimental-4.0 branch: commit 38e49eeea02674ff8650371f4777c16355b1593b Author: Benjamin Drung <bdr...@debian.org> Date: Sat Feb 16 23:04:24 2013 +0100
joinctrl.py: Wrap and sort control after generation. diff --git a/scripts/joinctrl.py b/scripts/joinctrl.py index ae5466e..f95e67d 100755 --- a/scripts/joinctrl.py +++ b/scripts/joinctrl.py @@ -21,10 +21,14 @@ def splitlines(): else: print '%s: %s' % (field, ', '.join(values)) - +def sort_list(unsorted_list): + packages = [x for x in unsorted_list if re.match("[a-z0-9]", x)] + special = [x for x in unsorted_list if not re.match("[a-z0-9]", x)] + return sorted(packages) + sorted(special) + def joinlines(): fields = ('Build-Depends', 'Build-Conflicts', 'Build-Depends-Indep', 'Depends', 'Replaces', - 'Provides', 'Conflicts', 'Recommends', 'Suggests') + 'Provides', 'Conflicts', 'Recommends', 'Suggests', 'Breaks') buffer = None for line in fileinput.input(): line = line[:-1] @@ -33,7 +37,17 @@ def joinlines(): buffer = buffer + ' ' + line.strip() continue else: - print re.sub(r' *,', r',', buffer) + packages = sort_list(set([x.strip() for x in buffer[len(field)+1:].split(",")])) + if "" in packages: + packages.remove("") + length = len(field) + sum([2 + len(package) for package in packages]) + if length > 80: + indentation = " " * (len(field) + 2) + packages_with_indention = [indentation + x for x in packages] + packages_with_indention = ",\n".join(packages_with_indention) + print field + ": " + packages_with_indention.strip() + else: + print field + ": " + ", ".join(packages).strip() buffer = None field = None for f in fields: -- LibreOffice packaging repository -- To UNSUBSCRIBE, email to debian-openoffice-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/e1u7qyq-0003x1...@vasks.debian.org