debian/lib/python/debian_linux/debian.py: Close changelog after parsing
This commit is contained in:
parent
e120f06587
commit
09697cfec7
|
@ -46,6 +46,7 @@ linux (4.16-1~exp1) UNRELEASED; urgency=medium
|
||||||
* debian/config: Rename [build]signed-modules setting to signed-code
|
* debian/config: Rename [build]signed-modules setting to signed-code
|
||||||
* debian/lib/python/debian_linux/gencontrol.py: Allow overriding output
|
* debian/lib/python/debian_linux/gencontrol.py: Allow overriding output
|
||||||
filenames
|
filenames
|
||||||
|
* debian/lib/python/debian_linux/debian.py: Close changelog after parsing
|
||||||
|
|
||||||
-- Roger Shimizu <rogershimizu@gmail.com> Fri, 23 Mar 2018 21:10:34 +0900
|
-- Roger Shimizu <rogershimizu@gmail.com> Fri, 23 Mar 2018 21:10:34 +0900
|
||||||
|
|
||||||
|
|
|
@ -38,23 +38,23 @@ class Changelog(list):
|
||||||
def __init__(self, dir='', version=None):
|
def __init__(self, dir='', version=None):
|
||||||
if version is None:
|
if version is None:
|
||||||
version = Version
|
version = Version
|
||||||
f = open(os.path.join(dir, "debian/changelog"), encoding="UTF-8")
|
with open(os.path.join(dir, "debian/changelog"), encoding="UTF-8") as f:
|
||||||
while True:
|
while True:
|
||||||
line = f.readline()
|
line = f.readline()
|
||||||
if not line:
|
if not line:
|
||||||
break
|
break
|
||||||
match = self._re.match(line)
|
match = self._re.match(line)
|
||||||
if not match:
|
if not match:
|
||||||
continue
|
continue
|
||||||
try:
|
try:
|
||||||
v = version(match.group('version'))
|
v = version(match.group('version'))
|
||||||
except Exception:
|
except Exception:
|
||||||
if not len(self):
|
if not len(self):
|
||||||
raise
|
raise
|
||||||
v = Version(match.group('version'))
|
v = Version(match.group('version'))
|
||||||
self.append(self.Entry(match.group('distribution'),
|
self.append(self.Entry(match.group('distribution'),
|
||||||
match.group('source'), v,
|
match.group('source'), v,
|
||||||
match.group('urgency')))
|
match.group('urgency')))
|
||||||
|
|
||||||
|
|
||||||
class Version(object):
|
class Version(object):
|
||||||
|
|
Loading…
Reference in New Issue