Beispiel #1
0
def send_notification(pkg):
    package_status = BBSreportutils.get_pkg_field_from_meat_index(
        pkg, 'PackageStatus')
    if package_status == 'Deprecated':
        return
    maintainer_email = BBSreportutils.get_pkg_field_from_meat_index(
        pkg, 'MaintainerEmail')
    #print "%s %s %s %s" % (pkg, version, maintainer, maintainer_email)
    #key = 'Last Changed Date'
    #last_changed_date = BBSreportutils.get_vcs_meta(pkg, key)
    #key = 'Last Changed Rev'
    #last_changed_rev = BBSreportutils.get_vcs_meta(pkg, key)
    problem_descs = []
    for node in BBSreportutils.supported_nodes(pkg):
        stage = 'install'
        status = BBSreportutils.get_status_from_db(pkg, node.id, stage)
        if status in ["TIMEOUT", "ERROR"]:
            leafreport_rURL = BBSreportutils.get_leafreport_rel_url(
                pkg, node.id, stage)
            problem_desc = "  o %s for 'R CMD INSTALL' on %s. See the details here:\n" % (status, node.id) \
                         + "      %s%s\n" % (BBSreportutils.data_source, leafreport_rURL)
            problem_descs.append(problem_desc)
        stage = 'buildsrc'
        status = BBSreportutils.get_status_from_db(pkg, node.id, stage)
        if status in ["TIMEOUT", "ERROR"]:
            leafreport_rURL = BBSreportutils.get_leafreport_rel_url(
                pkg, node.id, stage)
            problem_desc = "  o %s for 'R CMD build' on %s. See the details here:\n" % (status, node.id) \
                         + "      %s%s\n" % (BBSreportutils.data_source, leafreport_rURL)
            problem_descs.append(problem_desc)
        stage = 'checksrc'
        status = BBSreportutils.get_status_from_db(pkg, node.id, stage)
        if status in ["TIMEOUT", "ERROR"]:
            leafreport_rURL = BBSreportutils.get_leafreport_rel_url(
                pkg, node.id, stage)
            problem_desc = "  o %s for 'R CMD check' on %s. See the details here:\n" % (status, node.id) \
                         + "      %s%s\n" % (BBSreportutils.data_source, leafreport_rURL)
            problem_descs.append(problem_desc)
    if len(problem_descs) == 0:
        return
    if maintainer_email == "*****@*****.**":
        to_addrs = ["*****@*****.**"]
    else:
        to_addrs = [maintainer_email]
    subject = "%s problems reported in the %s" % \
              (pkg, BBSreportutils.REPORT_TITLE)
    msg = "%s\nHi %s maintainer,\n\n" % (msg_head, pkg) \
        + "According to the %s,\n" % BBSreportutils.REPORT_TITLE \
        + "the %s package has the following problem(s):\n\n" % pkg \
        + "%s\n%s\n%s" % ('\n'.join(problem_descs), msg_tail, msg_footnote)
    if arg1 == "":
        print "###########################################################"
        print "maintainer_email: %s\n" % maintainer_email
        print "subject: %s\n" % subject
        print msg
        print ""
    print "BBS> Notifying maintainer(s) of %s:" % pkg
    sys.stdout.flush()
    bbs.email.sendtextmail(from_addr, to_addrs, subject, msg)
    return
Beispiel #2
0
def send_notification(pkg):
    package_status = BBSreportutils.get_pkg_field_from_meat_index(pkg, 'PackageStatus')
    if package_status == 'Deprecated':
        return
    maintainer_email = BBSreportutils.get_pkg_field_from_meat_index(pkg, 'MaintainerEmail')
    #print "%s %s %s %s" % (pkg, version, maintainer, maintainer_email)
    #key = 'Last Changed Date'
    #last_changed_date = BBSreportutils.get_vcs_meta(pkg, key)
    #key = 'Last Changed Rev'
    #last_changed_rev = BBSreportutils.get_vcs_meta(pkg, key)
    problem_descs = []
    for node in BBSreportutils.supported_nodes(pkg):
        stage = 'install'
        status = BBSreportutils.get_status_from_db(pkg, node.id, stage)
        if status in ["TIMEOUT", "ERROR"]:
            leafreport_rURL = BBSreportutils.get_leafreport_rel_url(pkg, node.id, stage)
            problem_desc = "  o %s for 'R CMD INSTALL' on %s. See the details here:\n" % (status, node.id) \
                         + "      %s%s\n" % (BBSreportutils.data_source, leafreport_rURL)
            problem_descs.append(problem_desc)
        stage = 'buildsrc'
        status = BBSreportutils.get_status_from_db(pkg, node.id, stage)
        if status in ["TIMEOUT", "ERROR"]:
            leafreport_rURL = BBSreportutils.get_leafreport_rel_url(pkg, node.id, stage)
            problem_desc = "  o %s for 'R CMD build' on %s. See the details here:\n" % (status, node.id) \
                         + "      %s%s\n" % (BBSreportutils.data_source, leafreport_rURL)
            problem_descs.append(problem_desc)
        stage = 'checksrc'
        status = BBSreportutils.get_status_from_db(pkg, node.id, stage)
        if status in ["TIMEOUT", "ERROR"]:
            leafreport_rURL = BBSreportutils.get_leafreport_rel_url(pkg, node.id, stage)
            problem_desc = "  o %s for 'R CMD check' on %s. See the details here:\n" % (status, node.id) \
                         + "      %s%s\n" % (BBSreportutils.data_source, leafreport_rURL)
            problem_descs.append(problem_desc)
    if len(problem_descs) == 0:
        return
    if maintainer_email == "*****@*****.**":
        to_addrs = ["*****@*****.**"]
    else:
        to_addrs = [maintainer_email]
    subject = "%s problems reported in the %s" % \
              (pkg, BBSreportutils.REPORT_TITLE)
    msg = "%s\nHi %s maintainer,\n\n" % (msg_head, pkg) \
        + "According to the %s,\n" % BBSreportutils.REPORT_TITLE \
        + "the %s package has the following problem(s):\n\n" % pkg \
        + "%s\n%s\n%s" % ('\n'.join(problem_descs), msg_tail, msg_footnote)
    if arg1 == "":
        print "###########################################################"
        print "maintainer_email: %s\n" % maintainer_email
        print "subject: %s\n" % subject
        print msg
        print ""
    print "BBS> Notifying maintainer(s) of %s:" % pkg
    sys.stdout.flush()
    bbs.email.sendtextmail(from_addr, to_addrs, subject, msg)
    return
Beispiel #3
0
def send_notification(pkg):
    version = BBSreportutils.get_pkg_field_from_meat_index(pkg, 'Version')
    maintainer = BBSreportutils.get_pkg_field_from_meat_index(pkg, 'Maintainer')
    maintainer_email = BBSreportutils.get_pkg_field_from_meat_index(pkg, 'MaintainerEmail')
    #print "%s %s %s %s" % (pkg, version, maintainer, maintainer_email)
    #key = 'Last Changed Date'
    #last_changed_date = BBSreportutils.get_svn_info(pkg, key)
    #key = 'Last Changed Rev'
    #last_changed_rev = BBSreportutils.get_svn_info(pkg, key)
    problem_descs = []
    for node in BBSreportutils.supported_nodes(pkg):
        stagecmd = 'install'
        status = BBSreportutils.get_status_from_db(pkg, node.id, stagecmd)
        if status in ["TIMEOUT", "ERROR"]:
            leafreport_rURL = BBSreportutils.get_leafreport_rURL(pkg, node.id, stagecmd)
            problem_desc = "  o %s for 'R CMD INSTALL' on %s. See the details here:\n" % (status, node.id) \
                         + "      %s%s\n" % (BBSreportutils.data_source, leafreport_rURL)
            problem_descs.append(problem_desc)
        stagecmd = 'buildsrc'
        status = BBSreportutils.get_status_from_db(pkg, node.id, stagecmd)
        if status in ["TIMEOUT", "ERROR"]:
            leafreport_rURL = BBSreportutils.get_leafreport_rURL(pkg, node.id, stagecmd)
            problem_desc = "  o %s for 'R CMD build' on %s. See the details here:\n" % (status, node.id) \
                         + "      %s%s\n" % (BBSreportutils.data_source, leafreport_rURL)
            problem_descs.append(problem_desc)
        stagecmd = 'checksrc'
        status = BBSreportutils.get_status_from_db(pkg, node.id, stagecmd)
        if status in ["TIMEOUT", "ERROR"]:
            leafreport_rURL = BBSreportutils.get_leafreport_rURL(pkg, node.id, stagecmd)
            problem_desc = "  o %s for 'R CMD check' on %s. See the details here:\n" % (status, node.id) \
                         + "      %s%s\n" % (BBSreportutils.data_source, leafreport_rURL)
            problem_descs.append(problem_desc)
    if len(problem_descs) != 0:
        if maintainer_email == "*****@*****.**":
            to_addrs = ["*****@*****.**"]
        else:
            to_addrs = [maintainer_email]
        subject = "%s problems reported by the \"%s\" for %s" \
                  % (pkg, main_page_title, BBSreportutils.get_build_label())
        msg = "%s\nHi %s maintainer,\n\n" % (msg_head, pkg) \
            + "According to the \"%s\" for %s,\n" % (main_page_title, BBSreportutils.get_build_label()) \
            + "the %s package has the following problem(s):\n\n" % pkg \
            + "%s\n%s\n%s" % ('\n'.join(problem_descs), msg_tail, msg_footnote)
        if arg1 == "":
            print "###########################################################"
            print "maintainer_email: %s\n" % maintainer_email
            print "subject: %s\n" % subject
            print msg
            print ""
        bbs.email.sendtextmail(from_addr, to_addrs, subject, msg)
    return