wok-current annotate tazbb/stuff/tazbbmail @ rev 3698

fix id3tag.pc
author Rohit Joshi <jozee@slitaz.org>
date Fri Jul 17 07:52:06 2009 +0000 (2009-07-17)
parents
children
rev   line source
pankso@3590 1 #!/usr/bin/python
pankso@3590 2 #
pankso@3590 3 # Part of SliTaz Build Bot - Send mail with cooklog url to a maintainer.
pankso@3590 4 # (C) 2009 SliTaz GNU/Linux project - GNU gpl v3
pankso@3590 5 #
pankso@3590 6
pankso@3590 7 import sys
pankso@3590 8 import smtplib
pankso@3590 9
pankso@3590 10 # We need a package name.
pankso@3590 11 if len(sys.argv) != 2:
pankso@3590 12 print "Usage: tazbbmail package"
pankso@3590 13 sys.exit(1)
pankso@3590 14
pankso@3590 15 # From, package name, receipt for email and version.
pankso@3590 16 mailer = "tazbb@slitaz.org"
pankso@3590 17 package = (sys.argv[1])
pankso@3590 18 receipt = "/home/slitaz/wok/%s/receipt" % package
pankso@3590 19
pankso@3590 20 for line in open(receipt) :
pankso@3590 21 if "VERSION=" in line:
pankso@3590 22 version = line.split('"')[1]
pankso@3590 23 if "MAINTAINER=" in line:
pankso@3590 24 mailto = line.split('"')[1]
pankso@3590 25
pankso@3590 26 # Format mail.
pankso@3590 27 subject = "[tazbb] Unbuilt %s Cooklog" % package
pankso@3590 28 cooklog = "http://bb.slitaz.org/log/%s.log" % package
pankso@3590 29
pankso@3590 30 message = """\
pankso@3590 31 From: %s
pankso@3590 32 To: %s
pankso@3590 33 Subject: %s
pankso@3590 34
pankso@3590 35 Package : %s
pankso@3590 36 Version : %s
pankso@3590 37 Cooklog : %s
pankso@3590 38
pankso@3590 39 --
pankso@3590 40 Tazbb Mailer
pankso@3590 41 """ % (mailer, mailto, subject, package, version, cooklog)
pankso@3590 42
pankso@3590 43 # Send mail.
pankso@3590 44 try:
pankso@3590 45 server = smtplib.SMTP("localhost")
pankso@3590 46 server.sendmail(mailer, mailto, message)
pankso@3590 47 server.quit()
pankso@3590 48 print "Successfully sent mail to: %s" % mailto
pankso@3590 49 except SMTPException:
pankso@3590 50 print "Unable to send mail"