export: recognize ${upstreamversion} in --upstream-tag option
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Fri, 18 Oct 2013 08:53:19 +0000 (11:53 +0300)
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Fri, 18 Oct 2013 09:41:30 +0000 (12:41 +0300)
Handle the "meta-variable" correctly if given from the command line
option - previously it was correctly handled only when defined in the
config file.

Change-Id: Ib53798b70fab2467e1d3383885bbb4a4ce805e19
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
gitbuildsys/cmd_export.py

index 44c6354..e991a95 100644 (file)
@@ -101,8 +101,8 @@ def create_gbp_export_args(repo, commit, export_dir, tmp_dir, spec, args,
         upstream_tag = args.upstream_tag
     else:
         upstream_tag = configmgr.get('upstream_tag', 'general')
-        # transform variables from shell to python convention ${xxx} -> %(xxx)s
-        upstream_tag = re.sub(r'\$\{([^}]+)\}', r'%(\1)s', upstream_tag)
+    # transform variables from shell to python convention ${xxx} -> %(xxx)s
+    upstream_tag = re.sub(r'\$\{([^}]+)\}', r'%(\1)s', upstream_tag)
 
     log.debug("Using upstream branch: %s" % upstream_branch)
     log.debug("Using upstream tag format: '%s'" % upstream_tag)