本文整理汇总了Python中gbp.config.GbpOptionParserDebian.add_option_group方法的典型用法代码示例。如果您正苦于以下问题:Python GbpOptionParserDebian.add_option_group方法的具体用法?Python GbpOptionParserDebian.add_option_group怎么用?Python GbpOptionParserDebian.add_option_group使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gbp.config.GbpOptionParserDebian
的用法示例。
在下文中一共展示了GbpOptionParserDebian.add_option_group方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: parse_args
# 需要导入模块: from gbp.config import GbpOptionParserDebian [as 别名]
# 或者: from gbp.config.GbpOptionParserDebian import add_option_group [as 别名]
def parse_args(argv, sections=[]):
"""
Parse the command line arguments and config files.
@param argv: the command line arguments
@type argv: C{list} of C{str}
@param sections: additional sections to add to the config file parser
besides the command name
@type sections: C{list} of C{str}
"""
# We simpley handle the template section as an additional config file
# section to parse, this makes e.g. --help work as expected:
for arg in argv:
if arg.startswith('--remote-config='):
sections = ['remote-config %s' % arg.split('=',1)[1]]
break
else:
sections = []
parser = GbpOptionParserDebian(command=os.path.basename(argv[0]), prefix='',
usage='%prog [options] - '
'create a remote repository',
sections=sections)
branch_group = GbpOptionGroup(parser,
"branch options",
"branch layout and tracking options")
branch_group.add_config_file_option(option_name="remote-url-pattern",
dest="remote_url")
parser.add_option_group(branch_group)
branch_group.add_config_file_option(option_name="upstream-branch",
dest="upstream_branch")
branch_group.add_config_file_option(option_name="debian-branch",
dest="debian_branch")
branch_group.add_boolean_config_file_option(option_name="pristine-tar",
dest="pristine_tar")
branch_group.add_boolean_config_file_option(option_name="track",
dest='track')
parser.add_option("-v", "--verbose",
action="store_true",
dest="verbose",
default=False,
help="verbose command execution")
parser.add_config_file_option(option_name="color",
dest="color",
type='tristate')
parser.add_config_file_option(option_name="color-scheme",
dest="color_scheme")
parser.add_option("--remote-name",
dest="name",
default="origin",
help="The name of the remote, default is 'origin'")
parser.add_config_file_option(option_name="template-dir",
dest="template_dir")
parser.add_config_file_option(option_name="remote-config",
dest="remote_config")
(options, args) = parser.parse_args(argv)
return options, args
示例2: build_parser
# 需要导入模块: from gbp.config import GbpOptionParserDebian [as 别名]
# 或者: from gbp.config.GbpOptionParserDebian import add_option_group [as 别名]
def build_parser(name):
try:
parser = GbpOptionParserDebian(command=os.path.basename(name), prefix='',
usage='%prog [options] /path/to/package.dsc')
except configparser.ParsingError as err:
gbp.log.err(err)
return None
import_group = GbpOptionGroup(parser, "import options",
"pristine-tar and filtering")
tag_group = GbpOptionGroup(parser, "tag options",
"options related to git tag creation")
branch_group = GbpOptionGroup(parser, "version and branch naming options",
"version number and branch layout options")
for group in [import_group, branch_group, tag_group ]:
parser.add_option_group(group)
parser.add_option("-v", "--verbose", action="store_true", dest="verbose", default=False,
help="verbose command execution")
parser.add_config_file_option(option_name="color", dest="color", type='tristate')
parser.add_config_file_option(option_name="color-scheme",
dest="color_scheme")
parser.add_option("--download", action="store_true", dest="download", default=False,
help="download source package")
branch_group.add_config_file_option(option_name="debian-branch",
dest="debian_branch")
branch_group.add_config_file_option(option_name="upstream-branch",
dest="upstream_branch")
branch_group.add_boolean_config_file_option(option_name="create-missing-branches",
dest="create_missing_branches")
tag_group.add_boolean_config_file_option(option_name="sign-tags",
dest="sign_tags")
tag_group.add_config_file_option(option_name="keyid",
dest="keyid")
tag_group.add_config_file_option(option_name="debian-tag",
dest="debian_tag")
tag_group.add_config_file_option(option_name="upstream-tag",
dest="upstream_tag")
tag_group.add_option("--skip-debian-tag",dest="skip_debian_tag",
action="store_true", default=False,
help="Don't add a tag after importing the Debian patch")
import_group.add_config_file_option(option_name="filter",
dest="filters", action="append")
import_group.add_boolean_config_file_option(option_name="pristine-tar",
dest="pristine_tar")
import_group.add_option("--allow-same-version", action="store_true",
dest="allow_same_version", default=False,
help="allow to import already imported version")
import_group.add_boolean_config_file_option(option_name="author-is-committer",
dest="author_committer")
import_group.add_boolean_config_file_option(option_name="author-date-is-committer-date",
dest="author_committer_date")
import_group.add_boolean_config_file_option(option_name="allow-unauthenticated",
dest="allow_unauthenticated")
return parser
示例3: build_parser
# 需要导入模块: from gbp.config import GbpOptionParserDebian [as 别名]
# 或者: from gbp.config.GbpOptionParserDebian import add_option_group [as 别名]
def build_parser(name):
try:
parser = GbpOptionParserDebian(
command=os.path.basename(name),
prefix="",
usage="%prog [options] /path/to/upstream-version.tar.gz | --uscan",
)
except configparser.ParsingError as err:
gbp.log.err(err)
return None
import_group = GbpOptionGroup(parser, "import options", "pristine-tar and filtering")
tag_group = GbpOptionGroup(parser, "tag options", "options related to git tag creation")
branch_group = GbpOptionGroup(
parser, "version and branch naming options", "version number and branch layout options"
)
cmd_group = GbpOptionGroup(parser, "external command options", "how and when to invoke external commands and hooks")
for group in [import_group, branch_group, tag_group, cmd_group]:
parser.add_option_group(group)
branch_group.add_option("-u", "--upstream-version", dest="version", help="Upstream Version")
branch_group.add_config_file_option(option_name="debian-branch", dest="debian_branch")
branch_group.add_config_file_option(option_name="upstream-branch", dest="upstream_branch")
branch_group.add_config_file_option(
option_name="upstream-vcs-tag", dest="vcs_tag", help="Upstream VCS tag add to the merge commit"
)
branch_group.add_boolean_config_file_option(option_name="merge", dest="merge")
branch_group.add_config_file_option(option_name="merge-mode", dest="merge_mode")
tag_group.add_boolean_config_file_option(option_name="sign-tags", dest="sign_tags")
tag_group.add_config_file_option(option_name="keyid", dest="keyid")
tag_group.add_config_file_option(option_name="upstream-tag", dest="upstream_tag")
import_group.add_config_file_option(option_name="filter", dest="filters", action="append")
import_group.add_boolean_config_file_option(option_name="pristine-tar", dest="pristine_tar")
import_group.add_boolean_config_file_option(option_name="filter-pristine-tar", dest="filter_pristine_tar")
import_group.add_config_file_option(option_name="import-msg", dest="import_msg")
import_group.add_boolean_config_file_option(option_name="symlink-orig", dest="symlink_orig")
cmd_group.add_config_file_option(option_name="postimport", dest="postimport")
parser.add_boolean_config_file_option(option_name="interactive", dest="interactive")
parser.add_option(
"-v", "--verbose", action="store_true", dest="verbose", default=False, help="verbose command execution"
)
parser.add_config_file_option(option_name="color", dest="color", type="tristate")
parser.add_config_file_option(option_name="color-scheme", dest="color_scheme")
# Accepted for compatibility
parser.add_option("--no-dch", dest="no_dch", action="store_true", default=False, help="deprecated - don't use.")
parser.add_option(
"--uscan", dest="uscan", action="store_true", default=False, help="use uscan(1) to download the new tarball."
)
parser.add_option(
"--download", dest="download", action="store_true", default=False, help="Download from URL via http(s)."
)
return parser
示例4: build_parser
# 需要导入模块: from gbp.config import GbpOptionParserDebian [as 别名]
# 或者: from gbp.config.GbpOptionParserDebian import add_option_group [as 别名]
def build_parser(name, sections=[]):
try:
parser = GbpOptionParserDebian(command=os.path.basename(name), prefix='',
usage='%prog [options] - '
'create a remote repository',
sections=sections)
except (GbpError, configparser.NoSectionError) as err:
gbp.log.err(err)
return None
branch_group = GbpOptionGroup(parser,
"branch options",
"branch layout and tracking options")
branch_group.add_config_file_option(option_name="remote-url-pattern",
dest="remote_url")
parser.add_option_group(branch_group)
branch_group.add_config_file_option(option_name="upstream-branch",
dest="upstream_branch")
branch_group.add_config_file_option(option_name="debian-branch",
dest="debian_branch")
branch_group.add_boolean_config_file_option(option_name="pristine-tar",
dest="pristine_tar")
branch_group.add_boolean_config_file_option(option_name="track",
dest='track')
branch_group.add_boolean_config_file_option(option_name="bare",
dest='bare')
parser.add_option("-v", "--verbose",
action="store_true",
dest="verbose",
default=False,
help="verbose command execution")
parser.add_config_file_option(option_name="color",
dest="color",
type='tristate')
parser.add_config_file_option(option_name="color-scheme",
dest="color_scheme")
parser.add_option("--remote-name",
dest="name",
default="origin",
help="The name of the remote, default is 'origin'")
parser.add_config_file_option(option_name="template-dir",
dest="template_dir")
parser.add_config_file_option(option_name="remote-config",
dest="remote_config")
return parser
示例5: build_parser
# 需要导入模块: from gbp.config import GbpOptionParserDebian [as 别名]
# 或者: from gbp.config.GbpOptionParserDebian import add_option_group [as 别名]
def build_parser(name):
try:
parser = GbpOptionParserDebian(command=os.path.basename(name), prefix='')
except GbpError as err:
gbp.log.err(err)
return None
tag_group = GbpOptionGroup(parser,
"tag options",
"options related to git tag creation")
orig_group = GbpOptionGroup(parser,
"orig tarball options",
"options related to the creation of the orig tarball")
branch_group = GbpOptionGroup(parser,
"branch options",
"branch layout options")
for group in [tag_group, orig_group, branch_group]:
parser.add_option_group(group)
parser.add_option("--verbose", action="store_true", dest="verbose", default=False,
help="verbose command execution")
parser.add_config_file_option(option_name="color", dest="color", type='tristate')
parser.add_config_file_option(option_name="color-scheme",
dest="color_scheme")
tag_group.add_config_file_option(option_name="upstream-tag", dest="upstream_tag")
orig_group.add_config_file_option(option_name="upstream-tree", dest="upstream_tree")
orig_group.add_boolean_config_file_option(option_name="pristine-tar", dest="pristine_tar")
orig_group.add_config_file_option(option_name="force-create", dest="force_create",
help="force creation of orig tarball", action="store_true")
orig_group.add_config_file_option(option_name="tarball-dir", dest="tarball_dir", type="path",
help="location to look for external tarballs")
orig_group.add_config_file_option(option_name="compression", dest="comp_type",
help="Compression type, default is '%(compression)s'")
orig_group.add_config_file_option(option_name="compression-level", dest="comp_level",
help="Compression level, default is '%(compression-level)s'")
orig_group.add_config_file_option("component", action="append", metavar='COMPONENT',
dest="components")
branch_group.add_config_file_option(option_name="upstream-branch", dest="upstream_branch")
branch_group.add_boolean_config_file_option(option_name="submodules", dest="with_submodules")
return parser
示例6: parse_args
# 需要导入模块: from gbp.config import GbpOptionParserDebian [as 别名]
# 或者: from gbp.config.GbpOptionParserDebian import add_option_group [as 别名]
def parse_args(argv):
try:
parser = GbpOptionParserDebian(command=os.path.basename(argv[0]), prefix='',
usage='%prog [options] /path/to/upstream-version.tar.gz | --uscan')
except ConfigParser.ParsingError as err:
gbp.log.err(err)
return None, None
import_group = GbpOptionGroup(parser, "import options",
"pristine-tar and filtering")
tag_group = GbpOptionGroup(parser, "tag options",
"options related to git tag creation")
branch_group = GbpOptionGroup(parser, "version and branch naming options",
"version number and branch layout options")
cmd_group = GbpOptionGroup(parser, "external command options", "how and when to invoke external commands and hooks")
for group in [import_group, branch_group, tag_group, cmd_group ]:
parser.add_option_group(group)
branch_group.add_option("-u", "--upstream-version", dest="version",
help="Upstream Version")
branch_group.add_config_file_option(option_name="debian-branch",
dest="debian_branch")
branch_group.add_config_file_option(option_name="upstream-branch",
dest="upstream_branch")
branch_group.add_option("--upstream-vcs-tag", dest="vcs_tag",
help="Upstream VCS tag add to the merge commit")
branch_group.add_boolean_config_file_option(option_name="merge", dest="merge")
tag_group.add_boolean_config_file_option(option_name="sign-tags",
dest="sign_tags")
tag_group.add_config_file_option(option_name="keyid",
dest="keyid")
tag_group.add_config_file_option(option_name="upstream-tag",
dest="upstream_tag")
import_group.add_config_file_option(option_name="filter",
dest="filters", action="append")
import_group.add_boolean_config_file_option(option_name="pristine-tar",
dest="pristine_tar")
import_group.add_boolean_config_file_option(option_name="filter-pristine-tar",
dest="filter_pristine_tar")
import_group.add_config_file_option(option_name="import-msg",
dest="import_msg")
import_group.add_boolean_config_file_option(option_name="symlink-orig",
dest="symlink_orig")
cmd_group.add_config_file_option(option_name="postimport", dest="postimport")
parser.add_boolean_config_file_option(option_name="interactive",
dest='interactive')
parser.add_option("-v", "--verbose", action="store_true", dest="verbose", default=False,
help="verbose command execution")
parser.add_config_file_option(option_name="color", dest="color", type='tristate')
parser.add_config_file_option(option_name="color-scheme",
dest="color_scheme")
# Accepted for compatibility
parser.add_option("--no-dch", dest='no_dch', action="store_true",
default=False, help="deprecated - don't use.")
parser.add_option("--uscan", dest='uscan', action="store_true",
default=False, help="use uscan(1) to download the new tarball.")
(options, args) = parser.parse_args(argv[1:])
gbp.log.setup(options.color, options.verbose, options.color_scheme)
if options.no_dch:
gbp.log.warn("'--no-dch' passed. This is now the default, please remove this option.")
return options, args
示例7: parse_args
# 需要导入模块: from gbp.config import GbpOptionParserDebian [as 别名]
# 或者: from gbp.config.GbpOptionParserDebian import add_option_group [as 别名]
def parse_args(argv, prefix):
args = [ arg for arg in argv[1:] if arg.find('--%s' % prefix) == 0 ]
dpkg_args = [ arg for arg in argv[1:] if arg.find('--%s' % prefix) == -1 ]
# We handle these although they don't have a --git- prefix
for arg in [ "--help", "-h", "--version" ]:
if arg in dpkg_args:
args.append(arg)
try:
parser = GbpOptionParserDebian(command=os.path.basename(argv[0]), prefix=prefix)
except ConfigParser.ParsingError as err:
gbp.log.err(err)
return None, None, None
tag_group = GbpOptionGroup(parser, "tag options", "options related to git tag creation")
branch_group = GbpOptionGroup(parser, "branch options", "branch layout options")
cmd_group = GbpOptionGroup(parser, "external command options", "how and when to invoke external commands and hooks")
orig_group = GbpOptionGroup(parser, "orig tarball options", "options related to the creation of the orig tarball")
export_group = GbpOptionGroup(parser, "export build-tree options", "alternative build tree related options")
parser.add_option_group(tag_group)
parser.add_option_group(orig_group)
parser.add_option_group(branch_group)
parser.add_option_group(cmd_group)
parser.add_option_group(export_group)
parser.add_boolean_config_file_option(option_name = "ignore-new", dest="ignore_new")
parser.add_option("--git-verbose", action="store_true", dest="verbose", default=False,
help="verbose command execution")
parser.add_config_file_option(option_name="color", dest="color", type='tristate')
parser.add_config_file_option(option_name="notify", dest="notify", type='tristate')
tag_group.add_option("--git-tag", action="store_true", dest="tag", default=False,
help="create a tag after a successful build")
tag_group.add_option("--git-tag-only", action="store_true", dest="tag_only", default=False,
help="don't build, only tag and run the posttag hook")
tag_group.add_option("--git-retag", action="store_true", dest="retag", default=False,
help="don't fail if the tag already exists")
tag_group.add_boolean_config_file_option(option_name="sign-tags", dest="sign_tags")
tag_group.add_config_file_option(option_name="keyid", dest="keyid")
tag_group.add_config_file_option(option_name="debian-tag", dest="debian_tag")
tag_group.add_config_file_option(option_name="upstream-tag", dest="upstream_tag")
orig_group.add_config_file_option(option_name="upstream-tree", dest="upstream_tree")
orig_group.add_boolean_config_file_option(option_name="pristine-tar", dest="pristine_tar")
orig_group.add_boolean_config_file_option(option_name="pristine-tar-commit",
dest="pristine_tar_commit")
orig_group.add_config_file_option(option_name="force-create", dest="force_create",
help="force creation of orig tarball", action="store_true")
orig_group.add_config_file_option(option_name="no-create-orig", dest="no_create_orig",
help="don't create orig tarball", action="store_true")
orig_group.add_config_file_option(option_name="tarball-dir", dest="tarball_dir", type="path",
help="location to look for external tarballs")
orig_group.add_config_file_option(option_name="compression", dest="comp_type",
help="Compression type, default is '%(compression)s'")
orig_group.add_config_file_option(option_name="compression-level", dest="comp_level",
help="Compression level, default is '%(compression-level)s'")
branch_group.add_config_file_option(option_name="upstream-branch", dest="upstream_branch")
branch_group.add_config_file_option(option_name="debian-branch", dest="debian_branch")
branch_group.add_boolean_config_file_option(option_name = "ignore-branch", dest="ignore_branch")
branch_group.add_boolean_config_file_option(option_name = "submodules", dest="with_submodules")
cmd_group.add_config_file_option(option_name="builder", dest="builder",
help="command to build the Debian package, default is '%(builder)s'")
cmd_group.add_config_file_option(option_name="cleaner", dest="cleaner",
help="command to clean the working copy, default is '%(cleaner)s'")
cmd_group.add_config_file_option(option_name="prebuild", dest="prebuild",
help="command to run before a build, default is '%(prebuild)s'")
cmd_group.add_config_file_option(option_name="postexport", dest="postexport",
help="command to run after exporting the source tree, default is '%(postexport)s'")
cmd_group.add_config_file_option(option_name="postbuild", dest="postbuild",
help="hook run after a successful build, default is '%(postbuild)s'")
cmd_group.add_config_file_option(option_name="posttag", dest="posttag",
help="hook run after a successful tag operation, default is '%(posttag)s'")
cmd_group.add_boolean_config_file_option(option_name="pbuilder", dest="use_pbuilder")
cmd_group.add_boolean_config_file_option(option_name="qemubuilder", dest="use_qemubuilder")
cmd_group.add_config_file_option(option_name="dist", dest="pbuilder_dist")
cmd_group.add_config_file_option(option_name="arch", dest="pbuilder_arch")
cmd_group.add_boolean_config_file_option(option_name = "pbuilder-autoconf", dest="pbuilder_autoconf")
cmd_group.add_config_file_option(option_name="pbuilder-options", dest="pbuilder_options")
export_group.add_config_file_option(option_name="export-dir", dest="export_dir", type="path",
help="before building the package export the source into EXPORT_DIR, default is '%(export-dir)s'")
export_group.add_config_file_option("export", dest="export",
help="export treeish object TREEISH, default is '%(export)s'", metavar="TREEISH")
export_group.add_option("--git-dont-purge", action="store_false", dest="purge", default=True,
help="retain exported package build directory")
export_group.add_boolean_config_file_option(option_name="overlay", dest="overlay")
options, args = parser.parse_args(args)
gbp.log.setup(options.color, options.verbose)
if options.retag:
if not options.tag and not options.tag_only:
gbp.log.err("'--%sretag' needs either '--%stag' or '--%stag-only'" % (prefix, prefix, prefix))
return None, None, None
if options.overlay and not options.export_dir:
gbp.log.err("Overlay must be used with --git-export-dir")
return None, None, None
return options, args, dpkg_args
示例8: build_parser
# 需要导入模块: from gbp.config import GbpOptionParserDebian [as 别名]
# 或者: from gbp.config.GbpOptionParserDebian import add_option_group [as 别名]
def build_parser(name, prefix=None):
try:
parser = GbpOptionParserDebian(command=os.path.basename(name), prefix=prefix)
except configparser.ParsingError as err:
gbp.log.err(err)
return None
tag_group = GbpOptionGroup(parser, "tag options", "options related to git tag creation")
branch_group = GbpOptionGroup(parser, "branch options", "branch layout options")
cmd_group = GbpOptionGroup(parser, "external command options", "how and when to invoke external commands and hooks")
orig_group = GbpOptionGroup(parser, "orig tarball options", "options related to the creation of the orig tarball")
export_group = GbpOptionGroup(parser, "export build-tree options", "alternative build tree related options")
parser.add_option_group(tag_group)
parser.add_option_group(orig_group)
parser.add_option_group(branch_group)
parser.add_option_group(cmd_group)
parser.add_option_group(export_group)
parser.add_boolean_config_file_option(option_name = "ignore-new", dest="ignore_new")
parser.add_option("--git-verbose", action="store_true", dest="verbose", default=False,
help="verbose command execution")
parser.add_config_file_option(option_name="color", dest="color", type='tristate')
parser.add_config_file_option(option_name="color-scheme",
dest="color_scheme")
parser.add_config_file_option(option_name="notify", dest="notify", type='tristate')
tag_group.add_option("--git-tag", action="store_true", dest="tag", default=False,
help="create a tag after a successful build")
tag_group.add_option("--git-tag-only", action="store_true", dest="tag_only", default=False,
help="don't build, only tag and run the posttag hook")
tag_group.add_option("--git-retag", action="store_true", dest="retag", default=False,
help="don't fail if the tag already exists")
tag_group.add_boolean_config_file_option(option_name="sign-tags", dest="sign_tags")
tag_group.add_config_file_option(option_name="keyid", dest="keyid")
tag_group.add_config_file_option(option_name="debian-tag", dest="debian_tag")
tag_group.add_config_file_option(option_name="debian-tag-msg", dest="debian_tag_msg")
tag_group.add_config_file_option(option_name="upstream-tag", dest="upstream_tag")
orig_group.add_config_file_option(option_name="upstream-tree", dest="upstream_tree")
orig_group.add_boolean_config_file_option(option_name="pristine-tar", dest="pristine_tar")
orig_group.add_boolean_config_file_option(option_name="pristine-tar-commit",
dest="pristine_tar_commit")
orig_group.add_config_file_option(option_name="force-create", dest="force_create",
help="force creation of orig tarball", action="store_true")
orig_group.add_config_file_option(option_name="no-create-orig", dest="no_create_orig",
help="don't create orig tarball", action="store_true")
orig_group.add_config_file_option(option_name="tarball-dir", dest="tarball_dir", type="path",
help="location to look for external tarballs")
orig_group.add_config_file_option(option_name="compression", dest="comp_type",
help="Compression type, default is '%(compression)s'")
orig_group.add_config_file_option(option_name="compression-level", dest="comp_level",
help="Compression level, default is '%(compression-level)s'")
orig_group.add_option("--git-subtarball", action="append", metavar='SUBTARBALL',
dest="subtarballs", help="subtarsball to generate, can be given multiple times", default=[])
branch_group.add_config_file_option(option_name="upstream-branch", dest="upstream_branch")
branch_group.add_config_file_option(option_name="debian-branch", dest="debian_branch")
branch_group.add_boolean_config_file_option(option_name = "ignore-branch", dest="ignore_branch")
branch_group.add_boolean_config_file_option(option_name = "submodules", dest="with_submodules")
cmd_group.add_config_file_option(option_name="builder", dest="builder",
help="command to build the Debian package, default is '%(builder)s'")
cmd_group.add_config_file_option(option_name="cleaner", dest="cleaner",
help="command to clean the working copy, default is '%(cleaner)s'")
cmd_group.add_config_file_option(option_name="prebuild", dest="prebuild",
help="hook to run before a build, default is '%(prebuild)s'")
cmd_group.add_config_file_option(option_name="postexport", dest="postexport",
help="hook to run after exporting the source tree, default is '%(postexport)s'")
cmd_group.add_config_file_option(option_name="postbuild", dest="postbuild",
help="hook run after a successful build, default is '%(postbuild)s'")
cmd_group.add_config_file_option(option_name="posttag", dest="posttag",
help="hook run after a successful tag operation, default is '%(posttag)s'")
cmd_group.add_boolean_config_file_option(option_name="pbuilder", dest="use_pbuilder")
cmd_group.add_boolean_config_file_option(option_name="qemubuilder", dest="use_qemubuilder")
cmd_group.add_config_file_option(option_name="dist", dest="pbuilder_dist")
cmd_group.add_config_file_option(option_name="arch", dest="pbuilder_arch")
cmd_group.add_boolean_config_file_option(option_name = "pbuilder-autoconf", dest="pbuilder_autoconf")
cmd_group.add_config_file_option(option_name="pbuilder-options", dest="pbuilder_options")
cmd_group.add_boolean_config_file_option(option_name="hooks", dest="hooks")
export_group.add_config_file_option(option_name="export-dir", dest="export_dir", type="path",
help="before building the package export the source into EXPORT_DIR, default is '%(export-dir)s'")
export_group.add_config_file_option("export", dest="export",
help="export treeish object TREEISH, default is '%(export)s'", metavar="TREEISH")
export_group.add_boolean_config_file_option(option_name="purge", dest="purge")
export_group.add_option("--git-dont-purge", action="store_true", dest="dont_purge", default=False,
help="deprecated, use --git-no-purge instead")
export_group.add_boolean_config_file_option(option_name="overlay", dest="overlay")
return parser
示例9: build_parser
# 需要导入模块: from gbp.config import GbpOptionParserDebian [as 别名]
# 或者: from gbp.config.GbpOptionParserDebian import add_option_group [as 别名]
def build_parser(name):
try:
parser = GbpOptionParserDebian(command=os.path.basename(name), prefix='',
usage='%prog [options] /path/to/upstream-version.tar.gz | --uscan')
except GbpError as err:
gbp.log.err(err)
return None
import_group = GbpOptionGroup(parser, "import options",
"pristine-tar and filtering")
tag_group = GbpOptionGroup(parser, "tag options",
"options related to git tag creation")
branch_group = GbpOptionGroup(parser, "version and branch naming options",
"version number and branch layout options")
cmd_group = GbpOptionGroup(parser, "external command options",
"how and when to invoke external commands and hooks")
for group in [import_group, branch_group, tag_group, cmd_group]:
parser.add_option_group(group)
branch_group.add_option("-u", "--upstream-version", dest="version",
help="Upstream Version")
branch_group.add_config_file_option(option_name="debian-branch",
dest="debian_branch")
branch_group.add_config_file_option(option_name="upstream-branch",
dest="upstream_branch")
branch_group.add_config_file_option(option_name="upstream-vcs-tag", dest="vcs_tag")
branch_group.add_boolean_config_file_option(option_name="merge", dest="merge")
branch_group.add_config_file_option(option_name="merge-mode", dest="merge_mode")
tag_group.add_boolean_config_file_option(option_name="sign-tags",
dest="sign_tags")
tag_group.add_config_file_option(option_name="keyid",
dest="keyid")
tag_group.add_config_file_option(option_name="upstream-tag",
dest="upstream_tag")
import_group.add_config_file_option(option_name="filter",
dest="filters", action="append")
import_group.add_boolean_config_file_option(option_name="pristine-tar",
dest="pristine_tar")
import_group.add_boolean_config_file_option(option_name="filter-pristine-tar",
dest="filter_pristine_tar")
import_group.add_config_file_option(option_name="import-msg",
dest="import_msg")
import_group.add_boolean_config_file_option(option_name="symlink-orig",
dest="symlink_orig")
import_group.add_config_file_option("component", action="append", metavar='COMPONENT',
dest="components")
cmd_group.add_config_file_option(option_name="postimport", dest="postimport")
cmd_group.add_config_file_option(option_name="postunpack", dest="postunpack")
parser.add_boolean_config_file_option(option_name="interactive",
dest='interactive')
parser.add_boolean_config_file_option(option_name="rollback",
dest="rollback")
parser.add_option("-v", "--verbose", action="store_true", dest="verbose", default=False,
help="verbose command execution")
parser.add_config_file_option(option_name="color", dest="color", type='tristate')
parser.add_config_file_option(option_name="color-scheme",
dest="color_scheme")
parser.add_option("--uscan", dest='uscan', action="store_true",
default=False, help="use uscan(1) to download the new tarball.")
# Accepted for compatibility
parser.add_option("--download", dest='download', action="store_true",
default=False, help="Ignored. Accepted for compatibility; see EXAMPLES in gbp-import-orig(1).")
return parser
示例10: build_parser
# 需要导入模块: from gbp.config import GbpOptionParserDebian [as 别名]
# 或者: from gbp.config.GbpOptionParserDebian import add_option_group [as 别名]
def build_parser(name):
try:
parser = GbpOptionParserDebian(command=os.path.basename(name), usage="%prog [options] paths")
except ConfigParser.ParsingError as err:
gbp.log.err(err)
return None
range_group = GbpOptionGroup(parser, "commit range options", "which commits to add to the changelog")
version_group = GbpOptionGroup(parser, "release & version number options", "what version number and release to use")
commit_group = GbpOptionGroup(parser, "commit message formatting", "howto format the changelog entries")
naming_group = GbpOptionGroup(parser, "branch and tag naming", "branch names and tag formats")
custom_group = GbpOptionGroup(parser, "customization", "options for customization")
parser.add_option_group(range_group)
parser.add_option_group(version_group)
parser.add_option_group(commit_group)
parser.add_option_group(naming_group)
parser.add_option_group(custom_group)
parser.add_boolean_config_file_option(option_name="ignore-branch", dest="ignore_branch")
naming_group.add_config_file_option(option_name="debian-branch", dest="debian_branch")
naming_group.add_config_file_option(option_name="upstream-tag", dest="upstream_tag")
naming_group.add_config_file_option(option_name="debian-tag", dest="debian_tag")
naming_group.add_config_file_option(
option_name="snapshot-number",
dest="snapshot_number",
help="expression to determine the next snapshot number, default is '%(snapshot-number)s'",
)
parser.add_config_file_option(
option_name="git-log", dest="git_log", help="options to pass to git-log, default is '%(git-log)s'"
)
parser.add_option(
"-v", "--verbose", action="store_true", dest="verbose", default=False, help="verbose command execution"
)
parser.add_config_file_option(option_name="color", dest="color", type="tristate")
parser.add_config_file_option(option_name="color-scheme", dest="color_scheme")
range_group.add_option("-s", "--since", dest="since", help="commit to start from (e.g. HEAD^^^, debian/0.4.3)")
range_group.add_option(
"-a",
"--auto",
action="store_true",
dest="auto",
default=False,
help="autocomplete changelog from last snapshot or tag",
)
version_group.add_option(
"-R", "--release", action="store_true", dest="release", default=False, help="mark as release"
)
version_group.add_option(
"-S", "--snapshot", action="store_true", dest="snapshot", default=False, help="mark as snapshot build"
)
version_group.add_option("-D", "--distribution", dest="distribution", help="Set distribution")
version_group.add_option(
"--force-distribution",
action="store_true",
dest="force_distribution",
default=False,
help="Force the provided distribution to be used, even if it doesn't match the list of known distributions",
)
version_group.add_option(
"-N", "--new-version", dest="new_version", help="use this as base for the new version number"
)
version_group.add_option("-U", "--urgency", dest="urgency", help="Set urgency level")
version_group.add_option(
"--bpo",
dest="bpo",
action="store_true",
default=False,
help="Increment the Debian release number for an upload to backports, and add a backport upload changelog comment.",
)
version_group.add_option(
"--nmu",
dest="nmu",
action="store_true",
default=False,
help="Increment the Debian release number for a non-maintainer upload",
)
version_group.add_option(
"--qa",
dest="qa",
action="store_true",
default=False,
help="Increment the Debian release number for a Debian QA Team upload, and add a QA upload changelog comment.",
)
version_group.add_option(
"--team",
dest="team",
action="store_true",
default=False,
help="Increment the Debian release number for a Debian Team upload, and add a Team upload changelog comment.",
)
version_group.add_option(
"--security",
dest="security",
action="store_true",
default=False,
help="Increment the Debian release number for a security upload and add a security upload changelog comment.",
)
version_group.add_boolean_config_file_option(option_name="git-author", dest="git_author")
commit_group.add_boolean_config_file_option(option_name="meta", dest="meta")
commit_group.add_config_file_option(
#.........这里部分代码省略.........
示例11: main
# 需要导入模块: from gbp.config import GbpOptionParserDebian [as 别名]
# 或者: from gbp.config.GbpOptionParserDebian import add_option_group [as 别名]
def main(argv):
ret = 0
changelog = 'debian/changelog'
until = 'HEAD'
found_snapshot_header = False
version_change = {}
try:
parser = GbpOptionParserDebian(command=os.path.basename(argv[0]), prefix='',
usage='%prog [options] paths')
except ConfigParser.ParsingError as err:
gbp.log.err(err)
return 1
range_group = GbpOptionGroup(parser, "commit range options",
"which commits to add to the changelog")
version_group = GbpOptionGroup(parser, "release & version number options",
"what version number and release to use")
commit_group = GbpOptionGroup(parser, "commit message formatting",
"howto format the changelog entries")
naming_group = GbpOptionGroup(parser, "branch and tag naming",
"branch names and tag formats")
custom_group = GbpOptionGroup(parser, "customization",
"options for customization")
parser.add_option_group(range_group)
parser.add_option_group(version_group)
parser.add_option_group(commit_group)
parser.add_option_group(naming_group)
parser.add_option_group(custom_group)
parser.add_boolean_config_file_option(option_name = "ignore-branch", dest="ignore_branch")
naming_group.add_config_file_option(option_name="debian-branch", dest="debian_branch")
naming_group.add_config_file_option(option_name="upstream-tag", dest="upstream_tag")
naming_group.add_config_file_option(option_name="debian-tag", dest="debian_tag")
naming_group.add_config_file_option(option_name="snapshot-number", dest="snapshot_number",
help="expression to determine the next snapshot number, default is '%(snapshot-number)s'")
parser.add_config_file_option(option_name="git-log", dest="git_log",
help="options to pass to git-log, default is '%(git-log)s'")
parser.add_option("-v", "--verbose", action="store_true", dest="verbose", default=False,
help="verbose command execution")
parser.add_config_file_option(option_name="color", dest="color", type='tristate')
range_group.add_option("-s", "--since", dest="since", help="commit to start from (e.g. HEAD^^^, debian/0.4.3)")
range_group.add_option("-a", "--auto", action="store_true", dest="auto", default=False,
help="autocomplete changelog from last snapshot or tag")
version_group.add_option("-R", "--release", action="store_true", dest="release", default=False,
help="mark as release")
version_group.add_option("-S", "--snapshot", action="store_true", dest="snapshot", default=False,
help="mark as snapshot build")
version_group.add_option("-N", "--new-version", dest="new_version",
help="use this as base for the new version number")
version_group.add_option("--bpo", dest="bpo", action="store_true", default=False,
help="Increment the Debian release number for an upload to backports, and add a backport upload changelog comment.")
version_group.add_option("--nmu", dest="nmu", action="store_true", default=False,
help="Increment the Debian release number for a non-maintainer upload")
version_group.add_option("--qa", dest="qa", action="store_true", default=False,
help="Increment the Debian release number for a Debian QA Team upload, and add a QA upload changelog comment.")
version_group.add_option("--team", dest="team", action="store_true", default=False,
help="Increment the Debian release number for a Debian Team upload, and add a Team upload changelog comment.")
version_group.add_boolean_config_file_option(option_name="git-author", dest="git_author")
commit_group.add_boolean_config_file_option(option_name="meta", dest="meta")
commit_group.add_config_file_option(option_name="meta-closes", dest="meta_closes",
help="Meta tags for the bts close commands, default is '%(meta-closes)s'")
commit_group.add_boolean_config_file_option(option_name="full", dest="full")
commit_group.add_config_file_option(option_name="id-length", dest="idlen",
help="include N digits of the commit id in the changelog entry, default is '%(id-length)s'",
type="int", metavar="N")
commit_group.add_config_file_option(option_name="ignore-regex", dest="ignore_regex",
help="Ignore commit lines matching regex, default is '%(ignore-regex)s'")
commit_group.add_boolean_config_file_option(option_name="multimaint", dest="multimaint")
commit_group.add_boolean_config_file_option(option_name="multimaint-merge", dest="multimaint_merge")
commit_group.add_config_file_option(option_name="spawn-editor", dest="spawn_editor")
parser.add_config_file_option(option_name="commit-msg",
dest="commit_msg")
parser.add_option("-c", "--commit", action="store_true", dest="commit", default=False,
help="commit changelog file after generating")
help_msg = ('Load Python code from CUSTOMIZATION_FILE. At the moment,'
' the only useful thing the code can do is define a custom'
' format_changelog_entry() function.')
custom_group.add_config_file_option(option_name="customizations",
dest="customization_file",
help=help_msg)
(options, args) = parser.parse_args(argv[1:])
gbp.log.setup(options.color, options.verbose)
dch_options = process_options(options, parser)
editor_cmd = process_editor_option(options)
try:
try:
repo = DebianGitRepository('.')
except GitRepositoryError:
raise GbpError("%s is not a git repository" % (os.path.abspath('.')))
branch = repo.get_branch()
if options.debian_branch != branch and not options.ignore_branch:
gbp.log.err("You are not on branch '%s' but on '%s'" % (options.debian_branch, branch))
raise GbpError("Use --ignore-branch to ignore or --debian-branch to set the branch name.")
cp = ChangeLog(filename=changelog)
#.........这里部分代码省略.........