-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Default to name plus email for changesauthor
Modify default behavior of changesgenerate to add packager's name AND email, instead of only the former, in the header of generated changes entries when used along with the changesauthor parameter in the _service file. This aligns with what OSC's vc script does since long time ago. Signed-off-by: Luciano Santos <[email protected]>
- Loading branch information
Showing
1 changed file
with
27 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -231,25 +231,39 @@ def get_changesauthor(self, args): | |
return args.changesauthor | ||
|
||
# return changesauthor if set by osc | ||
if os.getenv('VC_MAILADDR'): | ||
logging.debug("Found changesauthor in VC_MAILADDR='%s'", | ||
os.environ['VC_MAILADDR']) | ||
return os.environ['VC_MAILADDR'] | ||
if os.getenv('VC_REALNAME') and os.getenv('VC_MAILADDR'): | ||
logging.debug("Found changesauthor in VC_REALNAME='%s' and " \ | ||
"VC_MAILADDR='%s'" % (os.environ['VC_REALNAME'], | ||
os.environ['VC_MAILADDR'])) | ||
|
||
return (os.environ['VC_REALNAME'] + ' <' + | ||
os.environ['VC_MAILADDR'] + '>') | ||
|
||
# return default changesauthor if running on server side | ||
if os.getenv('OBS_SERVICE_DAEMON'): | ||
logging.debug("Running in daemon mode. Using DEFAULT_AUHTOR='%s'", | ||
Cli.DEFAULT_AUTHOR) | ||
return Cli.DEFAULT_AUTHOR | ||
|
||
# exit if running locally (non server mode) and now changesauthor | ||
# could be determined | ||
# exit if running locally (non server mode) and no changesauthor could | ||
# be determined, hint user on what to do | ||
raise SystemExit( | ||
"""No changesauthor defined!\n""" | ||
"""You can define it by:\n""" | ||
""" * configure 'email=' in ~/.config/osc/oscrc """ | ||
"""in your default api section\n""" | ||
""" * configure <param name="changesauthor">""" | ||
"""...</param> in your _service file\n""" | ||
""" * using '--changesauthor' on the cli\n""" | ||
"""No 'changesauthor' has been defined! You can do it by:\n\n""" | ||
""" Configuring:\n""" | ||
""" * 'realname' and 'email' for the default API section """ | ||
"""(api.opensuse.org) -- or whatever OBS instance you're\n""" | ||
""" working with -- in your """ | ||
"""OSCRC file with:\n\n""" | ||
""" osc config "https://api.opensuse.org" realname """ | ||
""""John Doe"\n""" | ||
""" osc config "https://api.opensuse.org" email """ | ||
""""[email protected]"\n\n""" | ||
""" * '<param name="changesauthor">John Doe """ | ||
"""<[email protected]></param> under the """ | ||
"""obs_scm/tar_scm service\n""" | ||
""" in your _service file;\n""" | ||
""" Passing:\n""" | ||
""" '--changesauthor "John Doe <[email protected]"' on the """ | ||
"""CLI, when using the obs_scm/""" | ||
"""tar_scm script manually.\n""" | ||
) |