690 |
sys.exit(1) |
sys.exit(1) |
691 |
|
|
692 |
def cmd_parse_ftp_release_list(options, parser): |
def cmd_parse_ftp_release_list(options, parser): |
693 |
def _send_reply_mail(contents, orig_msg, to, error=False): |
def _send_reply_mail(contents, orig_msg, to, packages=[], error=False): |
694 |
"""Send an reply email""" |
"""Send an reply email""" |
695 |
contents.seek(0) |
contents.seek(0) |
696 |
msg = MIMEText(contents.read(), _charset='utf-8') |
msg = MIMEText(contents.read(), _charset='utf-8') |
697 |
|
|
698 |
if error: |
if error: |
699 |
# XXX - ugly |
# XXX - ugly |
700 |
contents.seek(0) |
contents.seek(0) |
706 |
subjecterror = " (ERROR: %s)" % lastline if lastline else " (ERROR)" |
subjecterror = " (ERROR: %s)" % lastline if lastline else " (ERROR)" |
707 |
else: |
else: |
708 |
subjecterror = "" |
subjecterror = "" |
709 |
msg['Subject'] = "Re: %s%s" % (orig_msg['Subject'], subjecterror) |
|
710 |
|
if packages: |
711 |
|
subject = "%s %s%s" % (", ".join(packages), orig_msg['X-Module-Version'], subjecterror) |
712 |
|
else: |
713 |
|
subject = "Re: %s%s" % (orig_msg['Subject'], subjecterror) |
714 |
|
|
715 |
|
msg['Subject'] = subject |
716 |
msg['To'] = to |
msg['To'] = to |
717 |
msg["In-Reply-To"] = orig_msg["Message-ID"] |
msg["In-Reply-To"] = orig_msg["Message-ID"] |
718 |
msg["References"] = orig_msg["Message-ID"] |
msg["References"] = orig_msg["Message-ID"] |
774 |
if subprocess.call(cmd, stdout=stdout, stderr=stderr): |
if subprocess.call(cmd, stdout=stdout, stderr=stderr): |
775 |
error = True |
error = True |
776 |
|
|
777 |
if options.mail: _send_reply_mail(stdout, msg, options.mail, error=error) |
if options.mail: _send_reply_mail(stdout, msg, options.mail, packages=packages, error=error) |
778 |
|
|
779 |
def main(): |
def main(): |
780 |
description = """Mageia GNOME commands.""" |
description = """Mageia GNOME commands.""" |