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.''' '''Get the DEBEMAIL environment variable or give an error.'''
myemailaddr = os.getenv('DEBEMAIL') myemailaddr = os.getenv('DEBEMAIL')
if not myemailaddr: if not myemailaddr:
print >> sys.stderr, 'The environment variable DEBEMAIL needs to be ' +\ myemailaddr = os.getenv('EMAIL')
' set to make use of this script, unless you use option --lp.' 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 return myemailaddr
def mail_bug(source_package, subscribe, status, bugtitle, bugtext, keyid = None): 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'): if not ubuntutools.packages.checkIsInDebian(package_name, 'unstable'):
user_email_address = os.getenv('DEBEMAIL') user_email_address = os.getenv('DEBEMAIL')
if not user_email_address: if not user_email_address:
sys.stderr.write('The environment variable DEBEMAIL needs to be ' +\ user_email_address = os.getenv('EMAIL')
'set to make proper use of this script.\n') if not user_email_address:
sys.exit(1) 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 target_maintainer = user_email_address
else: else:
target_maintainer = "Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>" target_maintainer = "Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>"