From 37ca5535ce6a3992f0b649dddd6972b7be07d3b6 Mon Sep 17 00:00:00 2001 From: Marcus Huewe Date: Tue, 29 Jan 2019 14:30:52 +0100 Subject: [PATCH] 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. --- osc/core.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/osc/core.py b/osc/core.py index 289bc984..54ed3b87 100644 --- a/osc/core.py +++ b/osc/core.py @@ -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 = {}