mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-03-12 23:51:08 +00:00
requestsync: If the email interface is used, check if DEBEMAIL is set before anything else (LP: #254632).
This commit is contained in:
parent
27605a77a2
commit
7d89c91b82
3
debian/changelog
vendored
3
debian/changelog
vendored
@ -2,6 +2,9 @@ ubuntu-dev-tools (0.35) intrepid; urgency=low
|
||||
|
||||
* doc/update-maintainer.1:
|
||||
- Remove the reference to the --no-changelog option from the manpage.
|
||||
* requestsync:
|
||||
- If the email interface is used, check if DEBEMAIL is set before anything
|
||||
else (LP: #254632).
|
||||
|
||||
-- Siegfried-Angel Gevatter Pujals <rainct@ubuntu.com> Mon, 04 Aug 2008 14:50:15 +0200
|
||||
|
||||
|
16
requestsync
16
requestsync
@ -123,6 +123,14 @@ Options:
|
||||
'''
|
||||
sys.exit(1)
|
||||
|
||||
def get_email_address():
|
||||
'''Get the DEBEMAIL environment variable or give an error.'''
|
||||
myemailaddr = os.getenv('DEBEMAIL')
|
||||
if not myemailaddr:
|
||||
print >> sys.stderr, 'The environment variable DEBEMAIL needs to be ' +\
|
||||
' set to make use of this script, unless you use option --lp.'
|
||||
return myemailaddr
|
||||
|
||||
def mail_bug(source_package, subscribe, status, bugtitle, bugtext, keyid = None):
|
||||
'''Submit the sync request per email.
|
||||
Return True if email successfully send, otherwise False.'''
|
||||
@ -132,9 +140,8 @@ def mail_bug(source_package, subscribe, status, bugtitle, bugtext, keyid = None)
|
||||
|
||||
to = 'new@bugs.launchpad.net'
|
||||
|
||||
myemailaddr = os.getenv('DEBEMAIL')
|
||||
myemailaddr = get_email_address()
|
||||
if not myemailaddr:
|
||||
print >> sys.stderr, 'The environment variable DEBEMAIL needs to be set to make use of this script.'
|
||||
return False
|
||||
|
||||
# generate initial mailbody
|
||||
@ -362,10 +369,13 @@ if __name__ == '__main__':
|
||||
if o == '-s': sponsorship = True
|
||||
if o == '-k': keyid = a
|
||||
if o == '--lp': use_lp_bugs = True
|
||||
|
||||
|
||||
if len(args) not in (2, 3):
|
||||
usage()
|
||||
|
||||
if not use_lp_bugs and not get_email_address():
|
||||
sys.exit(1)
|
||||
|
||||
(srcpkg, release) = args[:2]
|
||||
force_base_ver = None
|
||||
if len(args) == 3:
|
||||
|
Loading…
x
Reference in New Issue
Block a user