Skip to content

Commit

Permalink
Merge pull request #318 from hartwork/require-etc-portage-location-on…
Browse files Browse the repository at this point in the history
…-non-gentoo-hosts

[gentoo-build] Require `--etc-portage PATH` on non-Gentoo hosts
  • Loading branch information
hartwork authored Oct 24, 2024
2 parents 160c870 + 78d46de commit de4c98f
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 de4c98f

Please sign in to comment.