Skip to content

Commit

Permalink
Merge branch 'gentoo:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
duxsco authored Jan 11, 2025
2 parents 01086cb + 327848b commit 4842869
Show file tree
Hide file tree
Showing 33 changed files with 176 additions and 373 deletions.
2 changes: 2 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ Bug fixes:

* ebuild.sh: Allow CC and CXX to be changed in profile.bashrc.

* eapi.sh: Remove support for unofficial 4-slot-abi EAPI.

portage-3.0.66.1 (2024-09-18)
--------------

Expand Down
15 changes: 7 additions & 8 deletions bin/binhost-snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import argparse
import os
import subprocess
import sys
import textwrap

Expand Down Expand Up @@ -107,20 +108,18 @@ def main(argv):
if not os.path.isdir(binhost_dir):
parser.error(f"binhost_dir could not be created: '{binhost_dir}'")

cp_opts = "RP"
cp_opts = "-RP"
if options.hardlinks == "n":
cp_opts += "p"
else:
cp_opts += "l"

cp_cmd = "cp -{} {} {}".format(
cp_opts,
portage._shell_quote(src_pkg_dir),
portage._shell_quote(snapshot_dir),
)
try:
result = subprocess.run(["cp", cp_opts, src_pkg_dir, snapshot_dir])
except OSError:
result = None

ret = os.system(cp_cmd)
if not (os.WIFEXITED(ret) and os.WEXITSTATUS(ret) == os.EX_OK):
if result is None or result.returncode != 0:
return 1

infile = open(
Expand Down
98 changes: 49 additions & 49 deletions bin/eapi.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
# Copyright 2012-2024 Gentoo Authors
# Copyright 2012-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

# PHASES
Expand All @@ -17,7 +17,7 @@ ___eapi_has_src_configure() {
}

___eapi_default_src_test_disables_parallel_jobs() {
[[ ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-slot-abi)$ ]]
[[ ${1-${EAPI-0}} =~ ^(0|1|2|3|4)$ ]]
}

___eapi_has_S_WORKDIR_fallback() {
Expand All @@ -31,35 +31,35 @@ ___eapi_has_prefix_variables() {
}

___eapi_has_BROOT() {
[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-slot-abi|5|6)$ ]]
[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|5|6)$ ]]
}

___eapi_has_SYSROOT() {
[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-slot-abi|5|6)$ ]]
[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|5|6)$ ]]
}

___eapi_has_BDEPEND() {
[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-slot-abi|5|6)$ ]]
[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|5|6)$ ]]
}

___eapi_has_IDEPEND() {
[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-slot-abi|5|6|7)$ ]]
[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|5|6|7)$ ]]
}

___eapi_has_RDEPEND_DEPEND_fallback() {
[[ ${1-${EAPI-0}} =~ ^(0|1|2|3)$ ]]
}

___eapi_has_PORTDIR_ECLASSDIR() {
[[ ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-slot-abi|5|6)$ ]]
[[ ${1-${EAPI-0}} =~ ^(0|1|2|3|4|5|6)$ ]]
}

___eapi_has_accumulated_PROPERTIES() {
[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-slot-abi|5|6|7)$ ]]
[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|5|6|7)$ ]]
}

___eapi_has_accumulated_RESTRICT() {
[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-slot-abi|5|6|7)$ ]]
[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|5|6|7)$ ]]
}

# HELPERS PRESENCE
Expand All @@ -73,71 +73,71 @@ ___eapi_has_dosed() {
}

___eapi_has_einstall() {
[[ ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-slot-abi|5)$ ]]
[[ ${1-${EAPI-0}} =~ ^(0|1|2|3|4|5)$ ]]
}

___eapi_has_dohtml() {
[[ ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-slot-abi|5|6)$ ]]
[[ ${1-${EAPI-0}} =~ ^(0|1|2|3|4|5|6)$ ]]
}

___eapi_has_dolib_libopts() {
[[ ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-slot-abi|5|6)$ ]]
[[ ${1-${EAPI-0}} =~ ^(0|1|2|3|4|5|6)$ ]]
}

___eapi_has_docompress() {
[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3)$ ]]
}

___eapi_has_dostrip() {
[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-slot-abi|5|6)$ ]]
[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|5|6)$ ]]
}

___eapi_has_nonfatal() {
[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3)$ ]]
}

___eapi_has_doheader() {
[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-slot-abi)$ ]]
[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4)$ ]]
}

___eapi_has_usex() {
[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-slot-abi)$ ]]
[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4)$ ]]
}

___eapi_has_get_libdir() {
[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-slot-abi|5)$ ]]
[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|5)$ ]]
}

___eapi_has_einstalldocs() {
[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-slot-abi|5)$ ]]
[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|5)$ ]]
}

___eapi_has_eapply() {
[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-slot-abi|5)$ ]]
[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|5)$ ]]
}

___eapi_has_eapply_user() {
[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-slot-abi|5)$ ]]
[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|5)$ ]]
}

___eapi_has_in_iuse() {
[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-slot-abi|5)$ ]]
[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|5)$ ]]
}

___eapi_has_version_functions() {
[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-slot-abi|5|6)$ ]]
[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|5|6)$ ]]
}

___eapi_has_hasq() {
[[ ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-slot-abi|5|6|7)$ ]]
[[ ${1-${EAPI-0}} =~ ^(0|1|2|3|4|5|6|7)$ ]]
}

___eapi_has_hasv() {
[[ ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-slot-abi|5|6|7)$ ]]
[[ ${1-${EAPI-0}} =~ ^(0|1|2|3|4|5|6|7)$ ]]
}

___eapi_has_useq() {
[[ ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-slot-abi|5|6|7)$ ]]
[[ ${1-${EAPI-0}} =~ ^(0|1|2|3|4|5|6|7)$ ]]
}

# HELPERS BEHAVIOR
Expand All @@ -147,51 +147,51 @@ ___eapi_best_version_and_has_version_support_--host-root() {
}

___eapi_best_version_and_has_version_support_-b_-d_-r() {
[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-slot-abi|5|6)$ ]]
[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|5|6)$ ]]
}

___eapi_unpack_supports_xz() {
[[ ! ${1-${EAPI-0}} =~ ^(0|1|2)$ ]]
}

___eapi_unpack_supports_txz() {
[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-slot-abi|5)$ ]]
[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|5)$ ]]
}

___eapi_unpack_supports_7z() {
[[ ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-slot-abi|5|6|7)$ ]]
[[ ${1-${EAPI-0}} =~ ^(0|1|2|3|4|5|6|7)$ ]]
}

___eapi_unpack_supports_lha() {
[[ ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-slot-abi|5|6|7)$ ]]
[[ ${1-${EAPI-0}} =~ ^(0|1|2|3|4|5|6|7)$ ]]
}

___eapi_unpack_supports_rar() {
[[ ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-slot-abi|5|6|7)$ ]]
[[ ${1-${EAPI-0}} =~ ^(0|1|2|3|4|5|6|7)$ ]]
}

___eapi_econf_passes_--disable-dependency-tracking() {
[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3)$ ]]
}

___eapi_econf_passes_--disable-silent-rules() {
[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-slot-abi)$ ]]
[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4)$ ]]
}

___eapi_econf_passes_--datarootdir() {
[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-slot-abi|5|6|7)$ ]]
[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|5|6|7)$ ]]
}

___eapi_econf_passes_--disable-static() {
[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-slot-abi|5|6|7)$ ]]
[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|5|6|7)$ ]]
}

___eapi_econf_passes_--docdir_and_--htmldir() {
[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-slot-abi|5)$ ]]
[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|5)$ ]]
}

___eapi_econf_passes_--with-sysroot() {
[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-slot-abi|5|6)$ ]]
[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|5|6)$ ]]
}

___eapi_use_enable_and_use_with_support_empty_third_argument() {
Expand All @@ -207,65 +207,65 @@ ___eapi_doins_and_newins_preserve_symlinks() {
}

___eapi_newins_supports_reading_from_standard_input() {
[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-slot-abi)$ ]]
[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4)$ ]]
}

___eapi_helpers_can_die() {
[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3)$ ]]
}

___eapi_unpack_is_case_sensitive() {
[[ ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-slot-abi|5)$ ]]
[[ ${1-${EAPI-0}} =~ ^(0|1|2|3|4|5)$ ]]
}

___eapi_unpack_supports_absolute_paths() {
[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-slot-abi|5)$ ]]
[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|5)$ ]]
}

___eapi_die_can_respect_nonfatal() {
[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-slot-abi|5)$ ]]
[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|5)$ ]]
}

___eapi_domo_respects_into() {
[[ ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-slot-abi|5|6)$ ]]
[[ ${1-${EAPI-0}} =~ ^(0|1|2|3|4|5|6)$ ]]
}

___eapi_has_DESTTREE_INSDESTTREE() {
[[ ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-slot-abi|5|6)$ ]]
[[ ${1-${EAPI-0}} =~ ^(0|1|2|3|4|5|6)$ ]]
}

___eapi_has_dosym_r() {
[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-slot-abi|5|6|7)$ ]]
[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|5|6|7)$ ]]
}

___eapi_usev_has_second_arg() {
[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-slot-abi|5|6|7)$ ]]
[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|5|6|7)$ ]]
}

___eapi_doconfd_respects_insopts() {
[[ ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-slot-abi|5|6|7)$ ]]
[[ ${1-${EAPI-0}} =~ ^(0|1|2|3|4|5|6|7)$ ]]
}

___eapi_doenvd_respects_insopts() {
[[ ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-slot-abi|5|6|7)$ ]]
[[ ${1-${EAPI-0}} =~ ^(0|1|2|3|4|5|6|7)$ ]]
}

___eapi_doheader_respects_insopts() {
[[ ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-slot-abi|5|6|7)$ ]]
[[ ${1-${EAPI-0}} =~ ^(0|1|2|3|4|5|6|7)$ ]]
}

___eapi_doinitd_respects_exeopts() {
[[ ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-slot-abi|5|6|7)$ ]]
[[ ${1-${EAPI-0}} =~ ^(0|1|2|3|4|5|6|7)$ ]]
}

# OTHERS

___eapi_enables_failglob_in_global_scope() {
[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-slot-abi|5)$ ]]
[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|5)$ ]]
}

___eapi_bash_3_2() {
[[ ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-slot-abi|5)$ ]]
[[ ${1-${EAPI-0}} =~ ^(0|1|2|3|4|5)$ ]]
}

___eapi_bash_4_2() {
Expand All @@ -277,7 +277,7 @@ ___eapi_bash_5_0() {
}

___eapi_has_ENV_UNSET() {
[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-slot-abi|5|6)$ ]]
[[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|5|6)$ ]]
}

___eapi_has_strict_keepdir() {
Expand Down
3 changes: 1 addition & 2 deletions bin/ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ import portage
portage._internal_caller = True
from portage import os
from portage import _encodings
from portage import _shell_quote
from portage import _unicode_encode
from portage.const import VDB_PATH
from portage.exception import (
Expand Down Expand Up @@ -165,7 +164,7 @@ def main():
if ebuild_portdir != vdb_path and ebuild_portdir not in portage.portdb.porttrees:
portdir_overlay = portage.settings.get("PORTDIR_OVERLAY", "")
os.environ["PORTDIR_OVERLAY"] = (
portdir_overlay + " " + _shell_quote(ebuild_portdir)
portdir_overlay + " " + shlex.quote(ebuild_portdir)
)

print(f"Appending {ebuild_portdir} to PORTDIR_OVERLAY...")
Expand Down
2 changes: 1 addition & 1 deletion bin/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def main(args):
if returncode != os.EX_OK:
portage.util.writemsg(
"!!! install: copy_xattrs failed with the "
f"following arguments: {' '.join(portage._shell_quote(x) for x in args)}\n",
f"following arguments: {shlex.join(args)}\n",
noiselevel=-1,
)
return returncode
Expand Down
6 changes: 3 additions & 3 deletions bin/phase-functions.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
# Copyright 1999-2023 Gentoo Authors
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

# Hardcoded bash lists are needed for backward compatibility with
Expand Down Expand Up @@ -934,7 +934,7 @@ __ebuild_phase_funcs() {
fi

# defaults starting with EAPI 6
if ! has ${eapi} 2 3 4 4-slot-abi 5; then
if ! has ${eapi} 2 3 4 5; then
[[ ${phase_func} == src_prepare ]] && \
default_src_prepare() { __eapi6_src_prepare; }
[[ ${phase_func} == src_install ]] && \
Expand All @@ -945,7 +945,7 @@ __ebuild_phase_funcs() {
fi

# defaults starting with EAPI 8
if ! has ${eapi} 2 3 4 4-slot-abi 5 6 7; then
if ! has ${eapi} 2 3 4 5 6 7; then
[[ ${phase_func} == src_prepare ]] && \
default_src_prepare() { __eapi8_src_prepare; }
fi
Expand Down
Loading

0 comments on commit 4842869

Please sign in to comment.