Skip to content

Commit

Permalink
build.py: Require --etc-portage on non-Gentoo hosts
Browse files Browse the repository at this point in the history
  • Loading branch information
hartwork committed Oct 24, 2024
1 parent a78ca35 commit 78d46de
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 6 additions & 1 deletion binary_gentoo/internal/cli/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,13 @@ def parse_command_line(argv):
"--etc-portage",
dest="host_etc_portage",
metavar="DIR",
required=not HOST_IS_GENTOO,
default="/etc/portage",
help='enforce specific location for /etc/portage (default: "%(default)s")',
help=(
'enforce specific location for /etc/portage (default: "%(default)s")'
if HOST_IS_GENTOO
else "specify /etc/portage location (required)"
),
)

parser_group_flavors_or_image = parser.add_mutually_exclusive_group()
Expand Down
3 changes: 3 additions & 0 deletions binary_gentoo/internal/cli/tests/test_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ def _run_gentoo_build_with_subprocess_mocked(
TemporaryDirectory() as temp_pkgdir,
TemporaryDirectory() as temp_portdir,
TemporaryDirectory() as temp_logdir,
TemporaryDirectory() as temp_etcportagedir,
):
argv = (
[
Expand All @@ -119,6 +120,8 @@ def _run_gentoo_build_with_subprocess_mocked(
temp_portdir,
"--logdir",
temp_logdir,
"--etc-portage",
temp_etcportagedir,
"--gentoo-profile",
"default/linux/profile123",
"--cflags",
Expand Down

0 comments on commit 78d46de

Please sign in to comment.