merged RainCT's branch (with changes from bigon) to fix #144224 (requestsync: make smtp server customizable)

This commit is contained in:
Adrien Cunin 2007-10-07 00:22:12 +02:00
commit 3f12f44b69
3 changed files with 42 additions and 2 deletions

6
README
View File

@ -23,7 +23,7 @@ mk-sbuild-lv
... will create LVM snapshot chroots via schroot and sbuild. It assumes that ... will create LVM snapshot chroots via schroot and sbuild. It assumes that
sbuild has not be installed and configured before. sbuild has not be installed and configured before.
pbuilder-dist [create|update|build|clean|login|execute] pbuilder-dist [withlog] [create|update|build|clean|login|execute]
... is a wrapper to use pbuilder with many different distributions / versions. ... is a wrapper to use pbuilder with many different distributions / versions.
It has to be renamed to something like pbuilder-feisty, pbuilder-gutsy, etc. It has to be renamed to something like pbuilder-feisty, pbuilder-gutsy, etc.
@ -37,6 +37,10 @@ pull-debian-debdiff <package> <version>
... will attempt to find and download a specific version of a Debian package ... will attempt to find and download a specific version of a Debian package
and its immediate parent to generate a debdiff. and its immediate parent to generate a debdiff.
requestsync [-n|-s] <source package> <target release> [base version]
... will fill a sync for a package from Debian by sending a bug report to
Launchpad.
suspicious-source suspicious-source
... will output a list of files which are not common source files. This should be ... will output a list of files which are not common source files. This should be
run in the root of a source tree to find files which might not be the "prefered run in the root of a source tree to find files which might not be the "prefered

5
debian/changelog vendored
View File

@ -1,7 +1,12 @@
ubuntu-dev-tools (0.19) UNRELEASED; urgency=low ubuntu-dev-tools (0.19) UNRELEASED; urgency=low
[ Siegfried-Angel Gevatter Pujals (RainCT) ]
* requestsync: allow to customize the SMTP server (LP: #144244)
* Add a short description for requestsync to the README file.
[ Laurent Bigonville ] [ Laurent Bigonville ]
* pbuilder-dist: Fix error on chroot creation (LP: #146475) * pbuilder-dist: Fix error on chroot creation (LP: #146475)
* requestsync: allow to customize the SMTP port
-- Adrien Cunin <adri2000@ubuntu.com> Sun, 07 Oct 2007 00:03:57 +0200 -- Adrien Cunin <adri2000@ubuntu.com> Sun, 07 Oct 2007 00:03:57 +0200

View File

@ -192,8 +192,39 @@ Subject: Please sync %s %s (%s) from Debian unstable (%s)
print mail print mail
print 'Press enter to file this bug, Control-C to abort' print 'Press enter to file this bug, Control-C to abort'
sys.stdin.readline() sys.stdin.readline()
s = smtplib.SMTP('fiordland.ubuntu.com') # get server address
mailserver = os.getenv('DEBSMTP')
if mailserver:
print 'Using custom SMTP server:', mailserver
else :
mailserver = 'fiordland.ubuntu.com'
# get server port
mailserver_port = os.getenv('DEBSMTP_PORT')
if mailserver_port:
print 'Using custom SMTP port:', mailserver_port
else:
mailserver_port = 25
# connect to the server
s = smtplib.SMTP(mailserver, mailserver_port)
# authenticate to the server
mailserver_user = os.getenv('DEBSMTP_USER')
mailserver_pass = os.getenv('DEBSMTP_PASS')
if mailserver_user and mailserver_pass:
try:
s.login(mailserver_user, mailserver_pass)
except smtplib.SMTPAuthenticationError:
print 'Error authenticating to the server: invalid username and password.'
s.quit(); sys.exit(1)
except:
print 'Unknown SMTP error.'
s.quit(); sys.exit(1)
s.sendmail(myemailaddr, to, mail) s.sendmail(myemailaddr, to, mail)
s.quit() s.quit()