-%s""" % (Cnf["Dinstall::MyEmailAddress"], Cnf["Dinstall::MyEmailAddress"], changes["maintainer822"], os.path.basename(changes_filename), reject_message, summary, installed_footer)
- utils.send_mail (mail_message, "")
- announce (short_summary, 1)
-
-#####################################################################################################################
-
-def reject (changes_filename, manual_reject_mail_filename):
- print "Rejecting.\n"
-
- base_changes_filename = os.path.basename(changes_filename);
- reason_filename = re_changes.sub("reason", base_changes_filename);
- reject_filename = "%s/REJECT/%s" % (Cnf["Dir::IncomingDir"], reason_filename);
-
- # Move the .changes files and it's contents into REJECT/ (if we can; errors are ignored)
- try:
- utils.move (changes_filename, "%s/REJECT/%s" % (Cnf["Dir::IncomingDir"], base_changes_filename));
- except utils.cant_overwrite_exc:
- sys.stderr.write("W: couldn't overwrite existing file '%s/REJECT/%s" % (Cnf["Dir::IncomingDir"], base_changes_filename));
- pass;
- for file in files.keys():
- if os.path.exists(file):
- try:
- utils.move (file, "%s/REJECT/%s" % (Cnf["Dir::IncomingDir"], file));
- except:
- sys.stderr.write("W: couldn't reject file '%s' [Got %s].\n" % (file, sys.exc_type);
- pass;
-
- # If this is not a manual rejection generate the .reason file and rejection mail message
- if manual_reject_mail_filename == "":
- if os.path.exists(reject_filename):
- os.unlink(reject_filename);
- fd = os.open(reject_filename, os.O_RDWR|os.O_CREAT|os.O_EXCL, 0644);
- os.write(fd, reject_message);
- os.close(fd);
- reject_mail_message = """From: %s
-To: %s
-Bcc: troup@auric.debian.org
-Subject: %s REJECTED
-
-%s
-===
-%s""" % (Cnf["Dinstall::MyEmailAddress"], changes["maintainer822"], os.path.basename(changes_filename), reject_message, reject_footer);
- else: # Have a manual rejection file to use
- reject_mail_message = ""; # avoid <undef>'s
-
- # Send the rejection mail if appropriate
- if not Cnf["Dinstall::Options::No-Mail"]:
- utils.send_mail (reject_mail_message, manual_reject_mail_filename);
-
-##################################################################
-
-def manual_reject (changes_filename):
- # Build up the rejection email
- user_email_address = string.replace(string.split(pwd.getpwuid(os.getuid())[4],',')[0], '.', '')
- user_email_address = user_email_address + " <%s@%s>" % (pwd.getpwuid(os.getuid())[0], Cnf["Dinstall::MyHost"])
- manual_reject_message = Cnf.get("Dinstall::Options::Manual-Reject", "")
-
- reject_mail_message = """From: %s
-Cc: %s
-To: %s
-Bcc: troup@auric.debian.org
-Subject: %s REJECTED
-
-%s
-%s
-===
-%s""" % (user_email_address, Cnf["Dinstall::MyEmailAddress"], changes["maintainer822"], os.path.basename(changes_filename), manual_reject_message, reject_message, reject_footer)
-
- # Write the rejection email out as the <foo>.reason file
- reason_filename = re_changes.sub("reason", os.path.basename(changes_filename));
- reject_filename = "%s/REJECT/%s" % (Cnf["Dir::IncomingDir"], reason_filename)
- if os.path.exists(reject_filename):
- os.unlink(reject_filename);
- fd = os.open(reject_filename, os.O_RDWR|os.O_CREAT|os.O_EXCL, 0644);
- os.write(fd, reject_mail_message);
- os.close(fd);
-
- # If we weren't given one, spawn an editor so the user can add one in
- if manual_reject_message == "":
- result = os.system("vi +6 %s" % (reject_file))
- if result != 0:
- sys.stderr.write ("vi invocation failed for `%s'!" % (reject_file))
- sys.exit(result)
-
- # Then process it as if it were an automatic rejection
- reject (changes_filename, reject_filename)
-
-#####################################################################################################################
-
-def acknowledge_new (changes_filename, summary):
- global new_ack_new;
-
- changes_filename = os.path.basename(changes_filename);
-
- new_ack_new[changes_filename] = 1;
-
- if new_ack_old.has_key(changes_filename):
- print "Ack already sent.";
- return;
-
- print "Sending new ack.";
- if not Cnf["Dinstall::Options::No-Mail"]:
- new_ack_message = """Return-Path: %s
-From: %s
-To: %s
-Bcc: troup@auric.debian.org
-Subject: %s is NEW
-
-%s
-%s""" % (Cnf["Dinstall::MyEmailAddress"], Cnf["Dinstall::MyEmailAddress"], changes["maintainer822"], changes_filename, summary, new_ack_footer);
- utils.send_mail(new_ack_message,"");
-
-#####################################################################################################################
-
-def announce (short_summary, action):
- # Only do announcements for source uploads with a recent dpkg-dev installed
- if float(changes.get("format", 0)) < 1.6 or not changes["architecture"].has_key("source"):
- return ""
-
- lists_done = {}
- summary = ""
-
- for dist in changes["distribution"].keys():
- list = Cnf.Find("Suite::%s::Announce" % (dist))
- if list == None or lists_done.has_key(list):
- continue
- lists_done[list] = 1
- summary = summary + "Announcing to %s\n" % (list)
-
- if action:
- mail_message = """Return-Path: %s
-From: %s
-To: %s
-Bcc: troup@auric.debian.org
-Subject: Installed %s %s (%s)
-
-%s
-
-Installed:
-%s
-""" % (Cnf["Dinstall::MyEmailAddress"], changes["maintainer822"], list, changes["source"], changes["version"], string.join(changes["architecture"].keys(), ' ' ),
- changes["filecontents"], short_summary)
- utils.send_mail (mail_message, "")
-
- (dsc_rfc822, dsc_name, dsc_email) = utils.fix_maintainer (dsc.get("maintainer",Cnf["Dinstall::MyEmailAddress"]));
- bugs = changes["closes"].keys()
- bugs.sort()
- if dsc_name == changes["maintainername"]:
- summary = summary + "Closing bugs: "
- for bug in bugs:
- summary = summary + "%s " % (bug)
- if action:
- mail_message = """Return-Path: %s
-From: %s
-To: %s-close@bugs.debian.org
-Bcc: troup@auric.debian.org
-Subject: Bug#%s: fixed in %s %s
-
-We believe that the bug you reported is fixed in the latest version of
-%s, which has been installed in the Debian FTP archive:
-
-%s""" % (Cnf["Dinstall::MyEmailAddress"], changes["maintainer822"], bug, bug, changes["source"], changes["version"], changes["source"], short_summary)
-
- if changes["distribution"].has_key("stable"):
- mail_message = mail_message + """Note that this package is not part of the released stable Debian
-distribution. It may have dependencies on other unreleased software,
-or other instabilities. Please take care if you wish to install it.
-The update will eventually make its way into the next released Debian
-distribution."""
-
- mail_message = mail_message + """A summary of the changes between this version and the previous one is
-attached.
-
-Thank you for reporting the bug, which will now be closed. If you
-have further comments please address them to %s@bugs.debian.org,
-and the maintainer will reopen the bug report if appropriate.
-
-Debian distribution maintenance software
-pp.
-%s (supplier of updated %s package)
-
-(This message was generated automatically at their request; if you
-believe that there is a problem with it please contact the archive
-administrators by mailing ftpmaster@debian.org)
-
-
-%s""" % (bug, changes["maintainer"], changes["source"], changes["filecontents"])
-
- utils.send_mail (mail_message, "")
- else: # NMU
- summary = summary + "Setting bugs to severity fixed: "
- control_message = ""
- for bug in bugs:
- summary = summary + "%s " % (bug)
- control_message = control_message + "severity %s fixed\n" % (bug)
- if action and control_message != "":
- mail_message = """Return-Path: %s
-From: %s
-To: control@bugs.debian.org
-Bcc: troup@auric.debian.org, %s
-Subject: Fixed in NMU of %s %s
-
-%s
-quit
-
-This message was generated automatically in response to a
-non-maintainer upload. The .changes file follows.
-
-%s
-""" % (Cnf["Dinstall::MyEmailAddress"], changes["maintainer822"], changes["maintainer822"], changes["source"], changes["version"], control_message, changes["filecontents"])
- utils.send_mail (mail_message, "")
- summary = summary + "\n"
-
- return summary
-
-###############################################################################
-
-# reprocess is necessary for the case of foo_1.2-1 and foo_1.2-2 in
-# Incoming. -1 will reference the .orig.tar.gz, but -2 will not.
-# dsccheckdistrib() can find the .orig.tar.gz but it will not have
-# processed it during it's checks of -2. If -1 has been deleted or
-# otherwise not checked by da-install, the .orig.tar.gz will not have
-# been checked at all. To get round this, we force the .orig.tar.gz
-# into the .changes structure and reprocess the .changes file.