From a49649ce3e446989e0758112d087cd3fac6ba68d Mon Sep 17 00:00:00 2001 From: Devan Goodwin Date: Fri, 7 Mar 2014 14:29:10 -0400 Subject: [PATCH] Fix some missed references to deprecated config names. --- README.mkd | 2 +- src/tito/cli.py | 11 +++-------- src/tito/tagger/main.py | 31 ++++++++++++++++--------------- tito.8.asciidoc | 2 +- tito.props.5.asciidoc | 30 ++++++++++-------------------- 5 files changed, 31 insertions(+), 45 deletions(-) diff --git a/README.mkd b/README.mkd index 0975dbe..87c8af0 100644 --- a/README.mkd +++ b/README.mkd @@ -112,7 +112,7 @@ This will: By default if you omit --keep-version, tito will tag by bumping the rpm version. (i.e. we bump the Z in X.Y.Z. If you'd prefer to bump the package release instead (normally should just be used for changes to the spec file or -patches applied within it), you can change the default_tagger class in +patches applied within it), you can change the 'tagger' class in rel-eng/tito.props to ReleaseTagger. This will affect all packages in this git branch, if you'd prefer to do this on a per-package basis you can do so in a package specific tito.props. (see section below) diff --git a/src/tito/cli.py b/src/tito/cli.py index 3d33280..6c46714 100644 --- a/src/tito/cli.py +++ b/src/tito/cli.py @@ -340,9 +340,6 @@ class BuildModule(BaseCliModule): help="build a specific tag instead of the latest version " + "(i.e. spacewalk-java-0.4.0-1)") - self.parser.add_option("--release", dest="release", - action="store_true", help="DEPRECATED: please use 'tito release' instead.") - self.parser.add_option("--builder", dest="builder", help="Override the normal builder by specifying a full class " "path or one of the pre-configured shortcuts.") @@ -372,8 +369,6 @@ class BuildModule(BaseCliModule): build_tag = self.options.tag - if self.options.release: - error_out("'tito build --release' is now deprecated. Please see 'tito release'.") self.load_config(package_name, build_dir, self.options.tag) args = self._parse_builder_args() @@ -709,10 +704,10 @@ class InitModule(BaseCliModule): # write out tito.props out_f = open(propsfile, 'w') - out_f.write("[globalconfig]\n") - out_f.write("default_builder = %s\n" % 'tito.builder.Builder') + out_f.write("[buildconfig]\n") + out_f.write("builder = %s\n" % 'tito.builder.Builder') out_f.write( - "default_tagger = %s\n" % 'tito.tagger.VersionTagger') + "tagger = %s\n" % 'tito.tagger.VersionTagger') out_f.write("changelog_do_not_remove_cherrypick = 0\n") out_f.write("changelog_format = %s (%ae)\n") out_f.close() diff --git a/src/tito/tagger/main.py b/src/tito/tagger/main.py index b0ed69f..e6c0519 100644 --- a/src/tito/tagger/main.py +++ b/src/tito/tagger/main.py @@ -32,7 +32,8 @@ from tito.common import (debug, error_out, run_command, find_spec_file, get_project_name, get_latest_tagged_version, get_script_path, get_spec_version_and_release, replace_version, tag_exists_locally, tag_exists_remotely, head_points_to_tag, undo_tag, - increase_version, reset_release, increase_zstream) + increase_version, reset_release, increase_zstream, + BUILDCONFIG_SECTION) from tito.compat import * from tito.exception import TitoException from tito.config_object import ConfigObject @@ -154,11 +155,11 @@ class VersionTagger(ConfigObject): def _changelog_remove_cherrypick(self, line): """ remove text "(cherry picked from commit ..." from line unless - changelog_do_not_remove_cherrypick is specified in [globalconfig] + changelog_do_not_remove_cherrypick is specified in [BUILDCONFIG_SECTION] """ - if not (self.config.has_option("globalconfig", "changelog_do_not_remove_cherrypick") - and self.config.get("globalconfig", "changelog_do_not_remove_cherrypick") - and self.config.get("globalconfig", "changelog_do_not_remove_cherrypick").strip() != '0'): + if not (self.config.has_option("BUILDCONFIG_SECTION", "changelog_do_not_remove_cherrypick") + and self.config.get("BUILDCONFIG_SECTION", "changelog_do_not_remove_cherrypick") + and self.config.get("BUILDCONFIG_SECTION", "changelog_do_not_remove_cherrypick").strip() != '0'): m = re.match("(.+)(\(cherry picked from .*\))", line) if m: line = m.group(1) @@ -166,20 +167,20 @@ class VersionTagger(ConfigObject): def _changelog_format(self): """ - If you have set changelog_format in [globalconfig], it will return + If you have set changelog_format in [BUILDCONFIG_SECTION], it will return that string. Otherwise, return one of two defaults: - '%s (%ae)', if changelog_with_email is unset or evaluates to True - '%s', if changelog_with_email is set and evaluates to False """ result = '' - if self.config.has_option("globalconfig", "changelog_format"): - result = self.config.get("globalconfig", "changelog_format") + if self.config.has_option("BUILDCONFIG_SECTION", "changelog_format"): + result = self.config.get("BUILDCONFIG_SECTION", "changelog_format") else: with_email = '' - if (self.config.has_option("globalconfig", "changelog_with_email") - and (self.config.get("globalconfig", "changelog_with_email")) not in ['0', '']) or \ - not self.config.has_option("globalconfig", "changelog_with_email"): + if (self.config.has_option("BUILDCONFIG_SECTION", "changelog_with_email") + and (self.config.get("BUILDCONFIG_SECTION", "changelog_with_email")) not in ['0', '']) or \ + not self.config.has_option("BUILDCONFIG_SECTION", "changelog_with_email"): with_email = ' (%ae)' result = "%%s%s" % with_email return result @@ -437,8 +438,8 @@ class VersionTagger(ConfigObject): suffix = "" # If global config specifies a tag suffix, use it: - if self.config.has_option("globalconfig", "tag_suffix"): - suffix = self.config.get("globalconfig", "tag_suffix") + if self.config.has_option("BUILDCONFIG_SECTION", "tag_suffix"): + suffix = self.config.get("BUILDCONFIG_SECTION", "tag_suffix") new_version_w_suffix = "%s%s" % (new_version, suffix) # Write out our package metadata: @@ -527,8 +528,8 @@ class VersionTagger(ConfigObject): """ Returns the actual tag we'll be creating. """ suffix = "" # If global config specifies a tag suffix, use it: - if self.config.has_option("globalconfig", "tag_suffix"): - suffix = self.config.get("globalconfig", "tag_suffix") + if self.config.has_option("BUILDCONFIG_SECTION", "tag_suffix"): + suffix = self.config.get("BUILDCONFIG_SECTION", "tag_suffix") return "%s-%s%s" % (self.project_name, new_version, suffix) def _update_version_file(self, new_version): diff --git a/tito.8.asciidoc b/tito.8.asciidoc index 0e65d73..38ff787 100644 --- a/tito.8.asciidoc +++ b/tito.8.asciidoc @@ -60,7 +60,7 @@ NOTE: Your spec file should list the source as `%{name}-%{version}.tar.gz` By default, tito will tag by bumping the rpm version (i.e. we bump the Z in X.Y.Z). If you'd prefer to bump the package release instead (normally should just be used for changes to the spec file or -patches applied within it), you can change the default_tagger class in +patches applied within it), you can change the tagger class in rel-eng/tito.props to ReleaseTagger. This will affect all packages in this git branch; if you'd prefer to do this on a per-package basis you can do so in a package specific `tito.props`. diff --git a/tito.props.5.asciidoc b/tito.props.5.asciidoc index 0f2f875..efad16e 100644 --- a/tito.props.5.asciidoc +++ b/tito.props.5.asciidoc @@ -32,22 +32,22 @@ SECTIONS tito.props can contain several sections: -GLOBALCONFIG +BUILDCONFIG ------------ -This section is mandatory. At least in tito.props as you need to specify -default builder and tagger for you project. You can use following variables: +This section and a couple of it's properties are required. +You can use following variables: -default_builder:: +builder:: The fully qualified Builder class implementation to use. You can either specify builders shipped with tito(5) (see BUILDERS section below), or a custom builder located within the directory your `lib_dir` option -points to. +points to. This property is required. -default_tagger:: +tagger:: The fully qualified Tagger class implementation to use. You can either specify builders shipped with tito(5) (see TAGGERS section below), or a custom builder located within the directory your `lib_dir` option -points to. +points to. This property is required. lib_dir:: Optional property defining a directory to be added to the Python path when @@ -117,16 +117,6 @@ REQUIREMENTS tito:: If tito is older then specified version, it will refuse to continue. -BUILDCONFIG ------------ -builder:: -This option is used in package specific tito.props only, and allows that -project to override the default_builder defined in rel-eng/tito.props. - -tagger:: -This option is used in package specific tito.props only, and allows that -project to override the default_tagger defined in rel-eng/tito.props. - TAGCONFIG --------- @@ -224,9 +214,9 @@ from spec file) is rubygem-simple-navigation. EXAMPLE ------- - [globalconfig] - default_builder = tito.builder.Builder - default_tagger = tito.tagger.VersionTagger + [buildconfig] + builder = tito.builder.Builder + tagger = tito.tagger.VersionTagger [koji] autobuild_tags = dist-5E-sw-1.2-candidate dist-f12-sw-1.2-candidate dist-f13-sw-1.2-candidate