1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-02-04 18:46:17 +01:00

Export vc env vars when running a source service

Some services (like the obs_scm) will use them. Note: if realname
or email is not set in the oscrc, an additional http request will
be performed.

This change was requested by darix.
This commit is contained in:
Marcus Huewe 2019-01-29 14:30:52 +01:00
parent fefd7c1dea
commit 37ca5535ce

View File

@ -415,6 +415,8 @@ class Serviceinfo:
os.putenv("OBS_SERVICE_APIURL", self.apiurl)
os.putenv("OBS_SERVICE_PROJECT", self.project)
os.putenv("OBS_SERVICE_PACKAGE", self.package)
# also export vc env vars (some services (like obs_scm) use them)
vc_export_env(self.apiurl)
# recreate files
ret = 0
@ -7788,7 +7790,7 @@ def checkout_deleted_package(apiurl, proj, pkg, dst):
def vc_export_env(apiurl, quiet=False):
# try to set the env variables for the user's realname and email
# (the variables are used by the "vc" script)
# (the variables are used by the "vc" script or some source service)
tag2envs = {'realname': ['VC_REALNAME'],
'email': ['VC_MAILADDR', 'mailaddr']}
tag2val = {}