From: Markus Lehtonen Date: Fri, 18 Oct 2013 08:49:09 +0000 (+0300) Subject: import: support for --upstream-tag option X-Git-Tag: 0.19~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=155072b815fadb957c45c900938e2147532bf0be;p=tools%2Fgbs.git import: support for --upstream-tag option Change-Id: I68538150da79bd34b3e98697ae8bbbb14fd7d1ef Signed-off-by: Markus Lehtonen --- diff --git a/gitbuildsys/cmd_import.py b/gitbuildsys/cmd_import.py index 67c7d52..1ade47c 100644 --- a/gitbuildsys/cmd_import.py +++ b/gitbuildsys/cmd_import.py @@ -19,6 +19,7 @@ """Implementation of subcmd: import """ import os +import re from gitbuildsys.errors import GbsError from gitbuildsys.cmd_export import get_packaging_dir @@ -47,11 +48,18 @@ def main(args): upstream_branch = args.upstream_branch else: upstream_branch = configmgr.get('upstream_branch', 'general') + if args.upstream_tag: + 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) params = ["argv[0] placeholder", "--color-scheme=magenta:green:yellow:red", "--packaging-dir=%s" % get_packaging_dir(args), "--upstream-branch=%s" % upstream_branch, path, + "--upstream-tag=%s" % upstream_tag, "--tmp-dir=%s" % tmp.path, ] if args.debug: diff --git a/tools/gbs b/tools/gbs index dbdb520..351b769 100755 --- a/tools/gbs +++ b/tools/gbs @@ -47,6 +47,10 @@ def import_parser(parser): parser.add_argument('--author-email', help='author email of git commit') parser.add_argument('--upstream-branch', help='specify upstream branch for new package version') + parser.add_argument('--upstream-tag', + help="upstream tag format, '${upstreamversion}' is " + 'expanded to the version in the spec file. ' + "E.g. 'v${upstreamversion}'") parser.add_argument('--upstream-vcs-tag', help='upstream VCS tag on top of which to import the ' 'orig sources')