From eca4d4e7011b807c778c763fc6de6c9adf0d763c Mon Sep 17 00:00:00 2001 From: "Siegfried-Angel Gevatter Pujals (RainCT)" Date: Mon, 1 Oct 2007 18:06:45 +0200 Subject: [PATCH 1/3] Proposed bug fix for 144244 --- README | 6 +++++- debian/changelog | 7 +++++++ requestsync | 10 +++++++++- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/README b/README index e1301fd..cdfd791 100644 --- a/README +++ b/README @@ -23,7 +23,7 @@ mk-sbuild-lv ... will create LVM snapshot chroots via schroot and sbuild. It assumes that 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. It has to be renamed to something like pbuilder-feisty, pbuilder-gutsy, etc. @@ -37,6 +37,10 @@ pull-debian-debdiff ... will attempt to find and download a specific version of a Debian package and its immediate parent to generate a debdiff. +requestsync [-n|-s] [base version] + ... will fill a sync for a package from Debian by sending a bug report to + Launchpad. + suspicious-source ... 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 diff --git a/debian/changelog b/debian/changelog index 127958b..1745ff5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +ubuntu-dev-tools (0.16) UNRELEASED; urgency=low + + * requestsync: allow to customize the SMTP server (LP: #144244) + * Add a short description for requestsync to the README file. + + -- Siegfried-Angel Gevatter Pujals (RainCT) Mon, 1 Oct 2007 18:04:14 +0200 + ubuntu-dev-tools (0.15) gutsy; urgency=low [ Laurent Bigonville ] diff --git a/requestsync b/requestsync index 9bf7ea7..a8e75d8 100755 --- a/requestsync +++ b/requestsync @@ -173,8 +173,16 @@ Subject: Please sync %s (%s) from Debian unstable (%s) print mail print 'Press enter to file this bug, Control-C to abort' + 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' + +s = smtplib.SMTP(mailserver) s.sendmail(myemailaddr, to, mail) s.quit() From 4a1c9b0cce5fd8dec6fc38ad9dd1bd52229fdbdd Mon Sep 17 00:00:00 2001 From: "Siegfried-Angel Gevatter Pujals (RainCT)" Date: Mon, 1 Oct 2007 19:02:09 +0200 Subject: [PATCH 2/3] Add authentication. --- requestsync | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/requestsync b/requestsync index a8e75d8..ca83c15 100755 --- a/requestsync +++ b/requestsync @@ -183,6 +183,19 @@ if mailserver: else : mailserver = 'fiordland.ubuntu.com' +# connect to the server s = smtplib.SMTP(mailserver) + +# 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) + + s.sendmail(myemailaddr, to, mail) s.quit() From f6b542b3c07daa655c05d51fba96cef1bf9a0edb Mon Sep 17 00:00:00 2001 From: Laurent Bigonville Date: Sat, 6 Oct 2007 20:52:48 +0200 Subject: [PATCH 3/3] requestsync: Add support to customize the smtp port and catch all other smtp exception --- requestsync | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/requestsync b/requestsync index ca83c15..052349b 100755 --- a/requestsync +++ b/requestsync @@ -183,8 +183,15 @@ if 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) +s = smtplib.SMTP(mailserver, mailserver_port) # authenticate to the server mailserver_user = os.getenv('DEBSMTP_USER') @@ -195,6 +202,9 @@ if mailserver_user and 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)