ubuntutools.update_maintainer: Don't use strict changelog parsing

(LP: #806633)
This commit is contained in:
Stefano Rivera 2011-09-09 21:46:18 +02:00
parent de25fb4a6c
commit 29f1538d90
2 changed files with 8 additions and 5 deletions

2
debian/changelog vendored
View File

@ -11,6 +11,8 @@ ubuntu-dev-tools (0.131) UNRELEASED; urgency=low
simple assertions (LP: #537288) simple assertions (LP: #537288)
* submittodebian: Don't parse the entire changelog, to avoid bumping into * submittodebian: Don't parse the entire changelog, to avoid bumping into
past illegal version numbers (LP: #727314) past illegal version numbers (LP: #727314)
* ubuntutools.update_maintainer: Don't use strict changelog parsing
(LP: #806633)
[ Colin Watson ] [ Colin Watson ]
* syncpackage: Fix typo. * syncpackage: Fix typo.

View File

@ -20,7 +20,6 @@ import os
import re import re
import debian.changelog import debian.changelog
from devscripts.logger import Logger from devscripts.logger import Logger
# Prior May 2009 these Maintainers were used: # Prior May 2009 these Maintainers were used:
@ -83,8 +82,11 @@ class Control(object):
def _get_distribution(changelog_file): def _get_distribution(changelog_file):
"""get distribution of latest changelog entry""" """get distribution of latest changelog entry"""
changelog = debian.changelog.Changelog(open(changelog_file)) with open(changelog_file) as f:
return changelog.distributions changelog = debian.changelog.Changelog(f, strict=False, max_blocks=1)
distribution = changelog.distributions[0]
# Strip things like "-proposed-updates" or "-security" from distribution
return distribution.split("-", 1)[0]
def update_maintainer(debian_directory, verbose=False): def update_maintainer(debian_directory, verbose=False):
"""updates the Maintainer field of an Ubuntu package """updates the Maintainer field of an Ubuntu package
@ -120,8 +122,7 @@ def update_maintainer(debian_directory, verbose=False):
print "XSBC-Original is managed by 'rules' file. Doing nothing." print "XSBC-Original is managed by 'rules' file. Doing nothing."
return(0) return(0)
# Strip things like "-proposed-updates" or "-security" from distribution. distribution = _get_distribution(changelog_file)
distribution = _get_distribution(changelog_file).split("-")[0]
for control_file in control_files: for control_file in control_files:
control = Control(control_file) control = Control(control_file)