diff options
author | Markus Lehtonen <markus.lehtonen@linux.intel.com> | 2012-01-12 15:45:06 +0200 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2014-07-24 23:33:36 +0200 |
commit | ed228a25059d4600a0e3155151febb8c8e1f66fb (patch) | |
tree | b3246b154d32a5afdd76b7f61da0333663dc86c1 | |
parent | 2bf944f14ceef34cd50afd7786b6627c6bd7df72 (diff) | |
download | git-buildpackage-ed228a25059d4600a0e3155151febb8c8e1f66fb.tar.gz git-buildpackage-ed228a25059d4600a0e3155151febb8c8e1f66fb.tar.bz2 git-buildpackage-ed228a25059d4600a0e3155151febb8c8e1f66fb.zip |
import-srpm: add 'vendor' config option
Intended to represent the distribution vendor (e.g. 'Debian').
Currently, this can be used in tag format strings.
NOTE: the vendor name is converted to lowercase when used in tag names.
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
-rw-r--r-- | gbp/config.py | 3 | ||||
-rwxr-xr-x | gbp/scripts/import_srpm.py | 7 |
2 files changed, 7 insertions, 3 deletions
diff --git a/gbp/config.py b/gbp/config.py index 02a6f06f..af21fb8a 100644 --- a/gbp/config.py +++ b/gbp/config.py @@ -524,6 +524,7 @@ class GbpOptionParserRpm(GbpOptionParser): defaults = dict(GbpOptionParser.defaults) defaults.update({ 'tmp-dir' : '/var/tmp/gbp/', + 'vendor' : 'Downstream', 'packaging-branch' : 'master', 'packaging-dir' : '', 'packaging-tag' : 'packaging/%(version)s', @@ -534,6 +535,8 @@ class GbpOptionParserRpm(GbpOptionParser): 'tmp-dir': "Base directory under which temporary directories are " "created, default is '%(tmp-dir)s'", + 'vendor': + "Distribution vendor name, default is '%(vendor)s'", 'packaging-branch': "Branch the packaging is being maintained on, rpm counterpart " "of the 'debian-branch' option, default is " diff --git a/gbp/scripts/import_srpm.py b/gbp/scripts/import_srpm.py index 7fd5a4e7..193b9245 100755 --- a/gbp/scripts/import_srpm.py +++ b/gbp/scripts/import_srpm.py @@ -143,6 +143,8 @@ def parse_args(argv): parser.add_config_file_option(option_name="color-scheme", dest="color_scheme") parser.add_config_file_option(option_name="tmp-dir", dest="tmp_dir") + parser.add_config_file_option(option_name="vendor", action="store", + dest="vendor") parser.add_option("--download", action="store_true", dest="download", default=False, help="download source package") branch_group.add_config_file_option(option_name="packaging-branch", @@ -301,7 +303,7 @@ def main(argv): src_tag_format = options.packaging_tag if options.native \ else options.upstream_tag - tag_str_fields = spec.version + tag_str_fields = dict(spec.version, vendor=options.vendor.lower()) src_tag = repo.version_to_tag(src_tag_format, tag_str_fields) ver_str = compose_version_str(spec.version) @@ -388,8 +390,7 @@ def main(argv): raise GbpError tag = repo.version_to_tag(options.packaging_tag, tag_str_fields) - pkg_vendor = "Native" if options.native else "Downstrean" - msg = "%s release %s" % (pkg_vendor, ver_str) + msg = "%s release %s" % (options.vendor, ver_str) if options.orphan_packaging or not sources: commit = repo.commit_dir(dirs['packaging_base'], |