From 608b0d6cd5dcced39f241a063c74646163e89517 Mon Sep 17 00:00:00 2001
From: Krzesimir Nowak <knowak@microsoft.com>
Date: Thu, 7 Dec 2023 16:31:34 +0100
Subject: [PATCH 01/22] app-admin/eselect: Sync with Gentoo

It's from Gentoo commit d7dfa749e63d3a3cec49980a0385115f31cad213.
---
 .../portage-stable/app-admin/eselect/Manifest |  4 ++--
 ...ct-1.4.25.ebuild => eselect-1.4.26.ebuild} |  7 ++++++-
 ...1.4.22-r1.ebuild => eselect-1.4.27.ebuild} |  7 +++++--
 .../files/eselect-1.4.22-env-module.patch     | 19 -------------------
 4 files changed, 13 insertions(+), 24 deletions(-)
 rename sdk_container/src/third_party/portage-stable/app-admin/eselect/{eselect-1.4.25.ebuild => eselect-1.4.26.ebuild} (81%)
 rename sdk_container/src/third_party/portage-stable/app-admin/eselect/{eselect-1.4.22-r1.ebuild => eselect-1.4.27.ebuild} (91%)
 delete mode 100644 sdk_container/src/third_party/portage-stable/app-admin/eselect/files/eselect-1.4.22-env-module.patch

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 1d143b6bd8f..5cd4e19cf40 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.22.tar.xz 183480 BLAKE2B 8f86bdddaf98bc075694bdf7283cbd366e0ef93635472b3bbac11fdd9765984cd82e493b16836bae66e4b2c42a9cb33ad0d2aacaaf8529b59e4898e11f172d26 SHA512 73a10278d604f462aefa099df398eec2b08aee33da69419351ff2faf1cf4c0f3de0f301d92015e52da63046fe7e2c1c388e11ac84b7deb3def505a59fa291dac
-DIST eselect-1.4.25.tar.xz 184300 BLAKE2B 630fe27338bee0c921a2f90e42d0a8abbb60a141a82bc2c4e7cf43d37582c24b06986ae1cbd341f8d3e69d011edc6c29675bf91ceaf1dcbc2593086f451b8f5f SHA512 98f2752d61e2c31ff6d735d5df0e7d98c3cc51d51c26b71d796948b141ccbc017002185022e6e1e48660ae0012bfc9cd383dd5ac50f644b35bb0893b9271121b
+DIST eselect-1.4.26.tar.xz 184332 BLAKE2B ee1e8890802fc50646c8d1d5219f1ab0ec5cfc0138c758f73ad6baccf673992bbf3e763d8e84491f33e724ba4e1cf3bed6971ba7fa4373e0f06464ff4a5fa1e6 SHA512 397ae2f15d90d722eb84225b08f1afaaf6f89758bfae5d93b0a1c3eddc997c21e74ab62e09ee5e71941d3a8587b3372b64336d12054c3bbf0e56e1ba398a26f9
+DIST eselect-1.4.27.tar.xz 184464 BLAKE2B 718874f4d0651194f361ca3202e5140982812bf486c8efe82354944d55206b0113fa135992203e8baa00019c3fd773a90ddaf67157c16f4ac2d69965d9822fbd SHA512 f534785fc1f79869840f420b4ab2b2bf35593c504cce878a6d3d07f75012cf32288009ea9ac2a5607dba216a794110a64c5f2c54d5d8a3c641328489cecc024b
diff --git a/sdk_container/src/third_party/portage-stable/app-admin/eselect/eselect-1.4.25.ebuild b/sdk_container/src/third_party/portage-stable/app-admin/eselect/eselect-1.4.26.ebuild
similarity index 81%
rename from sdk_container/src/third_party/portage-stable/app-admin/eselect/eselect-1.4.25.ebuild
rename to sdk_container/src/third_party/portage-stable/app-admin/eselect/eselect-1.4.26.ebuild
index f34db73d044..995643f6cb6 100644
--- a/sdk_container/src/third_party/portage-stable/app-admin/eselect/eselect-1.4.25.ebuild
+++ b/sdk_container/src/third_party/portage-stable/app-admin/eselect/eselect-1.4.26.ebuild
@@ -3,6 +3,11 @@
 
 EAPI=7
 
+# Packages sharing a common release tarball:
+# app-admin/eselect
+# app-emacs/eselect-mode
+# Please bump and mark them stable together!
+
 inherit bash-completion-r1
 
 DESCRIPTION="Gentoo's multi-purpose configuration and management tool"
@@ -11,7 +16,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 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-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/eselect-1.4.22-r1.ebuild b/sdk_container/src/third_party/portage-stable/app-admin/eselect/eselect-1.4.27.ebuild
similarity index 91%
rename from sdk_container/src/third_party/portage-stable/app-admin/eselect/eselect-1.4.22-r1.ebuild
rename to sdk_container/src/third_party/portage-stable/app-admin/eselect/eselect-1.4.27.ebuild
index 6b4aa0da4bc..61a54674f58 100644
--- a/sdk_container/src/third_party/portage-stable/app-admin/eselect/eselect-1.4.22-r1.ebuild
+++ b/sdk_container/src/third_party/portage-stable/app-admin/eselect/eselect-1.4.27.ebuild
@@ -3,6 +3,11 @@
 
 EAPI=7
 
+# Packages sharing a common release tarball:
+# app-admin/eselect
+# app-emacs/eselect-mode
+# Please bump and mark them stable together!
+
 inherit bash-completion-r1
 
 DESCRIPTION="Gentoo's multi-purpose configuration and management tool"
@@ -26,8 +31,6 @@ 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/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
deleted file mode 100644
index 54eb20692d1..00000000000
--- a/sdk_container/src/third_party/portage-stable/app-admin/eselect/files/eselect-1.4.22-env-module.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-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

From df0ae0b62e88ab88400db22eaba280092e916a03 Mon Sep 17 00:00:00 2001
From: Krzesimir Nowak <knowak@microsoft.com>
Date: Thu, 7 Dec 2023 16:31:34 +0100
Subject: [PATCH 02/22] app-admin/perl-cleaner: Sync with Gentoo

It's from Gentoo commit 8b2ff8cd374aaf49753d87c18c80462a79b8e878.
---
 .../app-admin/perl-cleaner/Manifest           |  1 +
 .../app-admin/perl-cleaner/metadata.xml       | 17 +++++--
 .../perl-cleaner/perl-cleaner-2.30-r1.ebuild  | 45 +++++++++++++++++++
 .../perl-cleaner/perl-cleaner-2.30.ebuild     | 41 -----------------
 .../perl-cleaner/perl-cleaner-2.31.ebuild     | 43 ++++++++++++++++++
 .../perl-cleaner/perl-cleaner-9999.ebuild     | 24 +++++-----
 6 files changed, 115 insertions(+), 56 deletions(-)
 create mode 100644 sdk_container/src/third_party/portage-stable/app-admin/perl-cleaner/perl-cleaner-2.30-r1.ebuild
 delete mode 100644 sdk_container/src/third_party/portage-stable/app-admin/perl-cleaner/perl-cleaner-2.30.ebuild
 create mode 100644 sdk_container/src/third_party/portage-stable/app-admin/perl-cleaner/perl-cleaner-2.31.ebuild

diff --git a/sdk_container/src/third_party/portage-stable/app-admin/perl-cleaner/Manifest b/sdk_container/src/third_party/portage-stable/app-admin/perl-cleaner/Manifest
index 4d0f6ffb4ea..c71b5fdc304 100644
--- a/sdk_container/src/third_party/portage-stable/app-admin/perl-cleaner/Manifest
+++ b/sdk_container/src/third_party/portage-stable/app-admin/perl-cleaner/Manifest
@@ -1 +1,2 @@
 DIST perl-cleaner-2.30.tar.bz2 6963 BLAKE2B 8983060c7a904266ac82a67eba7b5d2184803b59c077f947a35d07e9af3046953705d31840b9508116578b8f3e8a8b97d77cf21eeac3b70f1c3fb5c1d71ae64e SHA512 436d26727bbb598bcd3c4f31e6b81e415a797cdba82dccfd55e54ee179bd2d6c1dc443e865f6f0a05b59f47ffd231dd10e55d5ea97a9a6875235ea1b49b68898
+DIST perl-cleaner-2.31.tar.bz2 6914 BLAKE2B 4b13ae42ab06ad75b6dbcb1306f3f4f476315db4504d0ffbc4c56d4d66a2da3a751d3682305daca6bcbae1861d182f16296c92f9a8d25687e35ab03a6f8734e3 SHA512 c4df0437604d41dbfdce0b72d72f975d464cf0c44f417c708917f01829e498ef8d6b47a78cee517836cac9344791ad49db98f29da5f78599e80b000e41b8127e
diff --git a/sdk_container/src/third_party/portage-stable/app-admin/perl-cleaner/metadata.xml b/sdk_container/src/third_party/portage-stable/app-admin/perl-cleaner/metadata.xml
index d1aa590a84f..e0aae08711f 100644
--- a/sdk_container/src/third_party/portage-stable/app-admin/perl-cleaner/metadata.xml
+++ b/sdk_container/src/third_party/portage-stable/app-admin/perl-cleaner/metadata.xml
@@ -1,8 +1,17 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
 <pkgmetadata>
-<maintainer type="project">
-	<email>perl@gentoo.org</email>
-	<name>Gentoo Perl Project</name>
-</maintainer>
+	<maintainer type="project">
+		<email>perl@gentoo.org</email>
+		<name>Gentoo Perl Project</name>
+	</maintainer>
+	<use>
+		<flag name="pkgcore">
+			Use <pkg>sys-apps/pkgcore</pkg> instead of <pkg>sys-apps/portage</pkg>
+			and <pkg>app-portage/portage-utils</pkg>.
+		</flag>
+	</use>
+	<upstream>
+		<remote-id type="github">gentoo-perl/perl-cleaner</remote-id>
+	</upstream>
 </pkgmetadata>
diff --git a/sdk_container/src/third_party/portage-stable/app-admin/perl-cleaner/perl-cleaner-2.30-r1.ebuild b/sdk_container/src/third_party/portage-stable/app-admin/perl-cleaner/perl-cleaner-2.30-r1.ebuild
new file mode 100644
index 00000000000..0991130f6f1
--- /dev/null
+++ b/sdk_container/src/third_party/portage-stable/app-admin/perl-cleaner/perl-cleaner-2.30-r1.ebuild
@@ -0,0 +1,45 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit prefix
+
+DESCRIPTION="User land tool for cleaning up old perl installs"
+HOMEPAGE="https://wiki.gentoo.org/wiki/Project:Perl"
+
+if [[ "${PV}" == "9999" ]] ; then
+	inherit git-r3
+	EGIT_REPO_URI="https://github.com/gentoo-perl/perl-cleaner.git"
+else
+	SRC_URI="mirror://gentoo/${P}.tar.bz2 https://dev.gentoo.org/~dilfridge/distfiles/${P}.tar.bz2"
+	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"
+fi
+
+LICENSE="GPL-2"
+SLOT="0"
+# TODO: Detect at runtime what's available and fallback if needed, possibly
+# integrate with eselect-package-manager, bug #779007.
+IUSE="pkgcore"
+
+[[ "${PV}" == "9999" ]] && BDEPEND="sys-apps/help2man"
+
+RDEPEND="
+	app-shells/bash
+	dev-lang/perl
+	pkgcore? ( sys-apps/pkgcore )
+	!pkgcore? (
+		app-portage/portage-utils
+		sys-apps/portage
+	)
+"
+
+src_prepare() {
+	default
+	eprefixify ${PN}
+}
+
+src_install() {
+	dosbin perl-cleaner
+	doman perl-cleaner.1
+}
diff --git a/sdk_container/src/third_party/portage-stable/app-admin/perl-cleaner/perl-cleaner-2.30.ebuild b/sdk_container/src/third_party/portage-stable/app-admin/perl-cleaner/perl-cleaner-2.30.ebuild
deleted file mode 100644
index 26172c5340d..00000000000
--- a/sdk_container/src/third_party/portage-stable/app-admin/perl-cleaner/perl-cleaner-2.30.ebuild
+++ /dev/null
@@ -1,41 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit prefix
-
-DESCRIPTION="User land tool for cleaning up old perl installs"
-HOMEPAGE="https://www.gentoo.org/proj/en/perl/"
-
-if [[ "${PV}" == "9999" ]] ; then
-	inherit git-r3
-	EGIT_REPO_URI="https://github.com/gentoo-perl/perl-cleaner.git"
-else
-	SRC_URI="mirror://gentoo/${P}.tar.bz2 https://dev.gentoo.org/~dilfridge/distfiles/${P}.tar.bz2"
-	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"
-fi
-
-LICENSE="GPL-2"
-SLOT="0"
-IUSE=""
-
-[[ "${PV}" == "9999" ]] && DEPEND="sys-apps/help2man"
-
-RDEPEND="app-shells/bash
-	dev-lang/perl
-	|| (
-		( sys-apps/portage app-portage/portage-utils )
-		sys-apps/pkgcore
-	)
-"
-
-src_prepare() {
-	default
-	eprefixify ${PN}
-}
-
-src_install() {
-	dosbin perl-cleaner
-	doman perl-cleaner.1
-}
diff --git a/sdk_container/src/third_party/portage-stable/app-admin/perl-cleaner/perl-cleaner-2.31.ebuild b/sdk_container/src/third_party/portage-stable/app-admin/perl-cleaner/perl-cleaner-2.31.ebuild
new file mode 100644
index 00000000000..f730b83859c
--- /dev/null
+++ b/sdk_container/src/third_party/portage-stable/app-admin/perl-cleaner/perl-cleaner-2.31.ebuild
@@ -0,0 +1,43 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit prefix
+
+DESCRIPTION="User land tool for cleaning up old perl installs"
+HOMEPAGE="https://wiki.gentoo.org/wiki/Project:Perl"
+
+if [[ "${PV}" == "9999" ]] ; then
+	inherit git-r3
+	EGIT_REPO_URI="https://github.com/gentoo-perl/perl-cleaner.git"
+else
+	SRC_URI="https://dev.gentoo.org/~dilfridge/distfiles/${P}.tar.bz2"
+	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"
+fi
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="pkgcore"
+
+[[ "${PV}" == "9999" ]] && BDEPEND="sys-apps/help2man"
+
+RDEPEND="
+	app-shells/bash
+	dev-lang/perl
+	pkgcore? ( sys-apps/pkgcore )
+	!pkgcore? (
+		app-portage/portage-utils
+		sys-apps/portage
+	)
+"
+
+src_prepare() {
+	default
+	eprefixify ${PN}
+}
+
+src_install() {
+	dosbin perl-cleaner
+	doman perl-cleaner.1
+}
diff --git a/sdk_container/src/third_party/portage-stable/app-admin/perl-cleaner/perl-cleaner-9999.ebuild b/sdk_container/src/third_party/portage-stable/app-admin/perl-cleaner/perl-cleaner-9999.ebuild
index a7624afba08..b7bf446c472 100644
--- a/sdk_container/src/third_party/portage-stable/app-admin/perl-cleaner/perl-cleaner-9999.ebuild
+++ b/sdk_container/src/third_party/portage-stable/app-admin/perl-cleaner/perl-cleaner-9999.ebuild
@@ -1,32 +1,34 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=7
+EAPI=8
 
 inherit prefix
 
 DESCRIPTION="User land tool for cleaning up old perl installs"
-HOMEPAGE="https://www.gentoo.org/proj/en/perl/"
+HOMEPAGE="https://wiki.gentoo.org/wiki/Project:Perl"
 
 if [[ "${PV}" == "9999" ]] ; then
 	inherit git-r3
 	EGIT_REPO_URI="https://github.com/gentoo-perl/perl-cleaner.git"
 else
-	SRC_URI="mirror://gentoo/${P}.tar.bz2 https://dev.gentoo.org/~dilfridge/distfiles/${P}.tar.bz2"
-	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"
+	SRC_URI="https://dev.gentoo.org/~dilfridge/distfiles/${P}.tar.bz2"
+	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"
 fi
 
 LICENSE="GPL-2"
 SLOT="0"
-IUSE=""
+IUSE="pkgcore"
 
-[[ "${PV}" == "9999" ]] && DEPEND="sys-apps/help2man"
+[[ "${PV}" == "9999" ]] && BDEPEND="sys-apps/help2man"
 
-RDEPEND="app-shells/bash
+RDEPEND="
+	app-shells/bash
 	dev-lang/perl
-	|| (
-		( sys-apps/portage app-portage/portage-utils )
-		sys-apps/pkgcore
+	pkgcore? ( sys-apps/pkgcore )
+	!pkgcore? (
+		app-portage/portage-utils
+		sys-apps/portage
 	)
 "
 

From c665d24d0e693a56132692e7cdcbc143f09c8962 Mon Sep 17 00:00:00 2001
From: Krzesimir Nowak <knowak@microsoft.com>
Date: Thu, 7 Dec 2023 16:31:34 +0100
Subject: [PATCH 03/22] app-arch/lz4: Sync with Gentoo

It's from Gentoo commit c23ff2a84ab7587f81fc236bd8b5413766d47e57.
---
 .../portage-stable/app-arch/lz4/Manifest      |  2 +-
 .../files/lz4-1.9.3-negative-memmove.patch    | 22 -------------------
 .../{lz4-1.9.3-r1.ebuild => lz4-1.9.4.ebuild} | 11 +++-------
 .../portage-stable/app-arch/lz4/metadata.xml  |  2 +-
 4 files changed, 5 insertions(+), 32 deletions(-)
 delete mode 100644 sdk_container/src/third_party/portage-stable/app-arch/lz4/files/lz4-1.9.3-negative-memmove.patch
 rename sdk_container/src/third_party/portage-stable/app-arch/lz4/{lz4-1.9.3-r1.ebuild => lz4-1.9.4.ebuild} (62%)

diff --git a/sdk_container/src/third_party/portage-stable/app-arch/lz4/Manifest b/sdk_container/src/third_party/portage-stable/app-arch/lz4/Manifest
index c60a5c0d8da..dfd1e824e65 100644
--- a/sdk_container/src/third_party/portage-stable/app-arch/lz4/Manifest
+++ b/sdk_container/src/third_party/portage-stable/app-arch/lz4/Manifest
@@ -1 +1 @@
-DIST lz4-1.9.3.tar.gz 320958 BLAKE2B 9a194bd18ff52f780aa03a8a53fe7fab7b58117d768f4ba8e5005830c935d16328d0f7cc54f9413b58faf245017c0ac85fb4e709a9db150cb150a0a2a3c21645 SHA512 c246b0bda881ee9399fa1be490fa39f43b291bb1d9db72dba8a85db1a50aad416a97e9b300eee3d2a4203c2bd88bda2762e81bc229c3aa409ad217eb306a454c
+DIST lz4-1.9.4.tar.gz 354063 BLAKE2B 2289cdce36acd35283bf2f02ef4d6d8f4805563be6d5a3492f3d6ea7975fb6bd14e1ac2e505df9747776edf8bcf0da7ba4ae7084b150e3ec08a52a9885f92ad5 SHA512 043a9acb2417624019d73db140d83b80f1d7c43a6fd5be839193d68df8fd0b3f610d7ed4d628c2a9184f7cde9a0fd1ba9d075d8251298e3eb4b3a77f52736684
diff --git a/sdk_container/src/third_party/portage-stable/app-arch/lz4/files/lz4-1.9.3-negative-memmove.patch b/sdk_container/src/third_party/portage-stable/app-arch/lz4/files/lz4-1.9.3-negative-memmove.patch
deleted file mode 100644
index 053958dfe87..00000000000
--- a/sdk_container/src/third_party/portage-stable/app-arch/lz4/files/lz4-1.9.3-negative-memmove.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-From 8301a21773ef61656225e264f4f06ae14462bca7 Mon Sep 17 00:00:00 2001
-From: Jasper Lievisse Adriaanse <j@jasper.la>
-Date: Fri, 26 Feb 2021 15:21:20 +0100
-Subject: [PATCH] Fix potential memory corruption with negative memmove() size
-
----
- lib/lz4.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/lib/lz4.c b/lib/lz4.c
-index 5f524d01d..c2f504ef3 100644
---- a/lib/lz4.c
-+++ b/lib/lz4.c
-@@ -1749,7 +1749,7 @@ LZ4_decompress_generic(
-                  const size_t dictSize         /* note : = 0 if noDict */
-                  )
- {
--    if (src == NULL) { return -1; }
-+    if ((src == NULL) || (outputSize < 0)) { return -1; }
- 
-     {   const BYTE* ip = (const BYTE*) src;
-         const BYTE* const iend = ip + srcSize;
diff --git a/sdk_container/src/third_party/portage-stable/app-arch/lz4/lz4-1.9.3-r1.ebuild b/sdk_container/src/third_party/portage-stable/app-arch/lz4/lz4-1.9.4.ebuild
similarity index 62%
rename from sdk_container/src/third_party/portage-stable/app-arch/lz4/lz4-1.9.3-r1.ebuild
rename to sdk_container/src/third_party/portage-stable/app-arch/lz4/lz4-1.9.4.ebuild
index 2282b90c9bc..05adb1eacb6 100644
--- a/sdk_container/src/third_party/portage-stable/app-arch/lz4/lz4-1.9.3-r1.ebuild
+++ b/sdk_container/src/third_party/portage-stable/app-arch/lz4/lz4-1.9.4.ebuild
@@ -1,9 +1,8 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=7
+EAPI=8
 
-CMAKE_ECLASS=cmake
 inherit cmake-multilib
 
 DESCRIPTION="Extremely Fast Compression algorithm"
@@ -13,15 +12,11 @@ SRC_URI="https://github.com/lz4/lz4/archive/v${PV}.tar.gz -> ${P}.tar.gz"
 LICENSE="BSD-2 GPL-2"
 # https://abi-laboratory.pro/tracker/timeline/lz4/
 SLOT="0/r132"
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~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="static-libs"
 
 CMAKE_USE_DIR=${S}/build/cmake
 
-PATCHES=(
-	"${FILESDIR}"/${P}-negative-memmove.patch
-)
-
 multilib_src_configure() {
 	local mycmakeargs=(
 		-DBUILD_STATIC_LIBS=$(usex static-libs)
diff --git a/sdk_container/src/third_party/portage-stable/app-arch/lz4/metadata.xml b/sdk_container/src/third_party/portage-stable/app-arch/lz4/metadata.xml
index 26e7c6e1933..f27607ccce5 100644
--- a/sdk_container/src/third_party/portage-stable/app-arch/lz4/metadata.xml
+++ b/sdk_container/src/third_party/portage-stable/app-arch/lz4/metadata.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
 <pkgmetadata>
 	<maintainer type="person">
 		<email>mgorny@gentoo.org</email>

From 146a757026610d6de098f5425347364af69cea4b Mon Sep 17 00:00:00 2001
From: Krzesimir Nowak <knowak@microsoft.com>
Date: Thu, 7 Dec 2023 16:31:35 +0100
Subject: [PATCH 04/22] app-arch/lzop: Sync with Gentoo

It's from Gentoo commit 4aebe55f8c434205f2ea3d28ffacb834a401bc1f.
---
 .../lzop/{lzop-1.04.ebuild => lzop-1.04-r1.ebuild}        | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
 rename sdk_container/src/third_party/portage-stable/app-arch/lzop/{lzop-1.04.ebuild => lzop-1.04-r1.ebuild} (80%)

diff --git a/sdk_container/src/third_party/portage-stable/app-arch/lzop/lzop-1.04.ebuild b/sdk_container/src/third_party/portage-stable/app-arch/lzop/lzop-1.04-r1.ebuild
similarity index 80%
rename from sdk_container/src/third_party/portage-stable/app-arch/lzop/lzop-1.04.ebuild
rename to sdk_container/src/third_party/portage-stable/app-arch/lzop/lzop-1.04-r1.ebuild
index 61d2ad39def..d13da09a206 100644
--- a/sdk_container/src/third_party/portage-stable/app-arch/lzop/lzop-1.04.ebuild
+++ b/sdk_container/src/third_party/portage-stable/app-arch/lzop/lzop-1.04-r1.ebuild
@@ -1,7 +1,7 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI="6"
+EAPI=8
 
 DESCRIPTION="Utility for fast (even real-time) compression/decompression"
 HOMEPAGE="https://www.lzop.org/"
@@ -9,14 +9,14 @@ SRC_URI="https://www.lzop.org/download/${P}.tar.gz"
 
 LICENSE="GPL-2+"
 SLOT="0"
-KEYWORDS="amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 ~riscv sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris ~x86-solaris"
-IUSE=""
+KEYWORDS="amd64 arm arm64 ~hppa ~ia64 ~loong ~mips ppc ppc64 ~riscv sparc x86 ~amd64-linux ~x86-linux ~ppc-macos"
 
 RDEPEND=">=dev-libs/lzo-2"
 DEPEND="${RDEPEND}"
 
 src_test() {
 	einfo "compressing config.status to test"
+
 	src/lzop config.status || die 'compression failed'
 	ls -la config.status{,.lzo}
 	src/lzop -t config.status.lzo || die 'lzo test failed'

From d17611cd09adef524a5d9b44dd0808292dd51880 Mon Sep 17 00:00:00 2001
From: Krzesimir Nowak <knowak@microsoft.com>
Date: Thu, 7 Dec 2023 16:31:36 +0100
Subject: [PATCH 05/22] app-crypt/argon2: Sync with Gentoo

It's from Gentoo commit 0799e46d245a76cf43dc36b3fa1dcb864519a37f.
---
 .../{argon2-20190702.ebuild => argon2-20190702-r1.ebuild}   | 6 +++---
 .../portage-stable/app-crypt/argon2/metadata.xml            | 1 +
 2 files changed, 4 insertions(+), 3 deletions(-)
 rename sdk_container/src/third_party/portage-stable/app-crypt/argon2/{argon2-20190702.ebuild => argon2-20190702-r1.ebuild} (81%)

diff --git a/sdk_container/src/third_party/portage-stable/app-crypt/argon2/argon2-20190702.ebuild b/sdk_container/src/third_party/portage-stable/app-crypt/argon2/argon2-20190702-r1.ebuild
similarity index 81%
rename from sdk_container/src/third_party/portage-stable/app-crypt/argon2/argon2-20190702.ebuild
rename to sdk_container/src/third_party/portage-stable/app-crypt/argon2/argon2-20190702-r1.ebuild
index b8456fce50b..c36974b6a53 100644
--- a/sdk_container/src/third_party/portage-stable/app-crypt/argon2/argon2-20190702.ebuild
+++ b/sdk_container/src/third_party/portage-stable/app-crypt/argon2/argon2-20190702-r1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
@@ -11,7 +11,7 @@ SRC_URI="https://github.com/P-H-C/phc-winner-argon2/archive/${PV}.tar.gz -> ${P}
 
 LICENSE="|| ( Apache-2.0 CC0-1.0 )"
 SLOT="0/1"
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos"
+KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos"
 IUSE="static-libs"
 
 S="${WORKDIR}/phc-winner-${P}"
@@ -44,7 +44,7 @@ src_prepare() {
 }
 
 src_compile() {
-	emake OPTTEST="${OPTTEST}" LIBRARY_REL="$(get_libdir)" \
+	emake OPTTEST="${OPTTEST}" LIBRARY_REL="$(get_libdir)" PREFIX="${EPREFIX}/usr" \
 		ARGON2_VERSION="0~${PV}"
 }
 
diff --git a/sdk_container/src/third_party/portage-stable/app-crypt/argon2/metadata.xml b/sdk_container/src/third_party/portage-stable/app-crypt/argon2/metadata.xml
index 950b7c84aec..e1a7b6edc5a 100644
--- a/sdk_container/src/third_party/portage-stable/app-crypt/argon2/metadata.xml
+++ b/sdk_container/src/third_party/portage-stable/app-crypt/argon2/metadata.xml
@@ -17,6 +17,7 @@
 		<subslots>Reflect ABI of libargon2.so.</subslots>
 	</slots>
 	<upstream>
+		<remote-id type="cpe">cpe:/a:argon2_project:argon2</remote-id>
 		<remote-id type="github">P-H-C/phc-winner-argon2</remote-id>
 	</upstream>
 </pkgmetadata>

From 4a91665cb9eeb26b9294b739525ca9c1378fb11d Mon Sep 17 00:00:00 2001
From: Krzesimir Nowak <knowak@microsoft.com>
Date: Thu, 7 Dec 2023 16:31:36 +0100
Subject: [PATCH 06/22] app-crypt/efitools: Sync with Gentoo

It's from Gentoo commit ae1e332058fc483a5d8d7804d34f369f4566638e.
---
 .../app-crypt/efitools/Manifest               |   1 -
 .../app-crypt/efitools/efitools-1.8.1.ebuild  |  51 --------
 ...-1.9.2.ebuild => efitools-1.9.2-r1.ebuild} |  44 +++----
 .../efitools/files/1.7.0-Make.rules.patch     |  11 --
 .../efitools/files/1.8.1-respect-ar.patch     |  25 ----
 .../efitools/files/1.9.2-Makefile.patch       | 121 ++++++++++++++++++
 .../efitools/files/1.9.2-clang16.patch        | 108 ++++++++++++++++
 7 files changed, 251 insertions(+), 110 deletions(-)
 delete mode 100644 sdk_container/src/third_party/portage-stable/app-crypt/efitools/efitools-1.8.1.ebuild
 rename sdk_container/src/third_party/portage-stable/app-crypt/efitools/{efitools-1.9.2.ebuild => efitools-1.9.2-r1.ebuild} (54%)
 delete mode 100644 sdk_container/src/third_party/portage-stable/app-crypt/efitools/files/1.7.0-Make.rules.patch
 delete mode 100644 sdk_container/src/third_party/portage-stable/app-crypt/efitools/files/1.8.1-respect-ar.patch
 create mode 100644 sdk_container/src/third_party/portage-stable/app-crypt/efitools/files/1.9.2-Makefile.patch
 create mode 100644 sdk_container/src/third_party/portage-stable/app-crypt/efitools/files/1.9.2-clang16.patch

diff --git a/sdk_container/src/third_party/portage-stable/app-crypt/efitools/Manifest b/sdk_container/src/third_party/portage-stable/app-crypt/efitools/Manifest
index f6d9e825862..aced0dc8f91 100644
--- a/sdk_container/src/third_party/portage-stable/app-crypt/efitools/Manifest
+++ b/sdk_container/src/third_party/portage-stable/app-crypt/efitools/Manifest
@@ -1,2 +1 @@
-DIST efitools-1.8.1.tar.gz 115319 BLAKE2B 3aad65defc203055122027cc3a48f50912d2f08b592841780fdc1bf337d75774116e698c4270865275ce7fe64988cd84105138ca979d81818f0065d7ae90f1d0 SHA512 114ef8e52160f5a5239ec306dbd587610849bce771ba8145ed092afd79e44f3ecee93cc1d97e2d5fdb880cc825bbbe928b3ef6701fd3b1fa444053894be1098a
 DIST efitools-1.9.2.tar.gz 116037 BLAKE2B b3540932eb112e362fd0eed47090360603807dcaec8c6a10058618f8252eeb5dcbbd703d313cb6fadae62c1312815080cf2c77fc86f9dfc9f9afca24ad97f584 SHA512 77e0ad7e865814ed388ff6daabe0f4b49ba51672bf2cbb98b7905e209cbd28f9ede2f73213ce45af8a978c1e67dba24ec88a1188661317cc22317b47e575cde8
diff --git a/sdk_container/src/third_party/portage-stable/app-crypt/efitools/efitools-1.8.1.ebuild b/sdk_container/src/third_party/portage-stable/app-crypt/efitools/efitools-1.8.1.ebuild
deleted file mode 100644
index ebac350dbca..00000000000
--- a/sdk_container/src/third_party/portage-stable/app-crypt/efitools/efitools-1.8.1.ebuild
+++ /dev/null
@@ -1,51 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-inherit flag-o-matic toolchain-funcs
-
-DESCRIPTION="Tools for manipulating UEFI secure boot platforms"
-HOMEPAGE="https://git.kernel.org/cgit/linux/kernel/git/jejb/efitools.git"
-SRC_URI="https://git.kernel.org/pub/scm/linux/kernel/git/jejb/efitools.git/snapshot/${P}.tar.gz"
-
-LICENSE="GPL-2 LGPL-2.1"
-SLOT="0"
-KEYWORDS="~amd64 ~arm64 ~x86"
-IUSE="static"
-
-LIB_DEPEND="dev-libs/openssl:0=[static-libs(+)]"
-
-RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)]} )
-	sys-apps/util-linux"
-
-DEPEND="${RDEPEND}
-	app-crypt/sbsigntools
-	dev-perl/File-Slurp
-	static? ( ${LIB_DEPEND} )
-	sys-apps/help2man
-	sys-boot/gnu-efi
-	virtual/pkgconfig"
-
-PATCHES=(
-	"${FILESDIR}/1.7.0-Make.rules.patch"
-	"${FILESDIR}/1.8.1-respect-ar.patch"
-)
-
-src_prepare() {
-	if use static; then
-		append-ldflags -static
-		sed -i "s/-lcrypto\b/$($(tc-getPKG_CONFIG) --static --libs libcrypto)/g" \
-			Makefile || die
-	fi
-
-	# Respect users CFLAGS
-	sed -i -e 's/CFLAGS.*= -O2 -g/CFLAGS += /' Make.rules || die
-
-	# Respect users LDFLAGS
-	sed -i -e 's/LDFLAGS/LIBS/g' Make.rules || die
-	sed -i -e 's/\$(CC)/& $(LDFLAGS)/g' Makefile || die
-
-	# Run 'default', to apply user patches
-	default
-}
diff --git a/sdk_container/src/third_party/portage-stable/app-crypt/efitools/efitools-1.9.2.ebuild b/sdk_container/src/third_party/portage-stable/app-crypt/efitools/efitools-1.9.2-r1.ebuild
similarity index 54%
rename from sdk_container/src/third_party/portage-stable/app-crypt/efitools/efitools-1.9.2.ebuild
rename to sdk_container/src/third_party/portage-stable/app-crypt/efitools/efitools-1.9.2-r1.ebuild
index ac731ef3bd0..0deba136bb4 100644
--- a/sdk_container/src/third_party/portage-stable/app-crypt/efitools/efitools-1.9.2.ebuild
+++ b/sdk_container/src/third_party/portage-stable/app-crypt/efitools/efitools-1.9.2-r1.ebuild
@@ -1,7 +1,7 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=6
+EAPI=8
 
 inherit flag-o-matic toolchain-funcs
 
@@ -14,43 +14,43 @@ SLOT="0"
 KEYWORDS="amd64 ~arm64 x86"
 IUSE="static"
 
-LIB_DEPEND="dev-libs/openssl:0=[static-libs(+)]"
+LIB_DEPEND="dev-libs/openssl:=[static-libs(+)]"
 
-RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)]} )
+RDEPEND="
+	!static? ( ${LIB_DEPEND//\[static-libs(+)]} )
 	sys-apps/util-linux"
-
 DEPEND="${RDEPEND}
+	static? ( ${LIB_DEPEND} )
+	sys-boot/gnu-efi"
+BDEPEND="
 	app-crypt/sbsigntools
 	dev-perl/File-Slurp
-	static? ( ${LIB_DEPEND} )
 	sys-apps/help2man
-	sys-boot/gnu-efi
 	virtual/pkgconfig"
 
 PATCHES=(
-	"${FILESDIR}/1.7.0-Make.rules.patch"
-	"${FILESDIR}/1.8.1-respect-ar.patch"
+	"${FILESDIR}"/1.9.2-clang16.patch
+	"${FILESDIR}"/1.9.2-Makefile.patch
 )
 
 src_prepare() {
-	if use static; then
-		append-ldflags -static
-		sed -i "s/-lcrypto\b/$($(tc-getPKG_CONFIG) --static --libs libcrypto)/g" \
-			Makefile || die
-	fi
+	default
 
-	# Let it build with clang.
+	# Let it build with clang
 	if tc-is-clang; then
 		sed -i -e 's/-fno-toplevel-reorder//g' Make.rules || die
 	fi
 
-	# Respect users CFLAGS
-	sed -i -e 's/CFLAGS.*= -O2 -g/CFLAGS += /' Make.rules || die
+	if use static; then
+		append-ldflags -static
+		export STATIC_FLAG=--static
+	fi
+}
 
-	# Respect users LDFLAGS
-	sed -i -e 's/LDFLAGS/LIBS/g' Make.rules || die
-	sed -i -e 's/\$(CC)/& $(LDFLAGS)/g' Makefile || die
+src_configure() {
+	# Calls LD directly, doesn't respect LDFLAGS. Low level package anyway.
+	# See bug #908813.
+	filter-lto
 
-	# Run 'default', to apply user patches
-	default
+	tc-export AR CC LD NM OBJCOPY PKG_CONFIG
 }
diff --git a/sdk_container/src/third_party/portage-stable/app-crypt/efitools/files/1.7.0-Make.rules.patch b/sdk_container/src/third_party/portage-stable/app-crypt/efitools/files/1.7.0-Make.rules.patch
deleted file mode 100644
index 89665ab3b69..00000000000
--- a/sdk_container/src/third_party/portage-stable/app-crypt/efitools/files/1.7.0-Make.rules.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/Make.rules
-+++ b/Make.rules
-@@ -71,7 +71,7 @@
- %.hash: %.efi hash-to-efi-sig-list
- 	./hash-to-efi-sig-list $< $@
- 
--%-blacklist.esl: %.crt cert-to-efi-hash-list
-+%-blacklist.esl: %.crt cert-to-efi-sig-list
- 	./cert-to-efi-sig-list $< $@
- 
- %-hash-blacklist.esl: %.crt cert-to-efi-hash-list
diff --git a/sdk_container/src/third_party/portage-stable/app-crypt/efitools/files/1.8.1-respect-ar.patch b/sdk_container/src/third_party/portage-stable/app-crypt/efitools/files/1.8.1-respect-ar.patch
deleted file mode 100644
index 36e6620119f..00000000000
--- a/sdk_container/src/third_party/portage-stable/app-crypt/efitools/files/1.8.1-respect-ar.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From 81503d7a43b99c036758d05c1794502c09189fa4 Mon Sep 17 00:00:00 2001
-From: Matthias Maier <tamiko@43-1.org>
-Date: Tue, 5 Oct 2021 22:27:52 -0500
-Subject: [PATCH] Do not use ar directly
-
----
- Make.rules | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/Make.rules b/Make.rules
-index e46d407..767070d 100644
---- a/Make.rules
-+++ b/Make.rules
-@@ -129,7 +129,7 @@ getvar = $(shell if [ "$(1)" = "PK" -o "$(1)" = "KEK" ]; then echo $(1); else ec
- #	sbsign --key KEK.key --cert KEK.crt --output $@ $<
- 
- %.a:
--	ar rcv $@ $^
-+	$(AR) rcv $@ $^
- 
- doc/%.1: doc/%.1.in %
- 	$(HELP2MAN) --no-info -i $< -o $@ ./$*
--- 
-2.32.0
-
diff --git a/sdk_container/src/third_party/portage-stable/app-crypt/efitools/files/1.9.2-Makefile.patch b/sdk_container/src/third_party/portage-stable/app-crypt/efitools/files/1.9.2-Makefile.patch
new file mode 100644
index 00000000000..e8e99b1858a
--- /dev/null
+++ b/sdk_container/src/third_party/portage-stable/app-crypt/efitools/files/1.9.2-Makefile.patch
@@ -0,0 +1,121 @@
+--- a/Makefile
++++ b/Makefile
+@@ -21,6 +21,8 @@
+ KEYBLACKLISTAUTH = $(ALLKEYS:=-blacklist.auth)
+ KEYHASHBLACKLISTAUTH = $(ALLKEYS:=-hash-blacklist.auth)
+ 
++SSL_LIBS = $(shell $(PKG_CONFIG) $(STATIC_FLAG) --libs libcrypto)
++
+ export TOPDIR	:= $(shell pwd)/
+ 
+ include Make.rules
+@@ -88,31 +90,31 @@
+ ShimReplace.so: lib/lib-efi.a
+ 
+ cert-to-efi-sig-list: cert-to-efi-sig-list.o lib/lib.a
+-	$(CC) $(ARCH3264) -o $@ $< lib/lib.a -lcrypto
++	$(CC) $(LDFLAGS) $(ARCH3264) -o $@ $< lib/lib.a $(SSL_LIBS)
+ 
+ sig-list-to-certs: sig-list-to-certs.o lib/lib.a
+-	$(CC) $(ARCH3264) -o $@ $< lib/lib.a -lcrypto
++	$(CC) $(LDFLAGS) $(ARCH3264) -o $@ $< lib/lib.a $(SSL_LIBS)
+ 
+ sign-efi-sig-list: sign-efi-sig-list.o lib/lib.a
+-	$(CC) $(ARCH3264) -o $@ $< lib/lib.a -lcrypto
++	$(CC) $(LDFLAGS) $(ARCH3264) -o $@ $< lib/lib.a $(SSL_LIBS)
+ 
+ hash-to-efi-sig-list: hash-to-efi-sig-list.o lib/lib.a
+-	$(CC) $(ARCH3264) -o $@ $< lib/lib.a
++	$(CC) $(LDFLAGS) $(ARCH3264) -o $@ $< lib/lib.a
+ 
+ cert-to-efi-hash-list: cert-to-efi-hash-list.o lib/lib.a
+-	$(CC) $(ARCH3264) -o $@ $< lib/lib.a -lcrypto
++	$(CC) $(LDFLAGS) $(ARCH3264) -o $@ $< lib/lib.a $(SSL_LIBS)
+ 
+ efi-keytool: efi-keytool.o lib/lib.a
+-	$(CC) $(ARCH3264) -o $@ $< lib/lib.a
++	$(CC) $(LDFLAGS) $(ARCH3264) -o $@ $< lib/lib.a
+ 
+ efi-readvar: efi-readvar.o lib/lib.a
+-	$(CC) $(ARCH3264) -o $@ $< lib/lib.a -lcrypto
++	$(CC) $(LDFLAGS) $(ARCH3264) -o $@ $< lib/lib.a $(SSL_LIBS)
+ 
+ efi-updatevar: efi-updatevar.o lib/lib.a
+-	$(CC) $(ARCH3264) -o $@ $< lib/lib.a -lcrypto
++	$(CC) $(LDFLAGS) $(ARCH3264) -o $@ $< lib/lib.a $(SSL_LIBS)
+ 
+ flash-var: flash-var.o lib/lib.a
+-	$(CC) $(ARCH3264) -o $@ $< lib/lib.a
++	$(CC) $(LDFLAGS) $(ARCH3264) -o $@ $< lib/lib.a
+ 
+ clean:
+ 	rm -f PK.* KEK.* DB.* $(EFIFILES) $(EFISIGNED) $(BINARIES) *.o *.so
+--- a/Make.rules
++++ b/Make.rules
+@@ -15,8 +15,7 @@
+ endif
+ INCDIR	   = -I$(TOPDIR)include/ -I/usr/include/efi -I/usr/include/efi/$(ARCH) -I/usr/include/efi/protocol
+ CPPFLAGS   = -DCONFIG_$(ARCH)
+-CFLAGS	   = -O2 -g $(ARCH3264) -fpic -Wall -fshort-wchar -fno-strict-aliasing -fno-merge-constants -fno-stack-protector -ffreestanding -fno-stack-check
+-LDFLAGS	   = -nostdlib
++CFLAGS +=  $(ARCH3264) -fpic -Wall -fshort-wchar -fno-strict-aliasing -fno-merge-constants -fno-stack-protector -ffreestanding -fno-stack-check
+ CRTOBJ		= crt0-efi-$(ARCH).o
+ CRTPATHS	= /lib /lib64 /lib/efi /lib64/efi /usr/lib /usr/lib64 /usr/lib/efi /usr/lib64/efi /usr/lib/gnuefi /usr/lib64/gnuefi
+ CRTPATH		= $(shell for f in $(CRTPATHS); do if [ -e $$f/$(CRTOBJ) ]; then echo $$f; break; fi; done)
+@@ -24,10 +23,9 @@
+ # there's a bug in the gnu tools ... the .reloc section has to be
+ # aligned otherwise the file alignment gets screwed up
+ LDSCRIPT	= elf_$(ARCH)_efi.lds
+-LDFLAGS		+= -shared -Bsymbolic $(CRTOBJS) -L $(CRTPATH) -L /usr/lib -L /usr/lib64 -T $(LDSCRIPT)
++LIBS		+= -nostdlib -shared -Bsymbolic $(CRTOBJS) -L $(CRTPATH) -T $(LDSCRIPT)
+ LOADLIBES	= -lefi -lgnuefi $(shell $(CC) $(ARCH3264) -print-libgcc-file-name)
+ FORMAT		= --target=efi-app-$(ARCH)
+-OBJCOPY		= objcopy
+ MYGUID		= 11111111-2222-3333-4444-123456789abc
+ INSTALL		= install
+ BINDIR		= $(DESTDIR)/usr/bin
+@@ -47,12 +45,12 @@
+ endif
+ 
+ ifeq ($(ARCH),arm)
+-  LDFLAGS += --defsym=EFI_SUBSYSTEM=0x0a
++  LIBS += --defsym=EFI_SUBSYSTEM=0x0a
+   FORMAT = -O binary
+ endif
+ 
+ ifeq ($(ARCH),aarch64)
+-  LDFLAGS += --defsym=EFI_SUBSYSTEM=0x0a
++  LIBS += --defsym=EFI_SUBSYSTEM=0x0a
+   FORMAT = -O binary
+ endif
+ 
+@@ -61,9 +59,9 @@
+ 		   -j .rel -j .rela -j .rel.* -j .rela.* -j .rel* -j .rela* \
+ 		   -j .reloc $(FORMAT) $*.so $@
+ %.so: %.o
+-	$(LD) $(LDFLAGS) $^ -o $@ $(LOADLIBES)
++	$(LD) $(LIBS) $^ -o $@ $(LOADLIBES)
+ 	# check we have no undefined symbols
+-	nm -D $@ | grep ' U ' && exit 1 || exit 0
++	$(NM) -D $@ | grep ' U ' && exit 1 || exit 0
+ 
+ %.h: %.auth
+ 	./xxdi.pl $< > $@
+@@ -71,7 +69,7 @@
+ %.hash: %.efi hash-to-efi-sig-list
+ 	./hash-to-efi-sig-list $< $@
+ 
+-%-blacklist.esl: %.crt cert-to-efi-hash-list
++%-blacklist.esl: %.crt cert-to-efi-sig-list
+ 	./cert-to-efi-sig-list $< $@
+ 
+ %-hash-blacklist.esl: %.crt cert-to-efi-hash-list
+@@ -129,7 +127,7 @@
+ #	sbsign --key KEK.key --cert KEK.crt --output $@ $<
+ 
+ %.a:
+-	ar rcv $@ $^
++	$(AR) rcv $@ $^
+ 
+ doc/%.1: doc/%.1.in %
+ 	$(HELP2MAN) --no-info -i $< -o $@ ./$*
diff --git a/sdk_container/src/third_party/portage-stable/app-crypt/efitools/files/1.9.2-clang16.patch b/sdk_container/src/third_party/portage-stable/app-crypt/efitools/files/1.9.2-clang16.patch
new file mode 100644
index 00000000000..944a731bcde
--- /dev/null
+++ b/sdk_container/src/third_party/portage-stable/app-crypt/efitools/files/1.9.2-clang16.patch
@@ -0,0 +1,108 @@
+--- a/cert-to-efi-sig-list.c
++++ b/cert-to-efi-sig-list.c
+@@ -6,7 +6,6 @@
+ 
+ 
+ #include <stdint.h>
+-#define __STDC_VERSION__ 199901L
+ #include <efi.h>
+ #ifdef CONFIG_arm
+ /* FIXME:
+--- a/efi-keytool.c
++++ b/efi-keytool.c
+@@ -15,7 +15,6 @@
+ #include <fcntl.h>
+ #include <unistd.h>
+ 
+-#define __STDC_VERSION__ 199901L
+ #include <efi.h>
+ 
+ #include <kernel_efivars.h>
+--- a/efi-readvar.c
++++ b/efi-readvar.c
+@@ -17,7 +17,6 @@
+ 
+ #include <openssl/x509.h>
+ 
+-#define __STDC_VERSION__ 199901L
+ #include <efi.h>
+ 
+ #include <kernel_efivars.h>
+--- a/efi-updatevar.c
++++ b/efi-updatevar.c
+@@ -20,7 +20,6 @@
+ #include <openssl/err.h>
+ #include <openssl/pem.h>
+ 
+-#define __STDC_VERSION__ 199901L
+ #include <efi.h>
+ 
+ #include <kernel_efivars.h>
+--- a/flash-var.c
++++ b/flash-var.c
+@@ -1,3 +1,5 @@
++#define _XOPEN_SOURCE 700
++
+ #include <stdlib.h>
+ #include <stdint.h>
+ #include <sys/types.h>
+@@ -10,7 +12,6 @@
+ #include <fcntl.h>
+ #include <unistd.h>
+ 
+-#define __STDC_VERSION__ 199901L
+ #include <efi.h>
+ 
+ #include <version.h>
+--- a/hash-to-efi-sig-list.c
++++ b/hash-to-efi-sig-list.c
+@@ -4,7 +4,6 @@
+  * see COPYING file
+  */
+ #include <stdint.h>
+-#define __STDC_VERSION__ 199901L
+ #include <efi.h>
+ #ifdef CONFIG_arm
+ /* FIXME:
+--- a/include/variableformat.h
++++ b/include/variableformat.h
+@@ -109,7 +109,7 @@
+ 
+ #pragma pack()
+ 
+-inline BOOLEAN
++static inline BOOLEAN
+ IsValidVariableHeader (VARIABLE_HEADER   *vh) {
+ 	if (vh == NULL || vh->StartId != VARIABLE_DATA)
+ 		return FALSE;
+--- a/lib/kernel_efivars.c
++++ b/lib/kernel_efivars.c
+@@ -16,7 +16,6 @@
+ #include <unistd.h>
+ #include <time.h>
+ 
+-#define __STDC_VERSION__ 199901L
+ #include <efi.h>
+ 
+ #include <kernel_efivars.h>
+--- a/sig-list-to-certs.c
++++ b/sig-list-to-certs.c
+@@ -4,7 +4,6 @@
+  * see COPYING file
+  */
+ #include <stdint.h>
+-#define __STDC_VERSION__ 199901L
+ #include <efi.h>
+ #ifdef CONFIG_arm
+ /* FIXME:
+--- a/sign-efi-sig-list.c
++++ b/sign-efi-sig-list.c
+@@ -4,7 +4,7 @@
+  * see COPYING file
+  */
+ #include <stdint.h>
+-#define __STDC_VERSION__ 199901L
++#define _XOPEN_SOURCE 700
+ #include <efi.h>
+ #ifdef CONFIG_arm
+ /* FIXME:

From 644073506d116e9a3812c19159aaaedd48d37805 Mon Sep 17 00:00:00 2001
From: Krzesimir Nowak <knowak@microsoft.com>
Date: Thu, 7 Dec 2023 16:31:37 +0100
Subject: [PATCH 07/22] app-crypt/mhash: Sync with Gentoo

It's from Gentoo commit 6d2df6f4b71756f49d6afeb99ef76b693bd39742.
---
 .../files/mhash-0.9.9.9-no-malloc-check.patch | 20 +++++++++++++++++++
 .../app-crypt/mhash/files/mhash.pc            |  4 ++++
 .../app-crypt/mhash/metadata.xml              |  4 ++--
 ....9.9-r2.ebuild => mhash-0.9.9.9-r3.ebuild} | 20 +++++++++++--------
 4 files changed, 38 insertions(+), 10 deletions(-)
 create mode 100644 sdk_container/src/third_party/portage-stable/app-crypt/mhash/files/mhash-0.9.9.9-no-malloc-check.patch
 create mode 100644 sdk_container/src/third_party/portage-stable/app-crypt/mhash/files/mhash.pc
 rename sdk_container/src/third_party/portage-stable/app-crypt/mhash/{mhash-0.9.9.9-r2.ebuild => mhash-0.9.9.9-r3.ebuild} (72%)

diff --git a/sdk_container/src/third_party/portage-stable/app-crypt/mhash/files/mhash-0.9.9.9-no-malloc-check.patch b/sdk_container/src/third_party/portage-stable/app-crypt/mhash/files/mhash-0.9.9.9-no-malloc-check.patch
new file mode 100644
index 00000000000..6da1f98ac78
--- /dev/null
+++ b/sdk_container/src/third_party/portage-stable/app-crypt/mhash/files/mhash-0.9.9.9-no-malloc-check.patch
@@ -0,0 +1,20 @@
+https://sourceforge.net/p/mhash/patches/11/
+
+Compiling mhash-0.9.9.9 on platforms (like AIX) without GNU libc compatible malloc leads to undefined symbol rpl_malloc
+when linking the in-mhash executables drver, frag_test, rest_test, hmac_test, keygen_test.
+
+Reason is that configure.in still contains AC_FUNC_MALLOC, detecting need
+to "#define malloc rpl_malloc", while mhash does not provide a rpl_malloc implementation.
+
+As the only use of malloc() in lib/stdfns.c does not rely on GNU libc
+compatible malloc actually, there is no need to check for one.
+--- a/configure.in
++++ b/configure.in
+@@ -64,7 +64,6 @@ AC_CHECK_HEADERS(signal.h stdint.h stdio.h stdlib.h string.h strings.h)
+ 
+ dnl Checks for functions
+ 
+-AC_FUNC_MALLOC
+ AC_FUNC_MEMCMP
+ 
+ AC_CHECK_FUNCS(bcopy bzero)
diff --git a/sdk_container/src/third_party/portage-stable/app-crypt/mhash/files/mhash.pc b/sdk_container/src/third_party/portage-stable/app-crypt/mhash/files/mhash.pc
new file mode 100644
index 00000000000..6186f85c783
--- /dev/null
+++ b/sdk_container/src/third_party/portage-stable/app-crypt/mhash/files/mhash.pc
@@ -0,0 +1,4 @@
+Libs:-lmhash
+Name: mhash
+Version: @VERSION@
+Description: provides a uniform interface to several hash algorithms
diff --git a/sdk_container/src/third_party/portage-stable/app-crypt/mhash/metadata.xml b/sdk_container/src/third_party/portage-stable/app-crypt/mhash/metadata.xml
index dad2754fed3..11aead93f45 100644
--- a/sdk_container/src/third_party/portage-stable/app-crypt/mhash/metadata.xml
+++ b/sdk_container/src/third_party/portage-stable/app-crypt/mhash/metadata.xml
@@ -2,7 +2,7 @@
 <!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
 <pkgmetadata>
 	<!-- maintainer-needed -->
-<upstream>
-	<remote-id type="sourceforge">mhash</remote-id>
+	<upstream>
+		<remote-id type="sourceforge">mhash</remote-id>
 	</upstream>
 </pkgmetadata>
diff --git a/sdk_container/src/third_party/portage-stable/app-crypt/mhash/mhash-0.9.9.9-r2.ebuild b/sdk_container/src/third_party/portage-stable/app-crypt/mhash/mhash-0.9.9.9-r3.ebuild
similarity index 72%
rename from sdk_container/src/third_party/portage-stable/app-crypt/mhash/mhash-0.9.9.9-r2.ebuild
rename to sdk_container/src/third_party/portage-stable/app-crypt/mhash/mhash-0.9.9.9-r3.ebuild
index 55e78bbb25f..e2dff3f8b8b 100644
--- a/sdk_container/src/third_party/portage-stable/app-crypt/mhash/mhash-0.9.9.9-r2.ebuild
+++ b/sdk_container/src/third_party/portage-stable/app-crypt/mhash/mhash-0.9.9.9-r3.ebuild
@@ -1,17 +1,17 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=7
+EAPI=8
 
 inherit autotools
 
 DESCRIPTION="Library providing a uniform interface to a large number of hash algorithms"
-HOMEPAGE="http://mhash.sourceforge.net/"
+HOMEPAGE="https://mhash.sourceforge.net/"
 SRC_URI="mirror://sourceforge/mhash/${P}.tar.gz"
 
-LICENSE="GPL-2"
+LICENSE="GPL-2+"
 SLOT="0"
-KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~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 ~ppc-macos ~x64-macos ~x64-solaris"
 IUSE="static-libs"
 
 BDEPEND="dev-lang/perl" # pod2html
@@ -25,6 +25,7 @@ PATCHES=(
 	"${FILESDIR}"/${P}-force64bit-tiger.patch
 	"${FILESDIR}"/${P}-align.patch
 	"${FILESDIR}"/${P}-alignment.patch
+	"${FILESDIR}"/${P}-no-malloc-check.patch
 )
 
 DOCS=( doc/example.c doc/skid2-authentication )
@@ -38,6 +39,10 @@ src_prepare() {
 		-e 's/--netscape//' \
 		"${S}"/doc/Makefile.in || die
 
+	sed \
+		-e "s:@VERSION@:${PV}:" \
+		"${FILESDIR}"/${PN}.pc > ${PN}.pc || die
+
 	# Refresh bundled libtool (ltmain.sh)
 	# (elibtoolize is not sufficient)
 	# bug #668666
@@ -45,9 +50,6 @@ src_prepare() {
 }
 
 src_configure() {
-	# https://sourceforge.net/p/mhash/patches/11/
-	export ac_cv_func_malloc_0_nonnull=yes
-
 	econf $(use_enable static-libs static)
 }
 
@@ -59,5 +61,7 @@ src_compile() {
 
 src_install() {
 	default
+	insinto /usr/$(get_libdir)/pkgconfig
+	doins ${PN}.pc
 	find "${ED}" -name '*.la' -delete || die
 }

From b2cc4c952c768c055e12d9fbca223383d49f45d1 Mon Sep 17 00:00:00 2001
From: Krzesimir Nowak <knowak@microsoft.com>
Date: Thu, 7 Dec 2023 16:31:38 +0100
Subject: [PATCH 08/22] app-crypt/shash: Sync with Gentoo

It's from Gentoo commit a457ca66361ff3b68cd39b0ed38e770077de0db0.
---
 .../shash/files/0.2.6-manpage-fixes.patch     |   5 +-
 .../shash/files/shash-0.2.6-C99-decls.patch   | 195 ++++++++++++++++++
 .../files/shash-0.2.6-binary-files.patch      |   4 +-
 .../files/shash-0.2.6-format-security.patch   |   4 +-
 ...-0.2.6-r3.ebuild => shash-0.2.6-r4.ebuild} |  21 +-
 5 files changed, 215 insertions(+), 14 deletions(-)
 create mode 100644 sdk_container/src/third_party/portage-stable/app-crypt/shash/files/shash-0.2.6-C99-decls.patch
 rename sdk_container/src/third_party/portage-stable/app-crypt/shash/{shash-0.2.6-r3.ebuild => shash-0.2.6-r4.ebuild} (61%)

diff --git a/sdk_container/src/third_party/portage-stable/app-crypt/shash/files/0.2.6-manpage-fixes.patch b/sdk_container/src/third_party/portage-stable/app-crypt/shash/files/0.2.6-manpage-fixes.patch
index 0376e15c357..111730c5782 100644
--- a/sdk_container/src/third_party/portage-stable/app-crypt/shash/files/0.2.6-manpage-fixes.patch
+++ b/sdk_container/src/third_party/portage-stable/app-crypt/shash/files/0.2.6-manpage-fixes.patch
@@ -1,6 +1,5 @@
-diff -pruN shash-0.2.6/doc/shash.1 shash-0.2.6-r1/doc/shash.1
---- shash-0.2.6/doc/shash.1	2004-09-18 09:51:04.004647112 +0100
-+++ shash-0.2.6-r1/doc/shash.1	2004-09-18 09:57:26.062565480 +0100
+--- a/doc/shash.1
++++ b/doc/shash.1
 @@ -31,7 +31,7 @@ Because of this shash also supports HMAC
  a mechanism for message authentication using cryptographic hash functions.
  So shash can use a key with a hash algorithm to produce hashes that can only
diff --git a/sdk_container/src/third_party/portage-stable/app-crypt/shash/files/shash-0.2.6-C99-decls.patch b/sdk_container/src/third_party/portage-stable/app-crypt/shash/files/shash-0.2.6-C99-decls.patch
new file mode 100644
index 00000000000..bf2f3ab79d8
--- /dev/null
+++ b/sdk_container/src/third_party/portage-stable/app-crypt/shash/files/shash-0.2.6-C99-decls.patch
@@ -0,0 +1,195 @@
+--- a/src/environ.c
++++ b/src/environ.c
+@@ -4,7 +4,7 @@
+ #endif
+ #include "environ.h"
+ 
+-int check_env()
++int check_env(void)
+ {
+ 
+ 	if (getenv(SHASH_KEY) != NULL
+@@ -15,7 +15,7 @@
+ }
+ 
+ char *
+- get_env_key()
++ get_env_key(void)
+ {
+ 
+ 	if (getenv(SHASH_KEY) != NULL) {
+@@ -26,7 +26,7 @@
+ 
+ }
+ 
+-char *get_env_bit_mode()
++char *get_env_bit_mode(void)
+ {
+ 
+ 	return getenv(SHASH_KEYMODE);
+--- a/src/environ.h
++++ b/src/environ.h
+@@ -3,7 +3,7 @@
+ #define SHASH_KEY "SHASH_KEY"
+ #define SHASH_KEYMODE "SHASH_KEYMODE"
+ 
+-int check_env();
+-char * get_env_key();
+-char * get_env_bit_mode();
++int check_env(void);
++char * get_env_key(void);
++char * get_env_bit_mode(void);
+ 
+--- a/src/errors.c
++++ b/src/errors.c
+@@ -1,5 +1,7 @@
+ #include <defines.h>
+ 
++#include <stdio.h>
++
+ extern int quiet;
+ 
+ void err_quit(char *errmsg)
+--- a/src/extra.c
++++ b/src/extra.c
+@@ -1,5 +1,10 @@
+ #include <defines.h>
+ 
++#include <pwd.h>
++#include <stdlib.h>
++#include <string.h>
++#include <sys/stat.h>
++
+ #ifdef HAVE_STAT
+ 
+ int check_file(char *filename)
+--- a/src/gaaout.c
++++ b/src/gaaout.c
+@@ -11,6 +11,11 @@
+ #endif
+ #endif
+ 
++void hash_license(void);
++void hash_version(void);
++void list_keygen_algorithms(void);
++int hash_list(void);
++
+ void* gaa_malloc( size_t size) {
+ void* ret;
+ 	ret = malloc(size);
+--- a/src/random.c
++++ b/src/random.c
+@@ -24,7 +24,7 @@
+ static FILE *ffd;
+ 
+ word32
+-get_rand32()
++get_rand32(void)
+ {
+ 	int fd, x;
+ 	word32 rand_data;
+@@ -46,7 +46,7 @@
+ 
+ 
+ word8
+-get_rand8()
++get_rand8(void)
+ {
+ 
+ 	int fd, x;
+@@ -69,7 +69,7 @@
+ 
+ 
+ word32
+-get_safe_rand32()
++get_safe_rand32(void)
+ {
+ 	int fd, x;
+ 	word32 rand_data;
+@@ -91,7 +91,7 @@
+ 
+ 
+ word8
+-get_safe_rand8()
++get_safe_rand8(void)
+ {
+ 
+ 	int fd, x;
+@@ -131,13 +131,13 @@
+ 	return 0;
+ }
+ 
+-void close_rand()
++void close_rand(void)
+ {
+ 	fclose(ffd);
+ }
+ 
+ word32
+-get_o_rand32()
++get_o_rand32(void)
+ {
+ 	int x;
+ 	word32 rand_data;
+@@ -152,7 +152,7 @@
+ }
+ 
+ word8
+-get_o_rand8()
++get_o_rand8(void)
+ {
+ 
+ 	int x;
+--- a/src/random.h
++++ b/src/random.h
+@@ -1,14 +1,14 @@
+ 
+ #ifdef HAVE_DEV_RANDOM
+ 
+-word32 get_rand32();
+-word8 get_rand8();
+-word32 get_safe_rand32();
+-word8 get_safe_rand8();
++word32 get_rand32(void);
++word8 get_rand8(void);
++word32 get_safe_rand32(void);
++word8 get_safe_rand8(void);
+ 
+ int open_rand(int);
+-void close_rand();
+-word32 get_o_rand32();
+-word8 get_o_rand8();
++void close_rand(void);
++word32 get_o_rand32(void);
++word8 get_o_rand8(void);
+ 
+ #endif
+--- a/src/shash.c
++++ b/src/shash.c
+@@ -485,7 +485,7 @@
+ 	}
+ }
+ 
+-int hash_list()
++int hash_list(void)
+ {
+ 	hashid i;
+ 	char *y;
+@@ -715,7 +715,7 @@
+ 	return counter;
+ }
+ 
+-void hash_license()
++void hash_license(void)
+ {
+ 	fprintf(stdout, ("\nCopyright (C) 1999,2001,2002 Nikos Mavroyanopoulos\n"
+ "This program is free software; you can redistribute it and/or modify \n"
+@@ -733,7 +733,7 @@
+ "Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\n\n"));
+ }
+ 
+-void hash_version()
++void hash_version(void)
+ {
+ 	fprintf(stderr, ("shash v.%s (%s-%s-%s)\n"), VERSION, T_CPU,
+ 		T_VENDOR, T_OS);
diff --git a/sdk_container/src/third_party/portage-stable/app-crypt/shash/files/shash-0.2.6-binary-files.patch b/sdk_container/src/third_party/portage-stable/app-crypt/shash/files/shash-0.2.6-binary-files.patch
index 1eb0cba1761..9cb5a7dc4c0 100644
--- a/sdk_container/src/third_party/portage-stable/app-crypt/shash/files/shash-0.2.6-binary-files.patch
+++ b/sdk_container/src/third_party/portage-stable/app-crypt/shash/files/shash-0.2.6-binary-files.patch
@@ -1,5 +1,5 @@
---- shash-0.2.6/src/shash.c
-+++ shash-0.2.6/src/shash.c
+--- a/src/shash.c
++++ b/src/shash.c
 @@ -631,11 +631,11 @@
  
  		if (nosalt == FALSE && hmac == 1) {
diff --git a/sdk_container/src/third_party/portage-stable/app-crypt/shash/files/shash-0.2.6-format-security.patch b/sdk_container/src/third_party/portage-stable/app-crypt/shash/files/shash-0.2.6-format-security.patch
index 4e46639e280..20f850316cc 100644
--- a/sdk_container/src/third_party/portage-stable/app-crypt/shash/files/shash-0.2.6-format-security.patch
+++ b/sdk_container/src/third_party/portage-stable/app-crypt/shash/files/shash-0.2.6-format-security.patch
@@ -1,5 +1,5 @@
---- shash-0.2.6/src/errors.c
-+++ shash-0.2.6/src/errors.c
+--- a/src/errors.c
++++ b/src/errors.c
 @@ -4,7 +4,7 @@
  
  void err_quit(char *errmsg)
diff --git a/sdk_container/src/third_party/portage-stable/app-crypt/shash/shash-0.2.6-r3.ebuild b/sdk_container/src/third_party/portage-stable/app-crypt/shash/shash-0.2.6-r4.ebuild
similarity index 61%
rename from sdk_container/src/third_party/portage-stable/app-crypt/shash/shash-0.2.6-r3.ebuild
rename to sdk_container/src/third_party/portage-stable/app-crypt/shash/shash-0.2.6-r4.ebuild
index 158e48f3af7..2094f288027 100644
--- a/sdk_container/src/third_party/portage-stable/app-crypt/shash/shash-0.2.6-r3.ebuild
+++ b/sdk_container/src/third_party/portage-stable/app-crypt/shash/shash-0.2.6-r4.ebuild
@@ -1,9 +1,9 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=6
+EAPI=8
 
-inherit bash-completion-r1
+inherit autotools bash-completion-r1
 
 DESCRIPTION="Generate or check digests or MACs of files"
 HOMEPAGE="http://mcrypt.hellug.gr/shash/"
@@ -11,10 +11,11 @@ SRC_URI="ftp://mcrypt.hellug.gr/pub/mcrypt/${PN}/${P}.tar.gz"
 
 LICENSE="GPL-2"
 SLOT="0"
-KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos"
+KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos"
 IUSE="static"
 
-DEPEND=">=app-crypt/mhash-0.8.18-r1
+DEPEND="
+	>=app-crypt/mhash-0.8.18-r1
 	static? ( app-crypt/mhash[static-libs(+)] )"
 RDEPEND="${DEPEND}"
 
@@ -22,14 +23,20 @@ PATCHES=(
 	"${FILESDIR}"/${PV}-manpage-fixes.patch
 	"${FILESDIR}"/${P}-binary-files.patch
 	"${FILESDIR}"/${P}-format-security.patch
+	"${FILESDIR}"/${P}-C99-decls.patch
 )
 
+src_prepare() {
+	default
+	eautoreconf
+}
+
 src_configure() {
 	econf $(use_enable static static-link)
 }
 
 src_install() {
-	emake install DESTDIR="${D}"
-	dodoc AUTHORS ChangeLog INSTALL NEWS doc/sample.shashrc doc/FORMAT
+	default
+	dodoc doc/sample.shashrc doc/FORMAT
 	newbashcomp "${FILESDIR}"/shash.bash-completion ${PN}
 }

From a0ba93cf4808719f6b8bb2b5dbf41f8b131ad379 Mon Sep 17 00:00:00 2001
From: Krzesimir Nowak <knowak@microsoft.com>
Date: Thu, 7 Dec 2023 16:31:38 +0100
Subject: [PATCH 09/22] app-doc/eclass-manpages: Sync with Gentoo

It's from Gentoo commit 5b1fe4c46b67b894d0e06ae64a7ceca78f582093.
---
 .../app-doc/eclass-manpages/Manifest          |  5 ++--
 .../eclass-manpages-20210712.ebuild           | 20 ----------------
 .../eclass-manpages-20211002.ebuild           | 21 ----------------
 .../eclass-manpages-20230601.ebuild           | 24 +++++++++++++++++++
 .../eclass-manpages-20230624.ebuild           | 24 +++++++++++++++++++
 .../eclass-manpages-20230919.ebuild           | 24 +++++++++++++++++++
 .../eclass-manpages-99999999.ebuild           | 15 +++++-------
 .../app-doc/eclass-manpages/metadata.xml      |  6 +++++
 8 files changed, 87 insertions(+), 52 deletions(-)
 delete mode 100644 sdk_container/src/third_party/portage-stable/app-doc/eclass-manpages/eclass-manpages-20210712.ebuild
 delete mode 100644 sdk_container/src/third_party/portage-stable/app-doc/eclass-manpages/eclass-manpages-20211002.ebuild
 create mode 100644 sdk_container/src/third_party/portage-stable/app-doc/eclass-manpages/eclass-manpages-20230601.ebuild
 create mode 100644 sdk_container/src/third_party/portage-stable/app-doc/eclass-manpages/eclass-manpages-20230624.ebuild
 create mode 100644 sdk_container/src/third_party/portage-stable/app-doc/eclass-manpages/eclass-manpages-20230919.ebuild

diff --git a/sdk_container/src/third_party/portage-stable/app-doc/eclass-manpages/Manifest b/sdk_container/src/third_party/portage-stable/app-doc/eclass-manpages/Manifest
index af9cb96ff53..e96bf9cbf26 100644
--- a/sdk_container/src/third_party/portage-stable/app-doc/eclass-manpages/Manifest
+++ b/sdk_container/src/third_party/portage-stable/app-doc/eclass-manpages/Manifest
@@ -1,2 +1,3 @@
-DIST eclass-manpages-20210712.tar.xz 410588 BLAKE2B 776da6b26db95791401d562d3d550e1ab71dc19f54124fa37e78ab2595835fb05e7382b98007e58131698710b978dd87cbc10df1ea98c6ef01ec866418d6f9a6 SHA512 fb2bdc790d96f0662d84eddd01f291b4a3cac638c1e3df8975755e81d2d64dda14b0f60a77387da8544672080711d5047dda777d27a8cf2ded2634c47ecfee4b
-DIST eclass-manpages-20211002.tar.xz 410056 BLAKE2B 6ac900aaa2718d838af7f069766e2e818276c80d1819f38ca0bc09d3815487083dfe64781331d9b0049c474fc6cec9381daea9c7961f14b208cd3372c79b7564 SHA512 bcea1bcae107df73c72c37dd65c5414833ad59e9d6088f806cb06512b53cdbcad10fb50fe23ede02ccfcda17ae86c70879f496929ef0f54aa799179f9ef0d869
+DIST eclass-manpages-20230601.tar.xz 423088 BLAKE2B 35ef9f3fad733d6aa363c2808de8e6cc8936f1c965c7181b55cd955c8e3bcc339af7ac070302f220002e77011adf05e9904f38d29f832f7640f3cdc11f4f0a8f SHA512 5ff2dfca210b14a448472d6ea55ae5b321541e09124c74ff43392eea48dab06b22fbad9a7b62b80d5b67f9d07e1055bcca29eb03f77b899be886ada078e2df1f
+DIST eclass-manpages-20230624.tar.xz 420244 BLAKE2B 867d215a89f7f92e7b9ed9ce52e70e42609bcd038e98074c9d0e6327e227bc010ea4d4fbd19e21d18635138a668cfc98492b3fdcf66bbe9960252474c14fd193 SHA512 c0df42ab7648337643de4bc9c204212e0a3563cea689ef8f8e507964bd88a69f0703d7f93c0f3e54dc333b7689c9eeba7dd0ea8525161a88b2605a26c8834e77
+DIST eclass-manpages-20230919.tar.xz 432712 BLAKE2B d3b478f9c8ae26d9b0cbddb016861d59af58ff57ffed2e6c5abf423523c33317d1b37167b37925893d068838b1c7509514c51b60b98dfbeda631f8ba7641b8bd SHA512 1e07da85179f04172200b94e5cf5a21d04787fce800ceae83322554d5eb37cdc6073099d5ee5f12e04bbf967de40f63b01321dcb5ac4995e3c2503a94407c2d2
diff --git a/sdk_container/src/third_party/portage-stable/app-doc/eclass-manpages/eclass-manpages-20210712.ebuild b/sdk_container/src/third_party/portage-stable/app-doc/eclass-manpages/eclass-manpages-20210712.ebuild
deleted file mode 100644
index d28b3ad5325..00000000000
--- a/sdk_container/src/third_party/portage-stable/app-doc/eclass-manpages/eclass-manpages-20210712.ebuild
+++ /dev/null
@@ -1,20 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-DESCRIPTION="Collection of Gentoo eclass manpages"
-HOMEPAGE="https://github.com/mgorny/eclass-to-manpage"
-SRC_URI="https://dev.gentoo.org/~ulm/distfiles/${P}.tar.xz"
-
-LICENSE="GPL-2"
-SLOT="0"
-# Keep the keywords stable. No need to change to ~arch.
-KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~m68k ~mips ppc ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux ~x64-macos ~x86-solaris"
-
-BDEPEND="app-arch/xz-utils
-	sys-apps/gawk"
-
-src_install() {
-	emake install DESTDIR="${D}" PREFIX="${EPREFIX}/usr"
-}
diff --git a/sdk_container/src/third_party/portage-stable/app-doc/eclass-manpages/eclass-manpages-20211002.ebuild b/sdk_container/src/third_party/portage-stable/app-doc/eclass-manpages/eclass-manpages-20211002.ebuild
deleted file mode 100644
index 117b609c71e..00000000000
--- a/sdk_container/src/third_party/portage-stable/app-doc/eclass-manpages/eclass-manpages-20211002.ebuild
+++ /dev/null
@@ -1,21 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-DESCRIPTION="Collection of Gentoo eclass manpages"
-HOMEPAGE="https://github.com/mgorny/eclass-to-manpage"
-SRC_URI="https://dev.gentoo.org/~ulm/distfiles/${P}.tar.xz"
-
-LICENSE="GPL-2"
-SLOT="0"
-# Keep the keywords stable. No need to change to ~arch.
-KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~x64-macos ~x86-solaris"
-
-BDEPEND="app-arch/xz-utils
-	sys-apps/gawk
-	sys-apps/groff"
-
-src_install() {
-	emake install DESTDIR="${D}" PREFIX="${EPREFIX}/usr"
-}
diff --git a/sdk_container/src/third_party/portage-stable/app-doc/eclass-manpages/eclass-manpages-20230601.ebuild b/sdk_container/src/third_party/portage-stable/app-doc/eclass-manpages/eclass-manpages-20230601.ebuild
new file mode 100644
index 00000000000..a48746c8b4c
--- /dev/null
+++ b/sdk_container/src/third_party/portage-stable/app-doc/eclass-manpages/eclass-manpages-20230601.ebuild
@@ -0,0 +1,24 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+# Instructions to make a dist tarball:
+# git clone https://github.com/projg2/eclass-to-manpage.git
+# cd eclass-to-manpage
+# make dist ECLASSDIR=~/g/eclass/
+
+DESCRIPTION="Collection of Gentoo eclass manpages"
+HOMEPAGE="https://github.com/projg2/eclass-to-manpage"
+SRC_URI="https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+# Keep the keywords stable. No need to change to ~arch.
+KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~x64-macos"
+
+BDEPEND="sys-apps/gawk"
+
+src_install() {
+	emake install DESTDIR="${D}" PREFIX="${EPREFIX}/usr"
+}
diff --git a/sdk_container/src/third_party/portage-stable/app-doc/eclass-manpages/eclass-manpages-20230624.ebuild b/sdk_container/src/third_party/portage-stable/app-doc/eclass-manpages/eclass-manpages-20230624.ebuild
new file mode 100644
index 00000000000..a48746c8b4c
--- /dev/null
+++ b/sdk_container/src/third_party/portage-stable/app-doc/eclass-manpages/eclass-manpages-20230624.ebuild
@@ -0,0 +1,24 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+# Instructions to make a dist tarball:
+# git clone https://github.com/projg2/eclass-to-manpage.git
+# cd eclass-to-manpage
+# make dist ECLASSDIR=~/g/eclass/
+
+DESCRIPTION="Collection of Gentoo eclass manpages"
+HOMEPAGE="https://github.com/projg2/eclass-to-manpage"
+SRC_URI="https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+# Keep the keywords stable. No need to change to ~arch.
+KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~x64-macos"
+
+BDEPEND="sys-apps/gawk"
+
+src_install() {
+	emake install DESTDIR="${D}" PREFIX="${EPREFIX}/usr"
+}
diff --git a/sdk_container/src/third_party/portage-stable/app-doc/eclass-manpages/eclass-manpages-20230919.ebuild b/sdk_container/src/third_party/portage-stable/app-doc/eclass-manpages/eclass-manpages-20230919.ebuild
new file mode 100644
index 00000000000..a48746c8b4c
--- /dev/null
+++ b/sdk_container/src/third_party/portage-stable/app-doc/eclass-manpages/eclass-manpages-20230919.ebuild
@@ -0,0 +1,24 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+# Instructions to make a dist tarball:
+# git clone https://github.com/projg2/eclass-to-manpage.git
+# cd eclass-to-manpage
+# make dist ECLASSDIR=~/g/eclass/
+
+DESCRIPTION="Collection of Gentoo eclass manpages"
+HOMEPAGE="https://github.com/projg2/eclass-to-manpage"
+SRC_URI="https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+# Keep the keywords stable. No need to change to ~arch.
+KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~x64-macos"
+
+BDEPEND="sys-apps/gawk"
+
+src_install() {
+	emake install DESTDIR="${D}" PREFIX="${EPREFIX}/usr"
+}
diff --git a/sdk_container/src/third_party/portage-stable/app-doc/eclass-manpages/eclass-manpages-99999999.ebuild b/sdk_container/src/third_party/portage-stable/app-doc/eclass-manpages/eclass-manpages-99999999.ebuild
index 2339dc038f4..2a553378b66 100644
--- a/sdk_container/src/third_party/portage-stable/app-doc/eclass-manpages/eclass-manpages-99999999.ebuild
+++ b/sdk_container/src/third_party/portage-stable/app-doc/eclass-manpages/eclass-manpages-99999999.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=8
@@ -6,24 +6,21 @@ EAPI=8
 inherit git-r3
 
 DESCRIPTION="Collection of Gentoo eclass manpages"
-HOMEPAGE="https://github.com/mgorny/eclass-to-manpage"
-SRC_URI=""
+HOMEPAGE="https://github.com/projg2/eclass-to-manpage"
 EGIT_REPO_URI="https://anongit.gentoo.org/git/repo/gentoo.git
 	https://github.com/gentoo/gentoo.git"
 
 LICENSE="GPL-2"
 SLOT="0"
-KEYWORDS=""
 
-BDEPEND="sys-apps/gawk
-	sys-apps/groff"
+BDEPEND="sys-apps/gawk"
 
 src_unpack() {
 	git-r3_fetch
-	git-r3_fetch "https://github.com/mgorny/eclass-to-manpage"
+	git-r3_fetch "https://github.com/projg2/eclass-to-manpage.git"
 
-	git-r3_checkout '' '' '' eclass
-	git-r3_checkout "https://github.com/mgorny/eclass-to-manpage"
+	git-r3_checkout "" "" "" eclass
+	git-r3_checkout "https://github.com/projg2/eclass-to-manpage.git"
 }
 
 src_compile() {
diff --git a/sdk_container/src/third_party/portage-stable/app-doc/eclass-manpages/metadata.xml b/sdk_container/src/third_party/portage-stable/app-doc/eclass-manpages/metadata.xml
index e4aa80f1e0e..6b7923d9382 100644
--- a/sdk_container/src/third_party/portage-stable/app-doc/eclass-manpages/metadata.xml
+++ b/sdk_container/src/third_party/portage-stable/app-doc/eclass-manpages/metadata.xml
@@ -5,8 +5,14 @@
 		<email>mgorny@gentoo.org</email>
 		<name>Michał Górny</name>
 	</maintainer>
+	<maintainer type="project">
+		<email>devmanual@gentoo.org</email>
+	</maintainer>
 	<maintainer type="project">
 		<email>tools-portage@gentoo.org</email>
 		<name>Gentoo Portage tools team</name>
 	</maintainer>
+	<upstream>
+		<remote-id type="github">projg2/eclass-to-manpage</remote-id>
+	</upstream>
 </pkgmetadata>

From 2d5d580e9571b5f46b869484efe281a3e1db9a50 Mon Sep 17 00:00:00 2001
From: Krzesimir Nowak <knowak@microsoft.com>
Date: Thu, 7 Dec 2023 16:31:38 +0100
Subject: [PATCH 10/22] app-eselect/eselect-lib-bin-symlink: Sync with Gentoo

It's from Gentoo commit d729e464414eb0971b6899d8c2a1dee961a14ac5.
---
 .../eselect-lib-bin-symlink-0.1.1-r1.ebuild           | 11 +++++------
 .../eselect-lib-bin-symlink-9999.ebuild               | 10 ++++------
 .../app-eselect/eselect-lib-bin-symlink/metadata.xml  |  4 ++--
 3 files changed, 11 insertions(+), 14 deletions(-)

diff --git a/sdk_container/src/third_party/portage-stable/app-eselect/eselect-lib-bin-symlink/eselect-lib-bin-symlink-0.1.1-r1.ebuild b/sdk_container/src/third_party/portage-stable/app-eselect/eselect-lib-bin-symlink/eselect-lib-bin-symlink-0.1.1-r1.ebuild
index 15b74581703..bb2d42ffc5e 100644
--- a/sdk_container/src/third_party/portage-stable/app-eselect/eselect-lib-bin-symlink/eselect-lib-bin-symlink-0.1.1-r1.ebuild
+++ b/sdk_container/src/third_party/portage-stable/app-eselect/eselect-lib-bin-symlink/eselect-lib-bin-symlink-0.1.1-r1.ebuild
@@ -1,15 +1,14 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
 
 DESCRIPTION="An eselect library to manage executable symlinks"
-HOMEPAGE="https://github.com/mgorny/eselect-lib-bin-symlink/"
-SRC_URI="https://github.com/mgorny/eselect-lib-bin-symlink/releases/download/${P}/${P}.tar.bz2"
+HOMEPAGE="https://github.com/projg2/eselect-lib-bin-symlink/"
+SRC_URI="https://github.com/projg2/eselect-lib-bin-symlink/releases/download/${P}/${P}.tar.bz2"
 
-LICENSE="GPL-2"
+LICENSE="GPL-2+"
 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"
-IUSE=""
+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"
 
 RDEPEND="app-admin/eselect"
diff --git a/sdk_container/src/third_party/portage-stable/app-eselect/eselect-lib-bin-symlink/eselect-lib-bin-symlink-9999.ebuild b/sdk_container/src/third_party/portage-stable/app-eselect/eselect-lib-bin-symlink/eselect-lib-bin-symlink-9999.ebuild
index 208e978f8a0..d52de81af37 100644
--- a/sdk_container/src/third_party/portage-stable/app-eselect/eselect-lib-bin-symlink/eselect-lib-bin-symlink-9999.ebuild
+++ b/sdk_container/src/third_party/portage-stable/app-eselect/eselect-lib-bin-symlink/eselect-lib-bin-symlink-9999.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
@@ -6,13 +6,11 @@ EAPI=7
 inherit autotools git-r3
 
 DESCRIPTION="An eselect library to manage executable symlinks"
-HOMEPAGE="https://github.com/mgorny/eselect-lib-bin-symlink/"
-EGIT_REPO_URI="https://github.com/mgorny/eselect-lib-bin-symlink.git"
+HOMEPAGE="https://github.com/projg2/eselect-lib-bin-symlink/"
+EGIT_REPO_URI="https://github.com/projg2/eselect-lib-bin-symlink.git"
 
-LICENSE="GPL-2"
+LICENSE="GPL-2+"
 SLOT="0"
-KEYWORDS=""
-IUSE=""
 
 RDEPEND="app-admin/eselect"
 
diff --git a/sdk_container/src/third_party/portage-stable/app-eselect/eselect-lib-bin-symlink/metadata.xml b/sdk_container/src/third_party/portage-stable/app-eselect/eselect-lib-bin-symlink/metadata.xml
index 744f610c821..6ce72f96a81 100644
--- a/sdk_container/src/third_party/portage-stable/app-eselect/eselect-lib-bin-symlink/metadata.xml
+++ b/sdk_container/src/third_party/portage-stable/app-eselect/eselect-lib-bin-symlink/metadata.xml
@@ -10,8 +10,8 @@
       <email>mgorny@gentoo.org</email>
       <name>Michał Górny</name>
     </maintainer>
-    <bugs-to>https://github.com/mgorny/eselect-lib-bin-symlink/issues/</bugs-to>
-    <remote-id type="github">mgorny/eselect-lib-bin-symlink</remote-id>
+    <bugs-to>https://github.com/projg2/eselect-lib-bin-symlink/issues/</bugs-to>
+    <remote-id type="github">projg2/eselect-lib-bin-symlink</remote-id>
   </upstream>
   <stabilize-allarches/>
 </pkgmetadata>

From b4e0f0fe140ab203f778705ad12722c5b816b5f0 Mon Sep 17 00:00:00 2001
From: Krzesimir Nowak <knowak@microsoft.com>
Date: Thu, 7 Dec 2023 16:31:38 +0100
Subject: [PATCH 11/22] app-eselect/eselect-pinentry: Sync with Gentoo

It's from Gentoo commit 8938ea97da4e035d2f217184cef8c642caa18cd0.
---
 ...build => eselect-pinentry-0.7.2-r1.ebuild} |  8 +++----
 .../eselect-pinentry-0.7.2.ebuild             | 23 -------------------
 .../eselect-pinentry-0.7.3.ebuild             | 19 +++++++++++++++
 .../files/pinentry.eselect-0.7.2              |  4 ++--
 ...y.eselect-0.7.1 => pinentry.eselect-0.7.3} | 15 ++++++++----
 .../app-eselect/eselect-pinentry/metadata.xml |  5 +---
 6 files changed, 36 insertions(+), 38 deletions(-)
 rename sdk_container/src/third_party/portage-stable/app-eselect/eselect-pinentry/{eselect-pinentry-0.7.1.ebuild => eselect-pinentry-0.7.2-r1.ebuild} (58%)
 delete mode 100644 sdk_container/src/third_party/portage-stable/app-eselect/eselect-pinentry/eselect-pinentry-0.7.2.ebuild
 create mode 100644 sdk_container/src/third_party/portage-stable/app-eselect/eselect-pinentry/eselect-pinentry-0.7.3.ebuild
 rename sdk_container/src/third_party/portage-stable/app-eselect/eselect-pinentry/files/{pinentry.eselect-0.7.1 => pinentry.eselect-0.7.3} (50%)

diff --git a/sdk_container/src/third_party/portage-stable/app-eselect/eselect-pinentry/eselect-pinentry-0.7.1.ebuild b/sdk_container/src/third_party/portage-stable/app-eselect/eselect-pinentry/eselect-pinentry-0.7.2-r1.ebuild
similarity index 58%
rename from sdk_container/src/third_party/portage-stable/app-eselect/eselect-pinentry/eselect-pinentry-0.7.1.ebuild
rename to sdk_container/src/third_party/portage-stable/app-eselect/eselect-pinentry/eselect-pinentry-0.7.2-r1.ebuild
index 2dc9957138f..b8769496303 100644
--- a/sdk_container/src/third_party/portage-stable/app-eselect/eselect-pinentry/eselect-pinentry-0.7.1.ebuild
+++ b/sdk_container/src/third_party/portage-stable/app-eselect/eselect-pinentry/eselect-pinentry-0.7.2-r1.ebuild
@@ -1,16 +1,14 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=7
+EAPI=8
 
 DESCRIPTION="Manage /usr/bin/pinentry symlink"
 HOMEPAGE="https://www.gentoo.org/proj/en/eselect/"
-SRC_URI=""
 
 LICENSE="GPL-2"
 SLOT="0"
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~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"
-IUSE=""
+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"
 
 RDEPEND=">=app-eselect/eselect-lib-bin-symlink-0.1.1"
 
diff --git a/sdk_container/src/third_party/portage-stable/app-eselect/eselect-pinentry/eselect-pinentry-0.7.2.ebuild b/sdk_container/src/third_party/portage-stable/app-eselect/eselect-pinentry/eselect-pinentry-0.7.2.ebuild
deleted file mode 100644
index a88d776c25e..00000000000
--- a/sdk_container/src/third_party/portage-stable/app-eselect/eselect-pinentry/eselect-pinentry-0.7.2.ebuild
+++ /dev/null
@@ -1,23 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-DESCRIPTION="Manage /usr/bin/pinentry symlink"
-HOMEPAGE="https://www.gentoo.org/proj/en/eselect/"
-SRC_URI=""
-
-LICENSE="GPL-2"
-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"
-IUSE=""
-
-RDEPEND=">=app-eselect/eselect-lib-bin-symlink-0.1.1"
-
-S="${FILESDIR}"
-
-src_install() {
-	default
-	insinto /usr/share/eselect/modules
-	newins pinentry.eselect-${PV} pinentry.eselect
-}
diff --git a/sdk_container/src/third_party/portage-stable/app-eselect/eselect-pinentry/eselect-pinentry-0.7.3.ebuild b/sdk_container/src/third_party/portage-stable/app-eselect/eselect-pinentry/eselect-pinentry-0.7.3.ebuild
new file mode 100644
index 00000000000..d11b66c06bd
--- /dev/null
+++ b/sdk_container/src/third_party/portage-stable/app-eselect/eselect-pinentry/eselect-pinentry-0.7.3.ebuild
@@ -0,0 +1,19 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DESCRIPTION="Manage /usr/bin/pinentry symlink"
+HOMEPAGE="https://wiki.gentoo.org/wiki/Project:Eselect"
+S="${WORKDIR}"
+
+LICENSE="GPL-2"
+SLOT="0"
+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"
+
+RDEPEND=">=app-eselect/eselect-lib-bin-symlink-0.1.1"
+
+src_install() {
+	insinto /usr/share/eselect/modules
+	newins "${FILESDIR}"/pinentry.eselect-${PV} pinentry.eselect
+}
diff --git a/sdk_container/src/third_party/portage-stable/app-eselect/eselect-pinentry/files/pinentry.eselect-0.7.2 b/sdk_container/src/third_party/portage-stable/app-eselect/eselect-pinentry/files/pinentry.eselect-0.7.2
index c445cbf7927..7734fe870b2 100644
--- a/sdk_container/src/third_party/portage-stable/app-eselect/eselect-pinentry/files/pinentry.eselect-0.7.2
+++ b/sdk_container/src/third_party/portage-stable/app-eselect/eselect-pinentry/files/pinentry.eselect-0.7.2
@@ -1,8 +1,8 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 DESCRIPTION="Manage /usr/bin/pinentry implementation"
-MAINTAINER="zlogene@gentoo.org"
+MAINTAINER="maintainer-needed@gentoo.org"
 VERSION="0.7.2"
 
 SYMLINK_PATH=/usr/bin/pinentry
diff --git a/sdk_container/src/third_party/portage-stable/app-eselect/eselect-pinentry/files/pinentry.eselect-0.7.1 b/sdk_container/src/third_party/portage-stable/app-eselect/eselect-pinentry/files/pinentry.eselect-0.7.3
similarity index 50%
rename from sdk_container/src/third_party/portage-stable/app-eselect/eselect-pinentry/files/pinentry.eselect-0.7.1
rename to sdk_container/src/third_party/portage-stable/app-eselect/eselect-pinentry/files/pinentry.eselect-0.7.3
index 77427c45da8..bc058bb41ee 100644
--- a/sdk_container/src/third_party/portage-stable/app-eselect/eselect-pinentry/files/pinentry.eselect-0.7.1
+++ b/sdk_container/src/third_party/portage-stable/app-eselect/eselect-pinentry/files/pinentry.eselect-0.7.3
@@ -1,12 +1,19 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 DESCRIPTION="Manage /usr/bin/pinentry implementation"
-MAINTAINER="zlogene@gentoo.org"
-VERSION="0.7.1"
+MAINTAINER="maintainer-needed@gentoo.org"
+VERSION="0.7.3"
 
 SYMLINK_PATH=/usr/bin/pinentry
-SYMLINK_TARGETS=( pinentry-gnome3 pinentry-qt5 pinentry-curses pinentry-tty )
+SYMLINK_TARGETS=(
+	pinentry-efl
+	pinentry-gnome3
+	pinentry-qt5
+	pinentry-curses
+	pinentry-tty
+	pinentry-emacs
+)
 SYMLINK_DESCRIPTION='pinentry binary'
 
 inherit bin-symlink
diff --git a/sdk_container/src/third_party/portage-stable/app-eselect/eselect-pinentry/metadata.xml b/sdk_container/src/third_party/portage-stable/app-eselect/eselect-pinentry/metadata.xml
index 31a6399a74d..c3bda71eefc 100644
--- a/sdk_container/src/third_party/portage-stable/app-eselect/eselect-pinentry/metadata.xml
+++ b/sdk_container/src/third_party/portage-stable/app-eselect/eselect-pinentry/metadata.xml
@@ -1,9 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
 <pkgmetadata>
-	<maintainer type="person">
-		<email>zlogene@gentoo.org</email>
-		<name>Mikle Kolyada</name>
-	</maintainer>
+	<!-- maintainer-needed -->
 	<stabilize-allarches/>
 </pkgmetadata>

From 30f4d3b3177dea201019b9280a4f0069e3fb23ab Mon Sep 17 00:00:00 2001
From: Krzesimir Nowak <knowak@microsoft.com>
Date: Thu, 7 Dec 2023 16:31:39 +0100
Subject: [PATCH 12/22] app-eselect/eselect-python: Sync with Gentoo

It's from Gentoo commit 77f67752cd0fa1d306b5d82723954ac8dbc6cd6c.
---
 .../app-eselect/eselect-python/Manifest       |  1 -
 .../eselect-python-20190417.ebuild            | 40 ------------------
 .../eselect-python-20200719.ebuild            |  6 +--
 .../eselect-python-99999999.ebuild            | 41 -------------------
 4 files changed, 3 insertions(+), 85 deletions(-)
 delete mode 100644 sdk_container/src/third_party/portage-stable/app-eselect/eselect-python/eselect-python-20190417.ebuild
 delete mode 100644 sdk_container/src/third_party/portage-stable/app-eselect/eselect-python/eselect-python-99999999.ebuild

diff --git a/sdk_container/src/third_party/portage-stable/app-eselect/eselect-python/Manifest b/sdk_container/src/third_party/portage-stable/app-eselect/eselect-python/Manifest
index d56cf26998b..38a0b2da058 100644
--- a/sdk_container/src/third_party/portage-stable/app-eselect/eselect-python/Manifest
+++ b/sdk_container/src/third_party/portage-stable/app-eselect/eselect-python/Manifest
@@ -1,2 +1 @@
-DIST eselect-python-20190417.tar.bz2 46698 BLAKE2B 6f0acad0abb21d8e4768cbeb12f7e871c316a940ebae4c02bdb1336095991cb6b6bf05661ab659115a67f29a09f2a9b57cfb0868019606ed550b5aa1863f6f71 SHA512 a461263a50a29f0493127ee4a027e49ca4d7631e9c8d16cffc8bdb98cc7e75b0796e45e70951d5559fb86f0db14141a3ea6a53bd4cf1e0cc83ed5c7f24173695
 DIST eselect-python-20200719.tar.bz2 47313 BLAKE2B 37270b1f5ad3dfcd4e19c71ae74da585e803afe89c43f8b912bccf0fbdb936916cf58fc780b654692bb9e6ab44310514bae5f10d19dcde6a0e63042f76abe81d SHA512 4b205a099ad079e5e28d3fdbe774c22f54b7c16bff2d28b54d0e20ee36be2339e928d4050eed74ef969d5815bf4bb691bf5ed6e98023b28972da6d5c7d8a2545
diff --git a/sdk_container/src/third_party/portage-stable/app-eselect/eselect-python/eselect-python-20190417.ebuild b/sdk_container/src/third_party/portage-stable/app-eselect/eselect-python/eselect-python-20190417.ebuild
deleted file mode 100644
index 60eab9db536..00000000000
--- a/sdk_container/src/third_party/portage-stable/app-eselect/eselect-python/eselect-python-20190417.ebuild
+++ /dev/null
@@ -1,40 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-if [[ ${PV} == "99999999" ]] ; then
-	inherit autotools git-r3
-	EGIT_REPO_URI="git://anongit.gentoo.org/proj/${PN}.git"
-else
-	SRC_URI="https://dev.gentoo.org/~mgorny/dist/${P}.tar.bz2"
-	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"
-fi
-
-DESCRIPTION="Eselect module for management of multiple Python versions"
-HOMEPAGE="https://wiki.gentoo.org/wiki/Project:Python"
-
-LICENSE="GPL-2"
-SLOT="0"
-IUSE=""
-
-# python-exec-2.4.2 for working -l option
-RDEPEND=">=app-admin/eselect-1.2.3
-	>=dev-lang/python-exec-2.4.2"
-
-src_prepare() {
-	default
-	[[ ${PV} == "99999999" ]] && eautoreconf
-}
-
-pkg_postinst() {
-	local py
-
-	if has_version 'dev-lang/python'; then
-		eselect python update --if-unset
-	fi
-
-	if has_version "=dev-lang/python-3*"; then
-		eselect python update "--python3" --if-unset
-	fi
-}
diff --git a/sdk_container/src/third_party/portage-stable/app-eselect/eselect-python/eselect-python-20200719.ebuild b/sdk_container/src/third_party/portage-stable/app-eselect/eselect-python/eselect-python-20200719.ebuild
index 491fe41f040..ae87dad8cea 100644
--- a/sdk_container/src/third_party/portage-stable/app-eselect/eselect-python/eselect-python-20200719.ebuild
+++ b/sdk_container/src/third_party/portage-stable/app-eselect/eselect-python/eselect-python-20200719.ebuild
@@ -1,14 +1,14 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
 
 if [[ ${PV} == "99999999" ]] ; then
 	inherit autotools git-r3
-	EGIT_REPO_URI="git://anongit.gentoo.org/proj/${PN}.git"
+	EGIT_REPO_URI="https://anongit.gentoo.org/proj/${PN}.git"
 else
 	SRC_URI="https://dev.gentoo.org/~chutzpah/dist/misc/${P}.tar.bz2"
-	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 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x64-solaris"
 fi
 
 DESCRIPTION="Eselect module for management of multiple Python versions"
diff --git a/sdk_container/src/third_party/portage-stable/app-eselect/eselect-python/eselect-python-99999999.ebuild b/sdk_container/src/third_party/portage-stable/app-eselect/eselect-python/eselect-python-99999999.ebuild
deleted file mode 100644
index 85d1f8d7e5d..00000000000
--- a/sdk_container/src/third_party/portage-stable/app-eselect/eselect-python/eselect-python-99999999.ebuild
+++ /dev/null
@@ -1,41 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-if [[ ${PV} == "99999999" ]] ; then
-	inherit autotools git-r3
-	EGIT_REPO_URI="git://anongit.gentoo.org/proj/${PN}.git"
-else
-	SRC_URI="https://dev.gentoo.org/~chutzpah/dist/misc/${P}.tar.bz2"
-	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"
-fi
-
-DESCRIPTION="Eselect module for management of multiple Python versions"
-HOMEPAGE="https://wiki.gentoo.org/wiki/Project:Python"
-
-LICENSE="GPL-2"
-SLOT="0"
-
-# python-exec-2.4.2 for working -l option
-RDEPEND="
-	>=app-admin/eselect-1.2.3
-	>=dev-lang/python-exec-2.4.2
-"
-
-src_prepare() {
-	default
-	[[ ${PV} == "99999999" ]] && eautoreconf
-}
-
-pkg_postinst() {
-	local py
-
-	if has_version 'dev-lang/python'; then
-		eselect python update --if-unset
-	fi
-
-	if has_version "=dev-lang/python-3*"; then
-		eselect python update "--python3" --if-unset
-	fi
-}

From a5599ccc04b14cc697831543f6057bf515c8c2a4 Mon Sep 17 00:00:00 2001
From: Krzesimir Nowak <knowak@microsoft.com>
Date: Thu, 7 Dec 2023 16:31:39 +0100
Subject: [PATCH 13/22] app-eselect/eselect-rust: Sync with Gentoo

It's from Gentoo commit 8637ecd6b2ed31489e757b575a04ef9fa4fb9f05.
---
 .../app-eselect/eselect-rust/Manifest         |  1 -
 .../eselect-rust/eselect-rust-20200419.ebuild | 32 -------------------
 .../eselect-rust/eselect-rust-20210703.ebuild |  4 +--
 3 files changed, 2 insertions(+), 35 deletions(-)
 delete mode 100644 sdk_container/src/third_party/portage-stable/app-eselect/eselect-rust/eselect-rust-20200419.ebuild

diff --git a/sdk_container/src/third_party/portage-stable/app-eselect/eselect-rust/Manifest b/sdk_container/src/third_party/portage-stable/app-eselect/eselect-rust/Manifest
index 15244489dc0..9f2e17b17b4 100644
--- a/sdk_container/src/third_party/portage-stable/app-eselect/eselect-rust/Manifest
+++ b/sdk_container/src/third_party/portage-stable/app-eselect/eselect-rust/Manifest
@@ -1,2 +1 @@
-DIST eselect-rust-20200419.tar.bz2 50278 BLAKE2B 5d5e773a0e0481403e1645cb5fdf642e1ce5d1819e9699a79fcaf822ff3e6f258b2d1958548e00df200d9aaf061be1d3b1773e6b0e92b498fe75316ac13ff235 SHA512 68db32df19864a8365e272946161966b9cb513d7403dd1df7a4c7d87fba3b8bfcad59b407dca7dd6c8e0756f2e5cbde367ade69629eaa78d019d2b524051f741
 DIST eselect-rust-20210703.tar.bz2 4253 BLAKE2B 1d04c00db1794148b6d908c44172b8958f5ae2c7753875675387eea175ce914b7315452923a819d1b77bf22f10493ba9704c70d48388faa080b6af49efccb956 SHA512 b8f4f03f299a8415019746964347dffc5520dfcf79fd9d059bf600f63045ab80f8692509f0358be427c676ce98692ac8342b6f447aef21ce4d7ca048741b5e47
diff --git a/sdk_container/src/third_party/portage-stable/app-eselect/eselect-rust/eselect-rust-20200419.ebuild b/sdk_container/src/third_party/portage-stable/app-eselect/eselect-rust/eselect-rust-20200419.ebuild
deleted file mode 100644
index 2934b8564df..00000000000
--- a/sdk_container/src/third_party/portage-stable/app-eselect/eselect-rust/eselect-rust-20200419.ebuild
+++ /dev/null
@@ -1,32 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="7"
-
-if [[ ${PV} == "99999999" ]] ; then
-	inherit autotools git-r3
-	EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/${PN}.git"
-else
-	SRC_URI="https://dev.gentoo.org/~whissi/dist/${PN}/${P}.tar.bz2"
-	KEYWORDS="amd64 arm arm64 ~ppc ppc64 ~riscv x86"
-fi
-
-DESCRIPTION="Eselect module for management of multiple Rust versions"
-HOMEPAGE="https://wiki.gentoo.org/wiki/Project:Rust"
-
-LICENSE="GPL-2"
-SLOT="0"
-IUSE=""
-
-RDEPEND=">=app-admin/eselect-1.2.3"
-
-src_prepare() {
-	default
-	[[ ${PV} == "99999999" ]] && eautoreconf
-}
-
-pkg_postinst() {
-	if has_version 'dev-lang/rust' || has_version 'dev-lang/rust-bin'; then
-		eselect rust update --if-unset
-	fi
-}
diff --git a/sdk_container/src/third_party/portage-stable/app-eselect/eselect-rust/eselect-rust-20210703.ebuild b/sdk_container/src/third_party/portage-stable/app-eselect/eselect-rust/eselect-rust-20210703.ebuild
index 210ce3086be..efe37338033 100644
--- a/sdk_container/src/third_party/portage-stable/app-eselect/eselect-rust/eselect-rust-20210703.ebuild
+++ b/sdk_container/src/third_party/portage-stable/app-eselect/eselect-rust/eselect-rust-20210703.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"
@@ -9,7 +9,7 @@ if [[ ${PV} == "99999999" ]] ; then
 	EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/${PN}.git"
 else
 	SRC_URI="https://gitweb.gentoo.org/proj/${PN}.git/snapshot/${P}.tar.bz2"
-	KEYWORDS="amd64 arm arm64 ~ppc ppc64 ~riscv x86"
+	KEYWORDS="amd64 arm arm64 ~loong ~mips ppc ppc64 ~riscv ~s390 sparc x86"
 fi
 
 DESCRIPTION="Eselect module for management of multiple Rust versions"

From 6dee947212c7dd93d969a3904497093cae6e7e04 Mon Sep 17 00:00:00 2001
From: Krzesimir Nowak <knowak@microsoft.com>
Date: Thu, 7 Dec 2023 16:31:40 +0100
Subject: [PATCH 14/22] app-eselect/eselect-vi: Sync with Gentoo

It's from Gentoo commit 123f1f2612f9cb64029291f6cba578a3e844a4de.
---
 .../portage-stable/app-eselect/eselect-vi/Manifest |  1 +
 .../app-eselect/eselect-vi/eselect-vi-1.2.ebuild   |  4 ++--
 .../eselect-vi/eselect-vi-20221122.ebuild          | 14 ++++++++++++++
 .../app-eselect/eselect-vi/metadata.xml            |  3 +++
 4 files changed, 20 insertions(+), 2 deletions(-)
 create mode 100644 sdk_container/src/third_party/portage-stable/app-eselect/eselect-vi/eselect-vi-20221122.ebuild

diff --git a/sdk_container/src/third_party/portage-stable/app-eselect/eselect-vi/Manifest b/sdk_container/src/third_party/portage-stable/app-eselect/eselect-vi/Manifest
index c34b57b3cdc..8a67cad740b 100644
--- a/sdk_container/src/third_party/portage-stable/app-eselect/eselect-vi/Manifest
+++ b/sdk_container/src/third_party/portage-stable/app-eselect/eselect-vi/Manifest
@@ -1 +1,2 @@
 DIST eselect-vi-1.2.tar.gz 2078 BLAKE2B 0f78afe201d9db72de005e035fd044435faf76b0027ce570cad09f3b4f0f497631f57107222de5e649c8badc0cbc3172edd1f1600e5b7bee8ba6f78b2ae9277a SHA512 77ec5281a25156d4a6c4b35fb154aa5837e4d2335637ecdb66a75984419439526f2215abe39a4d08e68d8dd3e337f47947f5a8fbf89ae7ecca8631e7dbf50dc5
+DIST eselect-vi-20221122.tar.xz 43764 BLAKE2B fd6eff4d7e6e040ba5c844479148105c869cc36930f186949ba3d23eb0cae3e0dfbdf1faf723124abf7112149dfcfda2ab1e57edbcae8e6d9d4c9de80755392c SHA512 9c3625130d9ae9e888cd93eee989398a6da778d99e3cd50ee4048e5e3676f478bb3ba37a281b3200673cea8792c51f105d93e4a89ecf765fea1b278c8763bee3
diff --git a/sdk_container/src/third_party/portage-stable/app-eselect/eselect-vi/eselect-vi-1.2.ebuild b/sdk_container/src/third_party/portage-stable/app-eselect/eselect-vi/eselect-vi-1.2.ebuild
index d2946d800f9..ab7bb5d684f 100644
--- a/sdk_container/src/third_party/portage-stable/app-eselect/eselect-vi/eselect-vi-1.2.ebuild
+++ b/sdk_container/src/third_party/portage-stable/app-eselect/eselect-vi/eselect-vi-1.2.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
@@ -11,7 +11,7 @@ SRC_URI="https://gitweb.gentoo.org/proj/${PN}.git/snapshot/${P}.tar.gz"
 
 LICENSE="GPL-2"
 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 ~ppc-macos ~x64-macos ~x64-solaris"
 
 RDEPEND="app-admin/eselect"
 
diff --git a/sdk_container/src/third_party/portage-stable/app-eselect/eselect-vi/eselect-vi-20221122.ebuild b/sdk_container/src/third_party/portage-stable/app-eselect/eselect-vi/eselect-vi-20221122.ebuild
new file mode 100644
index 00000000000..80a869db156
--- /dev/null
+++ b/sdk_container/src/third_party/portage-stable/app-eselect/eselect-vi/eselect-vi-20221122.ebuild
@@ -0,0 +1,14 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DESCRIPTION="Manages the /usr/bin/vi symlink"
+HOMEPAGE="https://wiki.gentoo.org/wiki/Project:Vim"
+SRC_URI="https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+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"
+
+RDEPEND="app-admin/eselect"
diff --git a/sdk_container/src/third_party/portage-stable/app-eselect/eselect-vi/metadata.xml b/sdk_container/src/third_party/portage-stable/app-eselect/eselect-vi/metadata.xml
index f8a2bb7497f..173316bf850 100644
--- a/sdk_container/src/third_party/portage-stable/app-eselect/eselect-vi/metadata.xml
+++ b/sdk_container/src/third_party/portage-stable/app-eselect/eselect-vi/metadata.xml
@@ -6,4 +6,7 @@
 		<name>Gentoo Vim Project</name>
 	</maintainer>
 	<stabilize-allarches/>
+	<upstream>
+		<remote-id type="gentoo">proj/eselect-vi</remote-id>
+	</upstream>
 </pkgmetadata>

From 742e9973d52082f10275b0b9b1c30b203053fd28 Mon Sep 17 00:00:00 2001
From: Krzesimir Nowak <knowak@microsoft.com>
Date: Thu, 7 Dec 2023 16:31:40 +0100
Subject: [PATCH 15/22] app-misc/jq: Sync with Gentoo

It's from Gentoo commit 79d039542c3c53925c72db7a58db0cf06f33faae.
---
 .../portage-stable/app-misc/jq/Manifest       |  3 +-
 .../app-misc/jq/files/jq-1.6-runpath.patch    | 17 ----
 .../jq/files/jq-1.6-segfault-fix.patch        | 22 ------
 .../jq/files/jq-1.7-visible-null.patch        | 41 ----------
 .../app-misc/jq/files/jq-1.7-warnings.patch   | 44 -----------
 .../jq-1.7_pre20201109-no-git-bdep.patch      | 13 ----
 .../app-misc/jq/jq-1.6-r3.ebuild              | 78 -------------------
 ...q-1.7_pre20201109.ebuild => jq-1.7.ebuild} | 29 ++++---
 .../portage-stable/app-misc/jq/metadata.xml   |  4 +-
 9 files changed, 16 insertions(+), 235 deletions(-)
 delete mode 100644 sdk_container/src/third_party/portage-stable/app-misc/jq/files/jq-1.6-runpath.patch
 delete mode 100644 sdk_container/src/third_party/portage-stable/app-misc/jq/files/jq-1.6-segfault-fix.patch
 delete mode 100644 sdk_container/src/third_party/portage-stable/app-misc/jq/files/jq-1.7-visible-null.patch
 delete mode 100644 sdk_container/src/third_party/portage-stable/app-misc/jq/files/jq-1.7-warnings.patch
 delete mode 100644 sdk_container/src/third_party/portage-stable/app-misc/jq/files/jq-1.7_pre20201109-no-git-bdep.patch
 delete mode 100644 sdk_container/src/third_party/portage-stable/app-misc/jq/jq-1.6-r3.ebuild
 rename sdk_container/src/third_party/portage-stable/app-misc/jq/{jq-1.7_pre20201109.ebuild => jq-1.7.ebuild} (68%)

diff --git a/sdk_container/src/third_party/portage-stable/app-misc/jq/Manifest b/sdk_container/src/third_party/portage-stable/app-misc/jq/Manifest
index 160ab21536e..71d260f19bc 100644
--- a/sdk_container/src/third_party/portage-stable/app-misc/jq/Manifest
+++ b/sdk_container/src/third_party/portage-stable/app-misc/jq/Manifest
@@ -1,2 +1 @@
-DIST jq-1.6.tar.gz 1750584 BLAKE2B c9be1314e9d027247de63492ee362e996ef85faf45a47ee421cad95ebde9188bff8d3fc7db64e717ab922e1052f3b1c1500f5589fc5b2199ab66effb000e442d SHA512 5da71f53c325257f1f546a2520fe47828b495c953270df25ea0e37741463fdda72f0ba4d5b05b25114ec30f27a559344c2b024bacabf610759f4e3e9efadb480
-DIST jq-1.7_pre20201109.tar.gz 1181867 BLAKE2B 9db187ab927b635c43fbc6191aeffa00451b12253ae023bbabe6fba5fdf8fb393f8450ee2011ef58cb93e2f27994d454fac967984a721439aaac93259c02f7f1 SHA512 f2997d70edb36d0a23b71a7d933a763cedd7c74ffa3129c2a6cb7189aaff1c5095cdc51062b7cd119324ec2c83ebae6ff0b7da3941315303b7a31146b9eb285a
+DIST jq-1.7.gh.tar.gz 1267139 BLAKE2B b6a54f9beaabd7915d7a8f14cda9621573f1796af53fe1645561a7a199787a7e9b2b2df038208f23e63f339dec567851b70696ffb8194986250527333d36d44e SHA512 01676319fe98d5ab1e278430b2c58ec594191cc9485a20312d658c0e199ac7ea5f5e934817ce98da0864ec7e0a018aae9b87525260e8ab6a7bde918db483bd84
diff --git a/sdk_container/src/third_party/portage-stable/app-misc/jq/files/jq-1.6-runpath.patch b/sdk_container/src/third_party/portage-stable/app-misc/jq/files/jq-1.6-runpath.patch
deleted file mode 100644
index 40a2ed02f3d..00000000000
--- a/sdk_container/src/third_party/portage-stable/app-misc/jq/files/jq-1.6-runpath.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-diff --git a/configure.ac b/configure.ac
-index 280694c..7227c9d 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -280,4 +280,11 @@ AC_SUBST([BUNDLER], ["$bundle_cmd"])
- AC_CONFIG_MACRO_DIR([config/m4])
- AC_CONFIG_FILES([Makefile])
- AC_OUTPUT
--
-+AC_ARG_ENABLE([rpathhack],
-+	[AC_HELP_STRING([--enable-rpathhack], [patch libtool to remove RPATH])],
-+	[
-+AC_MSG_RESULT([patching libtool to fix rpath])
-+sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
-+sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
-+	],
-+	[])
diff --git a/sdk_container/src/third_party/portage-stable/app-misc/jq/files/jq-1.6-segfault-fix.patch b/sdk_container/src/third_party/portage-stable/app-misc/jq/files/jq-1.6-segfault-fix.patch
deleted file mode 100644
index 8eb7d456bc6..00000000000
--- a/sdk_container/src/third_party/portage-stable/app-misc/jq/files/jq-1.6-segfault-fix.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-From a1f1231a73c221155d539a281181ef37f874869d Mon Sep 17 00:00:00 2001
-From: William Langford <wlangfor@gmail.com>
-Date: Tue, 20 Nov 2018 09:58:25 -0500
-Subject: [PATCH] Add missing jv_copy when printing with -ar
-
----
- src/main.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/main.c b/src/main.c
-index b154689e..61ae43f9 100644
---- a/src/main.c
-+++ b/src/main.c
-@@ -168,7 +168,7 @@ static int process(jq_state *jq, jv value, int flags, int dumpopts) {
-   while (jv_is_valid(result = jq_next(jq))) {
-     if ((options & RAW_OUTPUT) && jv_get_kind(result) == JV_KIND_STRING) {
-       if (options & ASCII_OUTPUT) {
--        jv_dumpf(result, stdout, JV_PRINT_ASCII);
-+        jv_dumpf(jv_copy(result), stdout, JV_PRINT_ASCII);
-       } else {
-         fwrite(jv_string_value(result), 1, jv_string_length_bytes(jv_copy(result)), stdout);
-       }
diff --git a/sdk_container/src/third_party/portage-stable/app-misc/jq/files/jq-1.7-visible-null.patch b/sdk_container/src/third_party/portage-stable/app-misc/jq/files/jq-1.7-visible-null.patch
deleted file mode 100644
index 41e55df7211..00000000000
--- a/sdk_container/src/third_party/portage-stable/app-misc/jq/files/jq-1.7-visible-null.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-diff --git a/src/jv_print.c b/src/jv_print.c
-index 2e781bb..e621b31 100644
---- a/src/jv_print.c
-+++ b/src/jv_print.c
-@@ -32,7 +32,7 @@ static const jv_kind color_kinds[] =
- static char color_bufs[sizeof(color_kinds)/sizeof(color_kinds[0])][16];
- static const char *color_bufps[8];
- static const char* def_colors[] =
--  {COL("1;30"),    COL("0;37"),      COL("0;37"),     COL("0;37"),
-+  {COL("1;90"),    COL("0;37"),      COL("0;37"),     COL("0;37"),
-    COL("0;32"),      COL("1;37"),     COL("1;37")};
- #define FIELD_COLOR COL("34;1")
- 
-diff --git a/tests/shtest b/tests/shtest
-index 8ed62b2..2d3f0da 100755
---- a/tests/shtest
-+++ b/tests/shtest
-@@ -280,12 +280,12 @@ fi
- 
- # Check $JQ_COLORS
- $JQ -Ccn . > $d/color
--printf '\033[1;30mnull\033[0m\n' > $d/expect
-+printf '\033[1;90mnull\033[0m\n' > $d/expect
- cmp $d/color $d/expect
- JQ_COLORS='4;31' $JQ -Ccn . > $d/color
- printf '\033[4;31mnull\033[0m\n' > $d/expect
- cmp $d/color $d/expect
--JQ_COLORS='1;30:0;31:0;32:0;33:0;34:1;35:1;36' \
-+JQ_COLORS='1;90:0;31:0;32:0;33:0;34:1;35:1;36' \
-   $JQ -Ccn '[{"a":true,"b":false},123,null]' > $d/color
- (
- printf '\033[1;35m[\033[1;36m{'
-@@ -298,7 +298,7 @@ printf '[0m\033[0;31mfalse\033'
- printf '[0m\033[1;36m\033[1;36'
- printf 'm}\033[0m\033[1;35m,\033['
- printf '0;33m123\033[0m\033[1;'
--printf '35m,\033[1;30mnull\033'
-+printf '35m,\033[1;90mnull\033'
- printf '[0m\033[1;35m\033[1;35'
- printf 'm]\033[0m\n'
- ) > $d/expect
diff --git a/sdk_container/src/third_party/portage-stable/app-misc/jq/files/jq-1.7-warnings.patch b/sdk_container/src/third_party/portage-stable/app-misc/jq/files/jq-1.7-warnings.patch
deleted file mode 100644
index 0047ca391ca..00000000000
--- a/sdk_container/src/third_party/portage-stable/app-misc/jq/files/jq-1.7-warnings.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-diff --git a/src/builtin.c b/src/builtin.c
-index bf80c7b..12db573 100644
---- a/src/builtin.c
-+++ b/src/builtin.c
-@@ -1,5 +1,6 @@
- #define _BSD_SOURCE
- #define _GNU_SOURCE
-+#define _DEFAULT_SOURCE
- #ifndef __sun__
- # define _XOPEN_SOURCE
- # define _XOPEN_SOURCE_EXTENDED 1
-diff --git a/src/jv_dtoa.c b/src/jv_dtoa.c
-index 33feb99..fcbd902 100644
---- a/src/jv_dtoa.c
-+++ b/src/jv_dtoa.c
-@@ -2327,7 +2327,7 @@ retlow1:
- jvp_strtod
-  (struct dtoa_context* C, const char *s00, char **se)
- {
--	int bb2, bb5, bbe, bd2, bd5, bbbits, bs2, c, e, e1, test_scale;
-+	int bb2, bb5, bbe, bd2, bd5, bbbits, bs2, c, e, e1;
- 	int esign, i, j, k, nd, nd0, nf, nz, nz0, nz1, sign;
- 	CONST char *s, *s0, *s1;
- 	double aadj, aadj1;
-diff --git a/src/jv_dtoa_tsd.c b/src/jv_dtoa_tsd.c
-index 0f95df4..e5209dd 100644
---- a/src/jv_dtoa_tsd.c
-+++ b/src/jv_dtoa_tsd.c
-@@ -24,7 +24,7 @@ static void tsd_dtoa_ctx_fini() {
- }
- 
- static void tsd_dtoa_ctx_init() {
--  if (pthread_key_create(&dtoa_ctx_key, tsd_dtoa_ctx_dtor) != 0) {
-+  if (pthread_key_create(&dtoa_ctx_key, (void (*)(void *))tsd_dtoa_ctx_dtor) != 0) {
-     fprintf(stderr, "error: cannot create thread specific key");
-     abort();
-   }
-@@ -43,4 +43,4 @@ inline struct dtoa_context *tsd_dtoa_context_get() {
-     }
-   }
-   return ctx;
--}
-\ No newline at end of file
-+}
diff --git a/sdk_container/src/third_party/portage-stable/app-misc/jq/files/jq-1.7_pre20201109-no-git-bdep.patch b/sdk_container/src/third_party/portage-stable/app-misc/jq/files/jq-1.7_pre20201109-no-git-bdep.patch
deleted file mode 100644
index 726624df13d..00000000000
--- a/sdk_container/src/third_party/portage-stable/app-misc/jq/files/jq-1.7_pre20201109-no-git-bdep.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/configure.ac b/configure.ac
-index 0441d4a..592ceb9 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -1,8 +1,3 @@
--m4_define([jq_version],
--          m4_esyscmd_s([(git rev-parse --verify -q jq-1.0 > /dev/null &&
--                        (git describe --tags --dirty --match 'jq-*'|sed 's/^jq-//')) ||
--                        echo `git rev-parse --abbrev-ref HEAD`-`git describe --always --dirty`])))
--
- AC_INIT([jq], [jq_version], [https://github.com/stedolan/jq/issues],
-              [jq], [https://stedolan.github.io/jq])
- 
diff --git a/sdk_container/src/third_party/portage-stable/app-misc/jq/jq-1.6-r3.ebuild b/sdk_container/src/third_party/portage-stable/app-misc/jq/jq-1.6-r3.ebuild
deleted file mode 100644
index f1172ab62ab..00000000000
--- a/sdk_container/src/third_party/portage-stable/app-misc/jq/jq-1.6-r3.ebuild
+++ /dev/null
@@ -1,78 +0,0 @@
-# Copyright 1999-2019 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit autotools
-
-DESCRIPTION="A lightweight and flexible command-line JSON processor"
-HOMEPAGE="https://stedolan.github.io/jq/"
-SRC_URI="https://github.com/stedolan/jq/releases/download/${P}/${P}.tar.gz"
-
-LICENSE="MIT CC-BY-3.0"
-SLOT="0"
-KEYWORDS="~alpha amd64 ~arm ~arm64 ~ia64 ~ppc ~ppc64 x86 ~amd64-linux ~x64-macos"
-IUSE="oniguruma static-libs"
-
-ONIGURUMA_MINPV='>=dev-libs/oniguruma-6.1.3' # Keep this in sync with bundled modules/oniguruma/
-DEPEND="
-	>=sys-devel/bison-3.0
-	sys-devel/flex
-	oniguruma? ( ${ONIGURUMA_MINPV}:=[static-libs?] )
-"
-RDEPEND="
-	!static-libs? (
-		oniguruma? ( ${ONIGURUMA_MINPV}[static-libs?] )
-	)
-"
-
-src_prepare() {
-	local PATCHES=(
-		"${FILESDIR}"/jq-1.6-r3-never-bundle-oniguruma.patch
-		"${FILESDIR}"/jq-1.6-runpath.patch
-		"${FILESDIR}"/jq-1.6-segfault-fix.patch
-	)
-	use oniguruma || { sed -i 's:tests/onigtest::' Makefile.am || die; }
-	sed -i '/^dist_doc_DATA/d' Makefile.am || die
-	sed -i -r "s:(m4_define\(\[jq_version\],) .+\):\1 \[${PV}\]):" \
-		configure.ac || die
-
-	# jq-1.6-r3-never-bundle-oniguruma makes sure we build with the system oniguruma,
-	# but the bundled copy of oniguruma still gets eautoreconf'd since it
-	# exists; save the cycles by nuking it.
-	sed -i -e '/modules\/oniguruma/d' Makefile.am || die
-	rm -rf "${S}"/modules/oniguruma || die
-
-	default
-	eautoreconf
-}
-
-src_configure() {
-	local econfargs=(
-		# don't try to rebuild docs
-		--disable-docs
-		--disable-valgrind
-		--disable-maintainer-mode
-		--enable-rpathhack
-		$(use_enable static-libs static)
-		$(use_with oniguruma oniguruma yes)
-	)
-	econf "${econfargs[@]}"
-}
-
-src_test() {
-	if ! emake check; then
-		if [[ -r test-suite.log ]]; then
-			eerror "Tests failed, outputting testsuite log"
-			cat test-suite.log
-		fi
-		die "Tests failed"
-	fi
-}
-
-src_install() {
-	local DOCS=( AUTHORS README.md )
-	default
-
-	use static-libs || { find "${D}" -name '*.la' -delete || die; }
-}
diff --git a/sdk_container/src/third_party/portage-stable/app-misc/jq/jq-1.7_pre20201109.ebuild b/sdk_container/src/third_party/portage-stable/app-misc/jq/jq-1.7.ebuild
similarity index 68%
rename from sdk_container/src/third_party/portage-stable/app-misc/jq/jq-1.7_pre20201109.ebuild
rename to sdk_container/src/third_party/portage-stable/app-misc/jq/jq-1.7.ebuild
index 62a69454eb2..e2afba51c23 100644
--- a/sdk_container/src/third_party/portage-stable/app-misc/jq/jq-1.7_pre20201109.ebuild
+++ b/sdk_container/src/third_party/portage-stable/app-misc/jq/jq-1.7.ebuild
@@ -1,24 +1,23 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=7
+EAPI=8
 
 inherit autotools
 
-COMMIT_HASH="a17dd3248a666d01be75f6b16be37e80e20b0954"
-
+MY_PV="${PV/_/}"
+MY_P="${PN}-${MY_PV}"
 DESCRIPTION="A lightweight and flexible command-line JSON processor"
 HOMEPAGE="https://stedolan.github.io/jq/"
-#SRC_URI="https://github.com/stedolan/jq/releases/download/${P}/${P}.tar.gz"
-SRC_URI="https://github.com/stedolan/jq/archive/${COMMIT_HASH}.tar.gz -> ${P}.tar.gz"
-S="${WORKDIR}/${PN}-${COMMIT_HASH}"
+SRC_URI="https://github.com/jqlang/jq/archive/refs/tags/${MY_P}.tar.gz -> ${P}.gh.tar.gz"
+S="${WORKDIR}/${PN}-${MY_P}"
 
 LICENSE="MIT CC-BY-3.0"
 SLOT="0"
-KEYWORDS="~alpha amd64 ~arm arm64 ~ia64 ~ppc ppc64 ~riscv x86 ~amd64-linux ~x64-macos"
+KEYWORDS="~alpha amd64 ~arm arm64 ~ia64 ~loong ~ppc ppc64 ~riscv ~sparc x86 ~amd64-linux ~arm64-macos ~x64-macos ~x64-solaris"
 IUSE="+oniguruma static-libs test"
 
-ONIGURUMA_MINPV='>=dev-libs/oniguruma-6.1.3' # Keep this in sync with bundled modules/oniguruma/
+ONIGURUMA_MINPV='>=dev-libs/oniguruma-6.9.3' # Keep this in sync with bundled modules/oniguruma/
 DEPEND="
 	>=sys-devel/bison-3.0
 	sys-devel/flex
@@ -32,10 +31,6 @@ RDEPEND="
 PATCHES=(
 	"${FILESDIR}"/jq-1.6-r3-never-bundle-oniguruma.patch
 	"${FILESDIR}"/jq-1.7-runpath.patch
-	"${FILESDIR}"/jq-1.7-warnings.patch
-	"${FILESDIR}"/jq-1.7-visible-null.patch
-	# https://bugs.gentoo.org/776385
-	"${FILESDIR}"/jq-1.7_pre20201109-no-git-bdep.patch
 )
 
 RESTRICT="!test? ( test )"
@@ -43,8 +38,7 @@ REQUIRED_USE="test? ( oniguruma )"
 
 src_prepare() {
 	sed -e '/^dist_doc_DATA/d; s:-Wextra ::' -i Makefile.am || die
-	sed -r -e "s:(m4_define\(\[jq_version\],) .+\):\1 \[${PV}\]):" \
-		-i configure.ac || die
+	printf "#!/bin/sh\\nprintf '%s'\\n\n" "${MY_PV}" > scripts/version || die
 
 	# jq-1.6-r3-never-bundle-oniguruma makes sure we build with the system oniguruma,
 	# but the bundled copy of oniguruma still gets eautoreconf'd since it
@@ -53,6 +47,9 @@ src_prepare() {
 	rm -rf "${S}"/modules/oniguruma || die
 
 	default
+
+	sed -i "s/\[jq_version\]/[${MY_PV}]/" configure.ac || die
+
 	eautoreconf
 }
 
@@ -80,7 +77,7 @@ src_test() {
 }
 
 src_install() {
-	local DOCS=( AUTHORS NEWS README.md )
+	local DOCS=( AUTHORS NEWS.md README.md SECURITY.md )
 	default
 
 	use static-libs || { find "${D}" -name '*.la' -delete || die; }
diff --git a/sdk_container/src/third_party/portage-stable/app-misc/jq/metadata.xml b/sdk_container/src/third_party/portage-stable/app-misc/jq/metadata.xml
index e0cbe69287e..c62cb69977a 100644
--- a/sdk_container/src/third_party/portage-stable/app-misc/jq/metadata.xml
+++ b/sdk_container/src/third_party/portage-stable/app-misc/jq/metadata.xml
@@ -10,10 +10,10 @@
 		<name>Patrick McLean</name>
 	</maintainer>
 	<use>
-		<flag name="oniguruma">Use dev-libs/oniguruma for regular expression support</flag>
+		<flag name="oniguruma">Use <pkg>dev-libs/oniguruma</pkg> for regular expression support</flag>
 	</use>
 	<upstream>
 		<remote-id type="cpe">cpe:/a:jq_project:jq</remote-id>
-		<remote-id type="github">stedolan/jq</remote-id>
+		<remote-id type="github">jqlang/jq</remote-id>
 	</upstream>
 </pkgmetadata>

From 0eb5b1046e41cb56f61e1bceadc5470ace966f3b Mon Sep 17 00:00:00 2001
From: Krzesimir Nowak <knowak@microsoft.com>
Date: Thu, 7 Dec 2023 16:31:41 +0100
Subject: [PATCH 16/22] app-misc/zisofs-tools: Sync with Gentoo

It's from Gentoo commit a90b7d3dd874a0384525aa1a57a70b3043a85bc1.
---
 ....8.ebuild => zisofs-tools-1.0.8-r1.ebuild} | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)
 rename sdk_container/src/third_party/portage-stable/app-misc/zisofs-tools/{zisofs-tools-1.0.8.ebuild => zisofs-tools-1.0.8-r1.ebuild} (53%)

diff --git a/sdk_container/src/third_party/portage-stable/app-misc/zisofs-tools/zisofs-tools-1.0.8.ebuild b/sdk_container/src/third_party/portage-stable/app-misc/zisofs-tools/zisofs-tools-1.0.8-r1.ebuild
similarity index 53%
rename from sdk_container/src/third_party/portage-stable/app-misc/zisofs-tools/zisofs-tools-1.0.8.ebuild
rename to sdk_container/src/third_party/portage-stable/app-misc/zisofs-tools/zisofs-tools-1.0.8-r1.ebuild
index f5604a4dac3..6e7e459dbbe 100644
--- a/sdk_container/src/third_party/portage-stable/app-misc/zisofs-tools/zisofs-tools-1.0.8.ebuild
+++ b/sdk_container/src/third_party/portage-stable/app-misc/zisofs-tools/zisofs-tools-1.0.8-r1.ebuild
@@ -1,8 +1,9 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=7
-inherit flag-o-matic
+EAPI=8
+
+inherit autotools flag-o-matic
 
 DESCRIPTION="User utilities for zisofs"
 HOMEPAGE="https://www.kernel.org/pub/linux/utils/fs/zisofs/"
@@ -10,12 +11,20 @@ SRC_URI="mirror://gentoo/${P}.tar.bz2"
 
 LICENSE="GPL-2"
 SLOT="0"
-KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos"
+KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos"
 IUSE="static"
 
-RDEPEND=">=sys-libs/zlib-1.1.4:0="
+RDEPEND=">=sys-libs/zlib-1.1.4:="
 DEPEND="${RDEPEND}"
 
+src_prepare() {
+	default
+
+	# Clang 16
+	sed -i -e 's:configure.in:configure.ac:' Makefile || die
+	eautoreconf
+}
+
 src_configure() {
 	use static && append-ldflags -static
 	default

From ce2234d4bc4ec634368f7e2cba92f6d07c53f677 Mon Sep 17 00:00:00 2001
From: Krzesimir Nowak <knowak@microsoft.com>
Date: Thu, 7 Dec 2023 16:31:41 +0100
Subject: [PATCH 17/22] app-shells/gentoo-bashcomp: Sync with Gentoo

It's from Gentoo commit 05ba09b8287082b6d88be1b6cb4c5335d55ebf10.
---
 .../portage-stable/app-shells/gentoo-bashcomp/Manifest   | 2 +-
 ...0190211.ebuild => gentoo-bashcomp-20190211-r1.ebuild} | 6 +++---
 ...p-20180302.ebuild => gentoo-bashcomp-20230313.ebuild} | 9 ++++-----
 3 files changed, 8 insertions(+), 9 deletions(-)
 rename sdk_container/src/third_party/portage-stable/app-shells/gentoo-bashcomp/{gentoo-bashcomp-20190211.ebuild => gentoo-bashcomp-20190211-r1.ebuild} (71%)
 rename sdk_container/src/third_party/portage-stable/app-shells/gentoo-bashcomp/{gentoo-bashcomp-20180302.ebuild => gentoo-bashcomp-20230313.ebuild} (64%)

diff --git a/sdk_container/src/third_party/portage-stable/app-shells/gentoo-bashcomp/Manifest b/sdk_container/src/third_party/portage-stable/app-shells/gentoo-bashcomp/Manifest
index d4cd8562721..780576961c4 100644
--- a/sdk_container/src/third_party/portage-stable/app-shells/gentoo-bashcomp/Manifest
+++ b/sdk_container/src/third_party/portage-stable/app-shells/gentoo-bashcomp/Manifest
@@ -1,2 +1,2 @@
-DIST gentoo-bashcomp-20180302.tar.bz2 21485 BLAKE2B 887ac5cfa8c6ba431a6aa5f5918b8bdfbe6a1ae9a2e7ac21b3c06ec2062b448d924f928b1372e81749ece6d4aa673bbbaaa364ca744124c842e3819349917169 SHA512 6b4551b078505e6348cb10ca2d67faab4d323a0f0ddefc872145314303d6f95fe31f9706d43d9f20c0139610ce47e4cf70ba7516d911dc4927cfbf5d863bc063
 DIST gentoo-bashcomp-20190211.tar.bz2 21508 BLAKE2B 410994819f62b0bd105ca398c335d76993fd694b8e7f56c761b94fc1e2f6e90f2010f2f2a88febd71ac0c5643fc0e923c60151fbf9411e8a553b5917d6bcd8db SHA512 4b0a5e79f90ee8122fa8d0a7224fee6472b1762a0dda680ea1c0e8d4069760be9b6472e052b1b166a389c0e779816b98715386dbc62a3574e7ad851b2567a070
+DIST gentoo-bashcomp-20230313.tar.bz2 21536 BLAKE2B 5dc47aecf68fc19c177026582d98b441d09a15bf0f9e618533c62a37b7986ab6d619f2873b58697f484830bbe88e7697755bb7ee14fb8c55be12e7296e1acfec SHA512 482bf1444e76da544bfbab727f9016abcc82ed4283e31e7ad1e1d302cfe67edfc55cdc37871ae53c09e4e3ce5a5e20dd5f8994ec60e1698076bc81659a2fa3b0
diff --git a/sdk_container/src/third_party/portage-stable/app-shells/gentoo-bashcomp/gentoo-bashcomp-20190211.ebuild b/sdk_container/src/third_party/portage-stable/app-shells/gentoo-bashcomp/gentoo-bashcomp-20190211-r1.ebuild
similarity index 71%
rename from sdk_container/src/third_party/portage-stable/app-shells/gentoo-bashcomp/gentoo-bashcomp-20190211.ebuild
rename to sdk_container/src/third_party/portage-stable/app-shells/gentoo-bashcomp/gentoo-bashcomp-20190211-r1.ebuild
index 6c802bbf31f..ea57924b974 100644
--- a/sdk_container/src/third_party/portage-stable/app-shells/gentoo-bashcomp/gentoo-bashcomp-20190211.ebuild
+++ b/sdk_container/src/third_party/portage-stable/app-shells/gentoo-bashcomp/gentoo-bashcomp-20190211-r1.ebuild
@@ -1,7 +1,7 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=6
+EAPI=8
 
 inherit bash-completion-r1
 
@@ -11,7 +11,7 @@ SRC_URI="https://gitweb.gentoo.org/proj/${PN}.git/snapshot/${P}.tar.bz2"
 
 LICENSE="GPL-2"
 SLOT="0"
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris"
+KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos"
 
 src_install() {
 	emake DESTDIR="${D}" install \
diff --git a/sdk_container/src/third_party/portage-stable/app-shells/gentoo-bashcomp/gentoo-bashcomp-20180302.ebuild b/sdk_container/src/third_party/portage-stable/app-shells/gentoo-bashcomp/gentoo-bashcomp-20230313.ebuild
similarity index 64%
rename from sdk_container/src/third_party/portage-stable/app-shells/gentoo-bashcomp/gentoo-bashcomp-20180302.ebuild
rename to sdk_container/src/third_party/portage-stable/app-shells/gentoo-bashcomp/gentoo-bashcomp-20230313.ebuild
index 64f152cbe4f..da8506a4999 100644
--- a/sdk_container/src/third_party/portage-stable/app-shells/gentoo-bashcomp/gentoo-bashcomp-20180302.ebuild
+++ b/sdk_container/src/third_party/portage-stable/app-shells/gentoo-bashcomp/gentoo-bashcomp-20230313.ebuild
@@ -1,18 +1,17 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=6
+EAPI=8
 
 inherit bash-completion-r1
 
 DESCRIPTION="Gentoo-specific bash command-line completions (emerge, ebuild, equery, etc)"
-HOMEPAGE="https://wiki.gentoo.org/wiki/No_homepage"
+HOMEPAGE="https://gitweb.gentoo.org/proj/gentoo-bashcomp.git/"
 SRC_URI="https://gitweb.gentoo.org/proj/${PN}.git/snapshot/${P}.tar.bz2"
 
 LICENSE="GPL-2"
 SLOT="0"
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris"
-IUSE=""
+KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos"
 
 src_install() {
 	emake DESTDIR="${D}" install \

From ec301fa58115e720267d4b28d5b80c9f6ad80f55 Mon Sep 17 00:00:00 2001
From: Krzesimir Nowak <knowak@microsoft.com>
Date: Thu, 7 Dec 2023 16:31:42 +0100
Subject: [PATCH 18/22] app-text/xmlto: Sync with Gentoo

It's from Gentoo commit 6545573120c2238469c76b383358f507bfab6e58.
---
 .../files/xmlto-0.0.28-fix-warnings.patch     | 116 ++++++++++++++++++
 ...0.28-r6.ebuild => xmlto-0.0.28-r11.ebuild} |  24 ++--
 .../app-text/xmlto/xmlto-0.0.28-r8.ebuild     |  53 --------
 3 files changed, 132 insertions(+), 61 deletions(-)
 create mode 100644 sdk_container/src/third_party/portage-stable/app-text/xmlto/files/xmlto-0.0.28-fix-warnings.patch
 rename sdk_container/src/third_party/portage-stable/app-text/xmlto/{xmlto-0.0.28-r6.ebuild => xmlto-0.0.28-r11.ebuild} (63%)
 delete mode 100644 sdk_container/src/third_party/portage-stable/app-text/xmlto/xmlto-0.0.28-r8.ebuild

diff --git a/sdk_container/src/third_party/portage-stable/app-text/xmlto/files/xmlto-0.0.28-fix-warnings.patch b/sdk_container/src/third_party/portage-stable/app-text/xmlto/files/xmlto-0.0.28-fix-warnings.patch
new file mode 100644
index 00000000000..b90eea1f42d
--- /dev/null
+++ b/sdk_container/src/third_party/portage-stable/app-text/xmlto/files/xmlto-0.0.28-fix-warnings.patch
@@ -0,0 +1,116 @@
+https://bugs.gentoo.org/869080
+
+https://pagure.io/xmlto/c/1375e2df75530cd198bd16ac3de38e2b0d126276?branch=master
+https://pagure.io/xmlto/c/412f97cdc00d2bbf7e8121012b49fc07b3fe3d2b?branch=master
+https://pagure.io/xmlto/c/8e34f087bf410bcc5fe445933d6ad9bae54f24b5?branch=master
+https://pagure.io/xmlto/c/6fa6a0e07644f20abf2596f78a60112713e11cbe?branch=master
+
+From 1375e2df75530cd198bd16ac3de38e2b0d126276 Mon Sep 17 00:00:00 2001
+From: Thomas Kuehne <thomas@kuehne.cn>
+Date: Dec 11 2021 20:45:45 +0000
+Subject: fix -Wimplicit-int for ifsense
+
+
+fixes:
+xmlif/xmlif.l:46:8: warning: type defaults to ‘int’ in declaration of ‘ifsense’ [-Wimplicit-int]
+   46 | static ifsense;                 /* sense of last `if' or unless seen */
+      |        ^~~~~~~
+
+Signed-off-by: Thomas Kuehne <thomas@kuehne.cn>
+
+--- a/xmlif/xmlif.l
++++ b/xmlif/xmlif.l
+@@ -43,7 +43,7 @@
+ 
+ static char **selections;	/* selection tokens */
+ static int nselections;		/* number of selections */
+-static ifsense;			/* sense of last `if' or unless seen */
++static int ifsense;		/* sense of last `if' or unless seen */
+ static char *attribute;		/* last attribute scanned */
+ 
+ struct stack_t {
+
+
+From 412f97cdc00d2bbf7e8121012b49fc07b3fe3d2b Mon Sep 17 00:00:00 2001
+From: Thomas Kuehne <thomas@kuehne.cn>
+Date: Dec 11 2021 20:45:59 +0000
+Subject: fix extra ‘;’ outside of a function
+
+
+Fixes:
+xmlif/xmlif.l:240:24: warning: ISO C does not allow extra ‘;’ outside of a function [-Wpedantic]
+  240 | int yywrap() {exit(0);};
+      |                        ^
+
+Signed-off-by: Thomas Kuehne <thomas@kuehne.cn>
+
+--- a/xmlif/xmlif.l
++++ b/xmlif/xmlif.l
+@@ -237,7 +237,7 @@ WS		[ \t\n]*
+ 
+ #include "config.h"
+ 
+-int yywrap() {exit(0);};
++int yywrap() {exit(0);}
+ 
+ main(int argc, char *argv[])
+ {
+
+
+From 8e34f087bf410bcc5fe445933d6ad9bae54f24b5 Mon Sep 17 00:00:00 2001
+From: Thomas Kuehne <thomas@kuehne.cn>
+Date: Dec 11 2021 20:56:00 +0000
+Subject: Fix return type of main function
+
+
+Fixes:
+xmlif/xmlif.l:242:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
+  242 | main(int argc, char *argv[])
+      | ^~~~
+
+Signed-off-by: Thomas Kuehne <thomas@kuehne.cn>
+
+--- a/xmlif/xmlif.l
++++ b/xmlif/xmlif.l
+@@ -239,7 +239,7 @@ WS		[ \t\n]*
+ 
+ int yywrap() {exit(0);}
+ 
+-main(int argc, char *argv[])
++int main(int argc, char *argv[])
+ {
+     int i;
+ 
+@@ -265,7 +265,7 @@ main(int argc, char *argv[])
+ 	    exit(1);
+ 	}
+ 
+-    yylex();
++    return yylex();
+ }
+ 
+ /*
+
+From 6fa6a0e07644f20abf2596f78a60112713e11cbe Mon Sep 17 00:00:00 2001
+From: Thomas Kuehne <thomas@kuehne.cn>
+Date: Dec 11 2021 21:03:42 +0000
+Subject: add strings.h import
+
+
+Fixes:
+xmlif/xmlif.l:162:13: warning: implicit declaration of function ‘strncasecmp’; did you mean ‘strncmp’? [-Wimplicit-function-declaration]
+  162 |         if (strncasecmp(selections[i], attr, eqoffset) == 0)
+      |             ^~~~~~~~~~~
+
+Signed-off-by: Thomas Kuehne <thomas@kuehne.cn>
+
+--- a/xmlif/xmlif.l
++++ b/xmlif/xmlif.l
+@@ -37,6 +37,7 @@
+  */
+ #include <string.h>
+ #include <stdlib.h>
++#include <strings.h>
+ 
+ #define TRUE	1
+ #define FALSE	0
diff --git a/sdk_container/src/third_party/portage-stable/app-text/xmlto/xmlto-0.0.28-r6.ebuild b/sdk_container/src/third_party/portage-stable/app-text/xmlto/xmlto-0.0.28-r11.ebuild
similarity index 63%
rename from sdk_container/src/third_party/portage-stable/app-text/xmlto/xmlto-0.0.28-r6.ebuild
rename to sdk_container/src/third_party/portage-stable/app-text/xmlto/xmlto-0.0.28-r11.ebuild
index 9188b524d59..bf44cdb5d84 100644
--- a/sdk_container/src/third_party/portage-stable/app-text/xmlto/xmlto-0.0.28-r6.ebuild
+++ b/sdk_container/src/third_party/portage-stable/app-text/xmlto/xmlto-0.0.28-r11.ebuild
@@ -1,7 +1,7 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=7
+EAPI=8
 
 inherit autotools
 
@@ -9,12 +9,13 @@ DESCRIPTION="Script for converting XML and DocBook documents to a variety of out
 HOMEPAGE="https://pagure.io/xmlto"
 SRC_URI="https://releases.pagure.org/${PN}/${P}.tar.bz2"
 
-LICENSE="GPL-2"
+LICENSE="GPL-2+"
 SLOT="0"
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~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="latex text"
 
 RDEPEND="
+	app-shells/bash:0
 	app-text/docbook-xsl-stylesheets
 	app-text/docbook-xml-dtd:4.2
 	dev-libs/libxslt
@@ -22,14 +23,18 @@ RDEPEND="
 	text? ( || ( virtual/w3m www-client/elinks www-client/links www-client/lynx ) )
 	latex? ( dev-texlive/texlive-formatsextra )
 "
-# We only depend on flex when we patch the input lexer.
 DEPEND="${RDEPEND}"
+# We only depend on lex when we patch the input lexer.
+# We touch it in fix-warnings.patch.
+BDEPEND="app-alternatives/lex"
 
 DOCS=( AUTHORS ChangeLog FAQ NEWS README THANKS )
 
 PATCHES=(
 	"${FILESDIR}"/${PN}-0.0.22-format_fo_passivetex_check.patch
 	"${FILESDIR}"/${PN}-0.0.28-allow-links.patch
+	"${FILESDIR}"/${P}-dont-hardcode-paths.patch
+	"${FILESDIR}"/${P}-fix-warnings.patch
 )
 
 src_prepare() {
@@ -44,9 +49,12 @@ src_prepare() {
 }
 
 src_configure() {
-	# We don't want the script to detect /bin/sh if it is bash.
-	export ac_cv_path_BASH="${BASH}"
 	has_version sys-apps/util-linux || export GETOPT=getopt-long
 
-	econf
+	local args=(
+		# Ensure we always get a #!/bin/bash shebang in xmlto, bug 912286
+		BASH="${EPREFIX}/bin/bash"
+	)
+
+	econf "${args[@]}"
 }
diff --git a/sdk_container/src/third_party/portage-stable/app-text/xmlto/xmlto-0.0.28-r8.ebuild b/sdk_container/src/third_party/portage-stable/app-text/xmlto/xmlto-0.0.28-r8.ebuild
deleted file mode 100644
index c54987d45d2..00000000000
--- a/sdk_container/src/third_party/portage-stable/app-text/xmlto/xmlto-0.0.28-r8.ebuild
+++ /dev/null
@@ -1,53 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit autotools
-
-DESCRIPTION="Script for converting XML and DocBook documents to a variety of output formats"
-HOMEPAGE="https://pagure.io/xmlto"
-SRC_URI="https://releases.pagure.org/${PN}/${P}.tar.bz2"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
-IUSE="latex text"
-
-RDEPEND="
-	app-text/docbook-xsl-stylesheets
-	app-text/docbook-xml-dtd:4.2
-	dev-libs/libxslt
-	|| ( sys-apps/util-linux app-misc/getopt )
-	text? ( || ( virtual/w3m www-client/elinks www-client/links www-client/lynx ) )
-	latex? ( dev-texlive/texlive-formatsextra )
-"
-# We only depend on flex when we patch the input lexer.
-DEPEND="${RDEPEND}"
-
-DOCS=( AUTHORS ChangeLog FAQ NEWS README THANKS )
-
-PATCHES=(
-	"${FILESDIR}"/${PN}-0.0.22-format_fo_passivetex_check.patch
-	"${FILESDIR}"/${PN}-0.0.28-allow-links.patch
-	"${FILESDIR}"/${PN}-0.0.28-dont-hardcode-paths.patch
-)
-
-src_prepare() {
-	default
-
-	# fix symbol clash on Solaris
-	if [[ ${CHOST} == *-solaris* ]] ; then
-		sed -i -e 's/\(attrib\|val\)/XMLTO\1/g' xmlif/xmlif.l || die
-	fi
-
-	eautoreconf
-}
-
-src_configure() {
-	# We don't want the script to detect /bin/sh if it is bash.
-	export ac_cv_path_BASH="${BASH}"
-	has_version sys-apps/util-linux || export GETOPT=getopt-long
-
-	econf
-}

From e4ebfd51ef39834bac34bfce822942e36ea557ae Mon Sep 17 00:00:00 2001
From: Krzesimir Nowak <knowak@microsoft.com>
Date: Thu, 7 Dec 2023 16:31:42 +0100
Subject: [PATCH 19/22] app-vim/gentoo-syntax: Sync with Gentoo

It's from Gentoo commit 5bb294b0939dad84f5bd187d0fd32ff0093ff820.
---
 .../app-vim/gentoo-syntax/Manifest            |  4 +-
 .../gentoo-syntax-0.20211208.ebuild           | 44 -------------------
 .../gentoo-syntax-0.20220220.ebuild           | 44 -------------------
 ...yntax-1.ebuild => gentoo-syntax-12.ebuild} |  4 +-
 .../gentoo-syntax/gentoo-syntax-9999.ebuild   | 13 +++---
 .../app-vim/gentoo-syntax/metadata.xml        |  1 +
 6 files changed, 11 insertions(+), 99 deletions(-)
 delete mode 100644 sdk_container/src/third_party/portage-stable/app-vim/gentoo-syntax/gentoo-syntax-0.20211208.ebuild
 delete mode 100644 sdk_container/src/third_party/portage-stable/app-vim/gentoo-syntax/gentoo-syntax-0.20220220.ebuild
 rename sdk_container/src/third_party/portage-stable/app-vim/gentoo-syntax/{gentoo-syntax-1.ebuild => gentoo-syntax-12.ebuild} (79%)

diff --git a/sdk_container/src/third_party/portage-stable/app-vim/gentoo-syntax/Manifest b/sdk_container/src/third_party/portage-stable/app-vim/gentoo-syntax/Manifest
index 33e8f637344..4078c34fad7 100644
--- a/sdk_container/src/third_party/portage-stable/app-vim/gentoo-syntax/Manifest
+++ b/sdk_container/src/third_party/portage-stable/app-vim/gentoo-syntax/Manifest
@@ -1,3 +1 @@
-DIST gentoo-syntax-1.tar.bz2 20223 BLAKE2B 846e07354660b4859cc4131a9fbf4f78d3a2ddeda60fc6a3687b649788a52725602dcd22befa9ab9fe88b173eab1470e569076d587326935efaf40d3aaba5b57 SHA512 1e4d947f0edbf6bd24142d683944f30d43b7e0ca86b90311f2e80516d299d9a634a9842cdc90d98a43e7a693f0dd29b3ff8048256bc3fe688591cc2b84808289
-DIST gentoo-syntax-20211208.tar.bz2 18844 BLAKE2B 52e7025d46f5101f2e1c44afcbf3cba0756a1ec9c626f7af312bb5bbae518645c06c94bfc48822a721e2e3c1ed5f61376e88a074a9688cf4b5b3c352a99c87c9 SHA512 f1cfe2af440f7ed3042cbaa16558cb6df8038f439a2c3e7067f81751a37098854a3afb1653c7c3656ef85ad1874d2db9271429b92a25f494da6ee5c68819e631
-DIST gentoo-syntax-20220220.tar.bz2 19433 BLAKE2B 8f7fbbb56e41f4d682c824deb980035441195785f9ce80fd45808b55cf900c8e0455b5c670f82b1fc639c052792b78de5f0be1142eab853b0cabbd44c6ed0776 SHA512 4b515ca7936a16279c48310d1fa0f58979e35b1d84a2971bdcf4a004784efa3de99619851ac9da5ee0ee77a1f65eb28550d01013cffebd45e39fb70c0136ba12
+DIST gentoo-syntax-12.tar.bz2 21022 BLAKE2B 758993282ccc26384bb1fc761f2a07059d5e2e7038f56d48ec19ac82ddecb7cd1601fbdd4221e6b41b43281195d862c93d98c12c47d2d43f4a6cbb4784ae6b46 SHA512 07bc7102b3f687c53d8e46c5ca91c1d605239490f160c6db11c6d17ae95b94d34e9ac654b3c9935099382f39ba8b92ea373b09f86fc6452840d12f135820b2b3
diff --git a/sdk_container/src/third_party/portage-stable/app-vim/gentoo-syntax/gentoo-syntax-0.20211208.ebuild b/sdk_container/src/third_party/portage-stable/app-vim/gentoo-syntax/gentoo-syntax-0.20211208.ebuild
deleted file mode 100644
index 5676ffe9c19..00000000000
--- a/sdk_container/src/third_party/portage-stable/app-vim/gentoo-syntax/gentoo-syntax-0.20211208.ebuild
+++ /dev/null
@@ -1,44 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit vim-plugin
-
-MY_P=${P/0.}
-DESCRIPTION="vim plugin: Gentoo and Portage syntax highlighting"
-HOMEPAGE="https://github.com/gentoo/gentoo-syntax"
-SRC_URI="https://gitweb.gentoo.org/proj/gentoo-syntax.git/snapshot/${MY_P}.tar.bz2"
-S=${WORKDIR}/${MY_P}
-
-LICENSE="vim"
-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"
-IUSE="ignore-glep31"
-
-VIM_PLUGIN_HELPFILES="gentoo-syntax"
-VIM_PLUGIN_MESSAGES="filetype"
-
-src_prepare() {
-	default
-	if use ignore-glep31 ; then
-		for f in ftplugin/*.vim ; do
-			ebegin "Removing UTF-8 rules from ${f} ..."
-			sed -i -e 's~\(setlocal fileencoding=utf-8\)~" \1~' ${f} \
-				|| die "waah! bad sed voodoo. need more goats."
-			eend $?
-		done
-	fi
-}
-
-pkg_postinst() {
-	vim-plugin_pkg_postinst
-
-	if [[ -z ${REPLACING_VERSIONS} ]] ; then
-		if use ignore-glep31 1>/dev/null ; then
-			ewarn "You have chosen to disable the rules which ensure GLEP 31"
-			ewarn "compliance. When editing ebuilds, please make sure you get"
-			ewarn "the character set correct."
-		fi
-	fi
-}
diff --git a/sdk_container/src/third_party/portage-stable/app-vim/gentoo-syntax/gentoo-syntax-0.20220220.ebuild b/sdk_container/src/third_party/portage-stable/app-vim/gentoo-syntax/gentoo-syntax-0.20220220.ebuild
deleted file mode 100644
index 3cc000eb8ff..00000000000
--- a/sdk_container/src/third_party/portage-stable/app-vim/gentoo-syntax/gentoo-syntax-0.20220220.ebuild
+++ /dev/null
@@ -1,44 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit vim-plugin
-
-MY_P=${P/0.}
-DESCRIPTION="vim plugin: Gentoo and Portage syntax highlighting"
-HOMEPAGE="https://github.com/gentoo/gentoo-syntax"
-SRC_URI="https://gitweb.gentoo.org/proj/gentoo-syntax.git/snapshot/${MY_P}.tar.bz2"
-S=${WORKDIR}/${MY_P}
-
-LICENSE="vim"
-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"
-IUSE="ignore-glep31"
-
-VIM_PLUGIN_HELPFILES="gentoo-syntax"
-VIM_PLUGIN_MESSAGES="filetype"
-
-src_prepare() {
-	default
-	if use ignore-glep31 ; then
-		for f in ftplugin/*.vim ; do
-			ebegin "Removing UTF-8 rules from ${f} ..."
-			sed -i -e 's~\(setlocal fileencoding=utf-8\)~" \1~' ${f} \
-				|| die "waah! bad sed voodoo. need more goats."
-			eend $?
-		done
-	fi
-}
-
-pkg_postinst() {
-	vim-plugin_pkg_postinst
-
-	if [[ -z ${REPLACING_VERSIONS} ]] ; then
-		if use ignore-glep31 1>/dev/null ; then
-			ewarn "You have chosen to disable the rules which ensure GLEP 31"
-			ewarn "compliance. When editing ebuilds, please make sure you get"
-			ewarn "the character set correct."
-		fi
-	fi
-}
diff --git a/sdk_container/src/third_party/portage-stable/app-vim/gentoo-syntax/gentoo-syntax-1.ebuild b/sdk_container/src/third_party/portage-stable/app-vim/gentoo-syntax/gentoo-syntax-12.ebuild
similarity index 79%
rename from sdk_container/src/third_party/portage-stable/app-vim/gentoo-syntax/gentoo-syntax-1.ebuild
rename to sdk_container/src/third_party/portage-stable/app-vim/gentoo-syntax/gentoo-syntax-12.ebuild
index cc256f13f27..717484df959 100644
--- a/sdk_container/src/third_party/portage-stable/app-vim/gentoo-syntax/gentoo-syntax-1.ebuild
+++ b/sdk_container/src/third_party/portage-stable/app-vim/gentoo-syntax/gentoo-syntax-12.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://gitweb.gentoo.org/proj/gentoo-syntax.git/snapshot/${P}.tar.bz2"
 
 LICENSE="vim"
 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="ignore-glep31"
 
 VIM_PLUGIN_HELPFILES="gentoo-syntax"
diff --git a/sdk_container/src/third_party/portage-stable/app-vim/gentoo-syntax/gentoo-syntax-9999.ebuild b/sdk_container/src/third_party/portage-stable/app-vim/gentoo-syntax/gentoo-syntax-9999.ebuild
index a5cb9329196..7e46a0bf24a 100644
--- a/sdk_container/src/third_party/portage-stable/app-vim/gentoo-syntax/gentoo-syntax-9999.ebuild
+++ b/sdk_container/src/third_party/portage-stable/app-vim/gentoo-syntax/gentoo-syntax-9999.ebuild
@@ -1,18 +1,19 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=7
+EAPI=8
 
 inherit git-r3 vim-plugin
 
 DESCRIPTION="vim plugin: Gentoo and Portage syntax highlighting"
-HOMEPAGE="https://github.com/gentoo/gentoo-syntax"
-EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/gentoo-syntax.git
-	https://github.com/gentoo/gentoo-syntax.git"
+HOMEPAGE="https://github.com/gentoo/gentoo-syntax/"
+EGIT_REPO_URI="
+	https://anongit.gentoo.org/git/proj/gentoo-syntax.git
+	https://github.com/gentoo/gentoo-syntax.git
+"
 
 LICENSE="vim"
 SLOT="0"
-KEYWORDS=""
 IUSE="ignore-glep31"
 
 VIM_PLUGIN_HELPFILES="gentoo-syntax"
diff --git a/sdk_container/src/third_party/portage-stable/app-vim/gentoo-syntax/metadata.xml b/sdk_container/src/third_party/portage-stable/app-vim/gentoo-syntax/metadata.xml
index 12b3719f872..d55db2445d1 100644
--- a/sdk_container/src/third_party/portage-stable/app-vim/gentoo-syntax/metadata.xml
+++ b/sdk_container/src/third_party/portage-stable/app-vim/gentoo-syntax/metadata.xml
@@ -14,6 +14,7 @@
     <flag name="ignore-glep31">Remove GLEP 31 (UTF-8 file encodings) settings</flag>
   </use>
   <upstream>
+    <remote-id type="gentoo">proj/gentoo-syntax</remote-id>
     <remote-id type="github">gentoo/gentoo-syntax</remote-id>
   </upstream>
 </pkgmetadata>

From 5655ce2afee704ad7b1a7bc2da5b1c2008cd2dbb Mon Sep 17 00:00:00 2001
From: Krzesimir Nowak <knowak@microsoft.com>
Date: Thu, 7 Dec 2023 16:43:30 +0100
Subject: [PATCH 20/22] .github: Add app-* packages to automation

---
 .../workflows/portage-stable-packages-list    | 22 +++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/.github/workflows/portage-stable-packages-list b/.github/workflows/portage-stable-packages-list
index 7e26137ad81..57ff8769f75 100644
--- a/.github/workflows/portage-stable-packages-list
+++ b/.github/workflows/portage-stable-packages-list
@@ -59,6 +59,9 @@ acct-user/systemd-resolve
 acct-user/systemd-timesync
 acct-user/tss
 
+app-admin/eselect
+app-admin/perl-cleaner
+
 app-alternatives/awk
 app-alternatives/bc
 app-alternatives/bzip2
@@ -74,6 +77,8 @@ app-arch/cpio
 app-arch/gzip
 app-arch/lbzip2
 app-arch/libarchive
+app-arch/lz4
+app-arch/lzop
 app-arch/ncompress
 app-arch/pbzip2
 app-arch/pigz
@@ -94,11 +99,17 @@ app-containers/docker-proxy
 app-containers/runc
 
 app-crypt/adcli
+app-crypt/argon2
+app-crypt/efitools
 app-crypt/libb2
 app-crypt/libmd
+app-crypt/mhash
 app-crypt/mit-krb5
 app-crypt/pinentry
 app-crypt/rhash
+app-crypt/shash
+
+app-doc/eclass-manpages
 
 app-editors/nano
 app-editors/vim
@@ -108,11 +119,18 @@ app-emulation/qemu
 app-emulation/qemu-guest-agent
 
 app-eselect/eselect-iptables
+app-eselect/eselect-lib-bin-symlink
+app-eselect/eselect-pinentry
+app-eselect/eselect-python
+app-eselect/eselect-rust
+app-eselect/eselect-vi
 
 app-misc/c_rehash
 app-misc/editor-wrapper
+app-misc/jq
 app-misc/mime-types
 app-misc/pax-utils
+app-misc/zisofs-tools
 
 app-portage/elt-patches
 app-portage/gentoolkit
@@ -120,6 +138,7 @@ app-portage/portage-utils
 
 app-shells/bash
 app-shells/bash-completion
+app-shells/gentoo-bashcomp
 
 app-text/asciidoc
 app-text/build-docbook-catalog
@@ -129,6 +148,9 @@ app-text/docbook-xsl-stylesheets
 app-text/mandoc
 app-text/manpager
 app-text/sgml-common
+app-text/xmlto
+
+app-vim/gentoo-syntax
 
 dev-cpp/gtest
 

From 581df1dde7c2d70b448a96759eeb09edf4aeb668 Mon Sep 17 00:00:00 2001
From: Krzesimir Nowak <knowak@microsoft.com>
Date: Thu, 7 Dec 2023 18:14:05 +0100
Subject: [PATCH 21/22] overlay profiles: Update accept keywords for
 app-crypt/efitools

---
 .../coreos-overlay/profiles/coreos/base/package.accept_keywords | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sdk_container/src/third_party/coreos-overlay/profiles/coreos/base/package.accept_keywords b/sdk_container/src/third_party/coreos-overlay/profiles/coreos/base/package.accept_keywords
index b2b8926d980..3c500159260 100644
--- a/sdk_container/src/third_party/coreos-overlay/profiles/coreos/base/package.accept_keywords
+++ b/sdk_container/src/third_party/coreos-overlay/profiles/coreos/base/package.accept_keywords
@@ -16,7 +16,7 @@
 =app-crypt/adcli-0.9.2 ~amd64 ~arm64
 
 # Needed by arm64-native SDK.
-=app-crypt/efitools-1.9.2 ~arm64
+=app-crypt/efitools-1.9.2-r1 ~arm64
 
 # Needed to fix CVE-2023-36054.
 =app-crypt/mit-krb5-1.21.2 ~amd64 ~arm64

From 03986153f8a7a7584e08325e9879081dba4ba325 Mon Sep 17 00:00:00 2001
From: Krzesimir Nowak <knowak@microsoft.com>
Date: Thu, 7 Dec 2023 18:14:14 +0100
Subject: [PATCH 22/22] changelog: Add an entry

---
 changelog/updates/2023-12-07-app-automation.md | 2 ++
 1 file changed, 2 insertions(+)
 create mode 100644 changelog/updates/2023-12-07-app-automation.md

diff --git a/changelog/updates/2023-12-07-app-automation.md b/changelog/updates/2023-12-07-app-automation.md
new file mode 100644
index 00000000000..9e42e0ba6ff
--- /dev/null
+++ b/changelog/updates/2023-12-07-app-automation.md
@@ -0,0 +1,2 @@
+- jq ([1.7](https://github.com/jqlang/jq/releases/tag/jq-1.7))
+- lz4 ([1.9.4](https://github.com/lz4/lz4/releases/tag/v1.9.4))