diff options
author | Jon Turney <jon.turney@dronecode.org.uk> | 2016-06-11 17:33:09 +0300 |
---|---|---|
committer | Jon Turney <jon.turney@dronecode.org.uk> | 2016-06-11 17:50:05 +0300 |
commit | d570e2d1a1229abecd8a41eb6c87c23e62d53af7 (patch) | |
tree | cd5480a38b6f38514ae9796231831ab0f1a21ef8 /calm/maintainers.py | |
parent | a361ca472d8cc7adbc7e1376dd2ddb322ca339d7 (diff) |
Allow previous maintainer(s) of orphaned package to still upload
Diffstat (limited to 'calm/maintainers.py')
-rw-r--r-- | calm/maintainers.py | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/calm/maintainers.py b/calm/maintainers.py index fad1d0e..d8f7c46 100644 --- a/calm/maintainers.py +++ b/calm/maintainers.py @@ -137,28 +137,39 @@ class Maintainer(object): for (i, l) in enumerate(f): l = l.rstrip() - # match lines of the form '<package> <maintainer(s)>' + # match lines of the form '<package> <maintainer(s)|status>' match = re.match(r'^(\S+)\s+(.+)$', l) if match: pkg = match.group(1) - m = match.group(2) + rest = match.group(2) + + # does rest starts with a status in all caps? + status_match = re.match(r'^([A-Z]+)\b.*$', rest) + if status_match: + status = status_match.group(1) - # if maintainer starts with a word in all caps, just use that - (m, n) = re.subn(r'^([A-Z]+)\b.*$', r'\1', m) - if n > 0: # ignore packages marked as 'OBSOLETE' - if m == 'OBSOLETE': + if status == 'OBSOLETE': continue - # orphaned packages get the default maintainer if we have - # one, otherwise are assigned to 'ORPHANED' - elif m == 'ORPHANED': + # orphaned packages get the default maintainer if we + # have one, otherwise they are assigned to 'ORPHANED' + elif status == 'ORPHANED': if orphanMaint is not None: m = orphanMaint + else: + m = status + + # also add any previous maintainer(s) listed + prevm = re.match(r'^ORPHANED\s\((.*)\)', rest) + if prevm: + m = m + '/' + prevm.group(1) else: - logging.error("unknown package status '%s' in line %s:%d: '%s'" % (m, pkglist, i, l)) + logging.error("unknown package status '%s' in line %s:%d: '%s'" % (status, pkglist, i, l)) continue + else: + m = rest # joint maintainers are separated by '/' for name in m.split('/'): |