Skip to content

Commit

Permalink
base: Add --quiet flag
Browse files Browse the repository at this point in the history
  • Loading branch information
marv7000 committed Jan 30, 2025
1 parent 9ef6413 commit a470a1b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
7 changes: 7 additions & 0 deletions xbstrap/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@
main_parser.add_argument(
"-C", type=str, dest="build_dir", help="build dir (in place of cwd)", default=""
)
main_parser.add_argument(
"--quiet",
action="store_true",
default=False,
help="redirect stdout of packages to /dev/null",
)
main_subparsers = main_parser.add_subparsers(dest="command")


Expand All @@ -56,6 +62,7 @@ def config_for_args(args):
changed_source_root=args.source_dir,
debug_cfg_files=args.debug_cfg_files,
ignore_cfg_cache=args.ignore_cfg_cache,
quiet=args.quiet
)


Expand Down
5 changes: 3 additions & 2 deletions xbstrap/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,10 +252,11 @@ def name_from_subject_id(subject_id):

class Config:
def __init__(
self, path, changed_source_root=None, *, debug_cfg_files=False, ignore_cfg_cache=False
self, path, changed_source_root=None, *, debug_cfg_files=False, ignore_cfg_cache=False, quiet=False
):
self.debug_cfg_files = debug_cfg_files
self.ignore_cfg_cache = ignore_cfg_cache
self.quiet = quiet

self._build_root_override = None if path == "" else path
self._config_path = path
Expand Down Expand Up @@ -2181,7 +2182,7 @@ def run_program(
"args": args,
"workdir": workdir,
"extra_environ": extra_environ,
"quiet": quiet,
"quiet": quiet or cfg.quiet,
"cargo_home": cfg.cargo_config_toml is not None and cargo_home,
"for_package": for_package,
"virtual_tools": list(virtual_tools),
Expand Down

0 comments on commit a470a1b

Please sign in to comment.