-class nmu_p:
- # Read in the group maintainer override file
- def __init__ (self, Cnf):
- self.group_maint = {}
- self.Cnf = Cnf
- if Cnf.get("Dinstall::GroupOverrideFilename"):
- filename = Cnf["Dir::Override"] + Cnf["Dinstall::GroupOverrideFilename"]
- file = utils.open_file(filename)
- for line in file.readlines():
- line = utils.re_comments.sub('', line).lower().strip()
- if line != "":
- self.group_maint[line] = 1
- file.close()
-
- def is_an_nmu (self, pkg):
- Cnf = self.Cnf
- changes = pkg.changes
- dsc = pkg.dsc
-
- i = utils.fix_maintainer (dsc.get("maintainer",
- Cnf["Dinstall::MyEmailAddress"]).lower())
- (dsc_rfc822, dsc_rfc2047, dsc_name, dsc_email) = i
- # changes["changedbyname"] == dsc_name is probably never true, but better safe than sorry
- if dsc_name == changes["maintainername"].lower() and \
- (changes["changedby822"] == "" or changes["changedbyname"].lower() == dsc_name):
- return 0
-
- if dsc.has_key("uploaders"):
- uploaders = dsc["uploaders"].lower().split(",")
- uploadernames = {}
- for i in uploaders:
- (rfc822, rfc2047, name, email) = utils.fix_maintainer (i.strip())
- uploadernames[name] = ""
- if uploadernames.has_key(changes["changedbyname"].lower()):
- return 0
-
- # Some group maintained packages (e.g. Debian QA) are never NMU's
- if self.group_maint.has_key(changes["maintaineremail"].lower()):
- return 0
-
- return 1
-
-###############################################################################
-