"""Implementation of subcmd: import
"""
import os
+import re
from gitbuildsys.errors import GbsError
from gitbuildsys.cmd_export import get_packaging_dir
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:
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')