diff --git a/sdk_container/src/third_party/portage-stable/app-admin/eselect/Manifest b/sdk_container/src/third_party/portage-stable/app-admin/eselect/Manifest
index c648030ffb..1d143b6bd8 100644
--- a/sdk_container/src/third_party/portage-stable/app-admin/eselect/Manifest
+++ b/sdk_container/src/third_party/portage-stable/app-admin/eselect/Manifest
@@ -1,2 +1,2 @@
-DIST eselect-1.4.17.tar.xz 178980 BLAKE2B d905ac88bc009080912af75e64c7920d745788866fa3cb35466d68a652efbbd6984d6e1efeed76d9a344aed94705b74c85aa43e9c037d4d548d2e24afa69bd7a SHA512 35dc4c52f44c4f64db9c0dc2aec57b3055a6d36760b1bbbd094ad11b3f9e71a731444802632817b89c3b511f1dc9bb92046b59322d177e13fdc501ed767b591e
-DIST eselect-1.4.20.tar.xz 180272 BLAKE2B 424653d00eda45335c3aaae50f6fbf2e89486da4529f657596516352f3b7fcb9859ceb2dc5b9762a34c44fb64e645fa27c46b86453bf50be6e8ae820664a4289 SHA512 9589ed89c4d5d31f71d535886eb50da67b84dec8a13a5df081e7569efee861dede4eaa43a0bfb9930c5b95d4f334e19245cb8820a73f7361527da262da1d1fb2
+DIST eselect-1.4.22.tar.xz 183480 BLAKE2B 8f86bdddaf98bc075694bdf7283cbd366e0ef93635472b3bbac11fdd9765984cd82e493b16836bae66e4b2c42a9cb33ad0d2aacaaf8529b59e4898e11f172d26 SHA512 73a10278d604f462aefa099df398eec2b08aee33da69419351ff2faf1cf4c0f3de0f301d92015e52da63046fe7e2c1c388e11ac84b7deb3def505a59fa291dac
+DIST eselect-1.4.25.tar.xz 184300 BLAKE2B 630fe27338bee0c921a2f90e42d0a8abbb60a141a82bc2c4e7cf43d37582c24b06986ae1cbd341f8d3e69d011edc6c29675bf91ceaf1dcbc2593086f451b8f5f SHA512 98f2752d61e2c31ff6d735d5df0e7d98c3cc51d51c26b71d796948b141ccbc017002185022e6e1e48660ae0012bfc9cd383dd5ac50f644b35bb0893b9271121b
diff --git a/sdk_container/src/third_party/portage-stable/app-admin/eselect/eselect-1.4.20.ebuild b/sdk_container/src/third_party/portage-stable/app-admin/eselect/eselect-1.4.22-r1.ebuild
similarity index 83%
rename from sdk_container/src/third_party/portage-stable/app-admin/eselect/eselect-1.4.20.ebuild
rename to sdk_container/src/third_party/portage-stable/app-admin/eselect/eselect-1.4.22-r1.ebuild
index 68a003da8b..6b4aa0da4b 100644
--- a/sdk_container/src/third_party/portage-stable/app-admin/eselect/eselect-1.4.20.ebuild
+++ b/sdk_container/src/third_party/portage-stable/app-admin/eselect/eselect-1.4.22-r1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
@@ -11,7 +11,7 @@ SRC_URI="https://dev.gentoo.org/~ulm/eselect/${P}.tar.xz"
LICENSE="GPL-2+ || ( GPL-2+ CC-BY-SA-4.0 )"
SLOT="0"
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
IUSE="doc emacs vim-syntax"
DEPEND="sys-apps/sed
@@ -26,6 +26,8 @@ BDEPEND="doc? ( dev-python/docutils )"
PDEPEND="emacs? ( app-emacs/eselect-mode )
vim-syntax? ( app-vim/eselect-syntax )"
+PATCHES=( "${FILESDIR}/${P}-env-module.patch" )
+
src_compile() {
emake
use doc && emake html
diff --git a/sdk_container/src/third_party/portage-stable/app-admin/eselect/eselect-1.4.17.ebuild b/sdk_container/src/third_party/portage-stable/app-admin/eselect/eselect-1.4.25.ebuild
similarity index 84%
rename from sdk_container/src/third_party/portage-stable/app-admin/eselect/eselect-1.4.17.ebuild
rename to sdk_container/src/third_party/portage-stable/app-admin/eselect/eselect-1.4.25.ebuild
index aa18836510..f34db73d04 100644
--- a/sdk_container/src/third_party/portage-stable/app-admin/eselect/eselect-1.4.17.ebuild
+++ b/sdk_container/src/third_party/portage-stable/app-admin/eselect/eselect-1.4.25.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
@@ -11,7 +11,7 @@ SRC_URI="https://dev.gentoo.org/~ulm/eselect/${P}.tar.xz"
LICENSE="GPL-2+ || ( GPL-2+ CC-BY-SA-4.0 )"
SLOT="0"
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
IUSE="doc emacs vim-syntax"
DEPEND="sys-apps/sed
diff --git a/sdk_container/src/third_party/portage-stable/app-admin/eselect/files/eselect-1.4.22-env-module.patch b/sdk_container/src/third_party/portage-stable/app-admin/eselect/files/eselect-1.4.22-env-module.patch
new file mode 100644
index 0000000000..54eb20692d
--- /dev/null
+++ b/sdk_container/src/third_party/portage-stable/app-admin/eselect/files/eselect-1.4.22-env-module.patch
@@ -0,0 +1,19 @@
+env.eselect: More robust file type detection
+https://bugs.gentoo.org/908401
+
+--- a/modules/env.eselect
++++ b/modules/env.eselect
+@@ -46,9 +46,10 @@ is_envfile() {
+ [[ -n ${envfile##*~} ]] || return 1
+ [[ ${envfile##*.} != bak ]] || return 1
+
+- mime=$(POSIXLY_CORRECT=1 file -i "${envfile}" \
+- | cut -d ' ' -f 2 | sed -e 's/;$//')
+- if ! has ${mime} ${MIME_WHITELIST}; then
++ mime=$(POSIXLY_CORRECT=1 file -bi -e soft "${envfile}") \
++ || die "'file' command failed"
++ mime=${mime%%;*}
++ if ! has "${mime}" ${MIME_WHITELIST}; then
+ echo "Skipping non-text file ${envfile}."
+ return 1
+ fi
diff --git a/sdk_container/src/third_party/portage-stable/app-admin/eselect/metadata.xml b/sdk_container/src/third_party/portage-stable/app-admin/eselect/metadata.xml
index 7ee8a2c806..30d66ca4bd 100644
--- a/sdk_container/src/third_party/portage-stable/app-admin/eselect/metadata.xml
+++ b/sdk_container/src/third_party/portage-stable/app-admin/eselect/metadata.xml
@@ -5,4 +5,7 @@
eselect@gentoo.org
eselect configuration and management tool
+
+ proj/eselect
+