mirror of
https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu
synced 2025-06-05 14:51:37 +00:00
Skip date-based processing if Dates is missing.
This commit is contained in:
parent
ee9bb6c002
commit
7049af338d
26
britney.py
26
britney.py
@ -721,13 +721,18 @@ class Britney(object):
|
|||||||
dates = {}
|
dates = {}
|
||||||
filename = os.path.join(basedir, "Dates")
|
filename = os.path.join(basedir, "Dates")
|
||||||
self.__log("Loading upload data from %s" % filename)
|
self.__log("Loading upload data from %s" % filename)
|
||||||
for line in open(filename):
|
try:
|
||||||
l = line.split()
|
for line in open(filename):
|
||||||
if len(l) != 3: continue
|
l = line.split()
|
||||||
try:
|
if len(l) != 3: continue
|
||||||
dates[l[0]] = (l[1], int(l[2]))
|
try:
|
||||||
except ValueError:
|
dates[l[0]] = (l[1], int(l[2]))
|
||||||
self.__log("Dates, unable to parse \"%s\"" % line, type="E")
|
except ValueError:
|
||||||
|
self.__log("Dates, unable to parse \"%s\"" % line,
|
||||||
|
type="E")
|
||||||
|
except IOError:
|
||||||
|
self.__log("%s missing; skipping date-based processing" % filename)
|
||||||
|
return None
|
||||||
return dates
|
return dates
|
||||||
|
|
||||||
def write_dates(self, basedir, dates):
|
def write_dates(self, basedir, dates):
|
||||||
@ -1327,7 +1332,7 @@ class Britney(object):
|
|||||||
# permanence in unstable before updating testing; if the source package is too young,
|
# permanence in unstable before updating testing; if the source package is too young,
|
||||||
# the check fails and we set update_candidate to False to block the update; consider
|
# the check fails and we set update_candidate to False to block the update; consider
|
||||||
# the age-days hint, if specified for the package
|
# the age-days hint, if specified for the package
|
||||||
if suite == 'unstable':
|
if suite == 'unstable' and self.dates is not None:
|
||||||
if src not in self.dates:
|
if src not in self.dates:
|
||||||
self.dates[src] = (source_u[VERSION], self.date_now)
|
self.dates[src] = (source_u[VERSION], self.date_now)
|
||||||
elif not self.same_source(self.dates[src][0], source_u[VERSION]):
|
elif not self.same_source(self.dates[src][0], source_u[VERSION]):
|
||||||
@ -1423,7 +1428,7 @@ class Britney(object):
|
|||||||
else:
|
else:
|
||||||
update_candidate = False
|
update_candidate = False
|
||||||
|
|
||||||
if self.date_now != self.dates[src][1]:
|
if self.dates is None or self.date_now != self.dates[src][1]:
|
||||||
excuse.addhtml(text)
|
excuse.addhtml(text)
|
||||||
|
|
||||||
# if the source package has no binaries, set update_candidate to False to block the update
|
# if the source package has no binaries, set update_candidate to False to block the update
|
||||||
@ -2449,7 +2454,8 @@ class Britney(object):
|
|||||||
self.write_controlfiles(self.options.testing, 'testing')
|
self.write_controlfiles(self.options.testing, 'testing')
|
||||||
|
|
||||||
# write dates
|
# write dates
|
||||||
self.write_dates(self.options.testing, self.dates)
|
if self.dates is not None:
|
||||||
|
self.write_dates(self.options.testing, self.dates)
|
||||||
|
|
||||||
# write HeidiResult
|
# write HeidiResult
|
||||||
self.write_heidi(self.options.heidi_output)
|
self.write_heidi(self.options.heidi_output)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user