Allow for the EMAIL env var as a fallback for DEBEMAIL.

This commit is contained in:
Loïc Minier 2009-07-15 23:58:24 +02:00
parent 6799633ca3
commit 1820a2ccfa
2 changed files with 10 additions and 5 deletions

View File

@ -203,8 +203,11 @@ 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.'
myemailaddr = os.getenv('EMAIL')
if not myemailaddr:
print >> sys.stderr, 'The environment variable DEBEMAIL or ' +\
'EMAIL 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):

View File

@ -79,9 +79,11 @@ if 'Ubuntu Developers' in maintainer_name and \
if not ubuntutools.packages.checkIsInDebian(package_name, 'unstable'):
user_email_address = os.getenv('DEBEMAIL')
if not user_email_address:
sys.stderr.write('The environment variable DEBEMAIL needs to be ' +\
'set to make proper use of this script.\n')
sys.exit(1)
user_email_address = os.getenv('EMAIL')
if not user_email_address:
sys.stderr.write('The environment variable DEBEMAIL or EMAIL ' +\
'needs to be set to make proper use of this script.\n')
sys.exit(1)
target_maintainer = user_email_address
else:
target_maintainer = "Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>"