Skip to content

Commit

Permalink
Rename --without-init to --ignore-missing-config
Browse files Browse the repository at this point in the history
The behavior changed. We now build non-initialized projects without
any additional parameter. The `--without-init` could be confusing
because it could be understood as ignoring `.tito` directory even if
it is there. Which is not true, if `.tito` directory exists, the
parameter does nothing. It is only used to silence warnings.
  • Loading branch information
FrostyX committed Jan 11, 2024
1 parent b0e494f commit 0a59981
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
7 changes: 4 additions & 3 deletions src/tito/builder/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ def __init__(self, name=None, build_dir=None,
if args and 'test' in args:
self.test = True

self.without_init = self._get_optional_arg(kwargs, "without_init", False)
self.ignore_missing_config = \
self._get_optional_arg(kwargs, "ignore_missing_config", False)

# Location where we do all tito work and store resulting rpms:
self.rpmbuild_basedir = build_dir
Expand Down Expand Up @@ -419,7 +420,7 @@ def __init__(self, name=None, tag=None, build_dir=None,
self.relative_project_dir = get_relative_project_dir(
project_name=self.project_name, commit=self.git_commit_id)
if self.relative_project_dir is None and self.test:
if not self.without_init:
if not self.ignore_missing_config:
warn_out(".tito/packages/%s doesn't exist "
"in git, using current directory" % self.project_name)
self.relative_project_dir = get_relative_project_dir_cwd(
Expand Down Expand Up @@ -475,7 +476,7 @@ def _get_build_version(self):
if not self.test:
error_out(["Unable to lookup latest package info.",
"Perhaps you need to tag first?"])
if not self.without_init:
if not self.ignore_missing_config:
warn_out("Unable to lookup latest package "
"tag, building untagged test project")
build_version = get_spec_version_and_release(self.start_dir,
Expand Down
8 changes: 4 additions & 4 deletions src/tito/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,10 +293,10 @@ def _check_config_and_load(self, loader):
error_out("Unable to locate branch configuration: %s\n"
"Please run 'tito init'" % loader.tito_props_path)

if not self.options.without_init:
if not self.options.ignore_missing_config:
warn_out("Tito project wasn't initialized, "
"using the default configuration")
warn_out("Consider `tito init' or the `--without-init' "
warn_out("Consider `tito init' or the `--ignore-missing-config' "
"parameter to silent the warnings")

self.config = self.initial_config
Expand Down Expand Up @@ -366,7 +366,7 @@ def __init__(self):

self.parser.add_option("--test", dest="test", action="store_true",
help="use current branch HEAD instead of latest package tag")
self.parser.add_option("--without-init", action="store_true",
self.parser.add_option("--ignore-missing-config", action="store_true",
help=("Acknowledge working in non-initialized project "
"and silencing all related warnings"))
self.parser.add_option("--no-cleanup", dest="no_cleanup",
Expand Down Expand Up @@ -415,7 +415,7 @@ def main(self, argv):
kwargs = {
'dist': self.options.dist,
'test': self.options.test,
'without_init': self.options.without_init,
'ignore_missing_config': self.options.ignore_missing_config,
'offline': self.options.offline,
'auto_install': self.options.auto_install,
'rpmbuild_options': self.options.rpmbuild_options,
Expand Down

0 comments on commit 0a59981

Please sign in to comment.