mirror of
https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu
synced 2025-06-01 12:51:43 +00:00
Use default urgency for all packages if Urgencies is missing.
This commit is contained in:
parent
7049af338d
commit
a9f50bc26b
43
britney.py
43
britney.py
@ -766,31 +766,34 @@ class Britney(object):
|
|||||||
urgencies = {}
|
urgencies = {}
|
||||||
filename = os.path.join(basedir, "Urgency")
|
filename = os.path.join(basedir, "Urgency")
|
||||||
self.__log("Loading upload urgencies from %s" % filename)
|
self.__log("Loading upload urgencies 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()
|
||||||
|
if len(l) != 3: continue
|
||||||
|
|
||||||
# read the minimum days associated with the urgencies
|
# read the minimum days associated with the urgencies
|
||||||
urgency_old = urgencies.get(l[0], self.options.default_urgency)
|
urgency_old = urgencies.get(l[0], self.options.default_urgency)
|
||||||
mindays_old = self.MINDAYS.get(urgency_old, self.MINDAYS[self.options.default_urgency])
|
mindays_old = self.MINDAYS.get(urgency_old, self.MINDAYS[self.options.default_urgency])
|
||||||
mindays_new = self.MINDAYS.get(l[2], self.MINDAYS[self.options.default_urgency])
|
mindays_new = self.MINDAYS.get(l[2], self.MINDAYS[self.options.default_urgency])
|
||||||
|
|
||||||
# if the new urgency is lower (so the min days are higher), do nothing
|
# if the new urgency is lower (so the min days are higher), do nothing
|
||||||
if mindays_old <= mindays_new:
|
if mindays_old <= mindays_new:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# if the package exists in testing and it is more recent, do nothing
|
# if the package exists in testing and it is more recent, do nothing
|
||||||
tsrcv = self.sources['testing'].get(l[0], None)
|
tsrcv = self.sources['testing'].get(l[0], None)
|
||||||
if tsrcv and apt_pkg.version_compare(tsrcv[VERSION], l[1]) >= 0:
|
if tsrcv and apt_pkg.version_compare(tsrcv[VERSION], l[1]) >= 0:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# if the package doesn't exist in unstable or it is older, do nothing
|
# if the package doesn't exist in unstable or it is older, do nothing
|
||||||
usrcv = self.sources['unstable'].get(l[0], None)
|
usrcv = self.sources['unstable'].get(l[0], None)
|
||||||
if not usrcv or apt_pkg.version_compare(usrcv[VERSION], l[1]) < 0:
|
if not usrcv or apt_pkg.version_compare(usrcv[VERSION], l[1]) < 0:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# update the urgency for the package
|
# update the urgency for the package
|
||||||
urgencies[l[0]] = l[2]
|
urgencies[l[0]] = l[2]
|
||||||
|
except IOError:
|
||||||
|
self.__log("%s missing; using default for all packages" % filename)
|
||||||
|
|
||||||
return urgencies
|
return urgencies
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user