sys-apps/portage: modernise, sync live

Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Sam James
2023-05-27 15:01:29 +01:00
parent e7d1049282
commit 2cc987336a
2 changed files with 62 additions and 29 deletions

View File

@@ -12,28 +12,39 @@ inherit distutils-r1 linux-info toolchain-funcs tmpfiles prefix
DESCRIPTION="The package management and distribution system for Gentoo"
HOMEPAGE="https://wiki.gentoo.org/wiki/Project:Portage"
SRC_URI="https://gitweb.gentoo.org/proj/portage.git/snapshot/${P}.tar.bz2"
if [[ ${PV} == 9999 ]] ; then
EGIT_REPO_URI="
https://anongit.gentoo.org/git/proj/portage.git
https://github.com/gentoo/portage.git
"
inherit git-r3
else
SRC_URI="https://gitweb.gentoo.org/proj/portage.git/snapshot/${P}.tar.bz2"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
fi
LICENSE="GPL-2"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
SLOT="0"
IUSE="apidoc build doc gentoo-dev +ipc +native-extensions +rsync-verify selinux test xattr"
RESTRICT="!test? ( test )"
BDEPEND="
app-arch/xz-utils
test? ( dev-vcs/git )
"
DEPEND="
!build? ( $(python_gen_impl_dep 'ssl(+)') )
>=app-arch/tar-1.27
dev-lang/python-exec:2
>=sys-apps/sed-4.0.5 sys-devel/patch
doc? ( app-text/xmlto ~app-text/docbook-xml-dtd-4.4 )
!build? ( $(python_gen_impl_dep 'ssl(+)') )
apidoc? (
dev-python/sphinx[${PYTHON_USEDEP}]
dev-python/sphinx-epytext[${PYTHON_USEDEP}]
)
doc? (
app-text/xmlto
~app-text/docbook-xml-dtd-4.4
)
"
# Require sandbox-2.2 for bug #288863.
# For whirlpool hash, require python[ssl] (bug #425046).
@@ -70,6 +81,8 @@ RDEPEND="
!<app-portage/repoman-2.3.10
!~app-portage/repoman-3.0.0
"
# coreutils-6.4 rdep is for date format in emerge-webrsync #164532
# NOTE: FEATURES=installsources requires debugedit and rsync
PDEPEND="
!build? (
>=net-misc/rsync-2.6.4
@@ -77,8 +90,8 @@ PDEPEND="
>=sys-apps/file-5.44-r3
)
"
# coreutils-6.4 rdep is for date format in emerge-webrsync #164532
# NOTE: FEATURES=installsources requires debugedit and rsync
distutils_enable_tests setup.py
pkg_pretend() {
local CONFIG_CHECK="~IPC_NS ~PID_NS ~NET_NS ~UTS_NS"
@@ -91,12 +104,11 @@ pkg_pretend() {
}
python_prepare_all() {
local PATCHES=(
)
distutils-r1_python_prepare_all
sed -e "s:^VERSION = \"HEAD\"$:VERSION = \"${PV}\":" -i lib/portage/__init__.py || die
if [[ ${PV} != 9999 ]] ; then
sed -e "s:^VERSION = \"HEAD\"$:VERSION = \"${PV}\":" -i lib/portage/__init__.py || die
fi
if use gentoo-dev; then
einfo "Disabling --dynamic-deps by default for gentoo-dev..."
@@ -184,10 +196,6 @@ python_compile_all() {
fi
}
python_test() {
esetup.py test
}
python_install() {
# Install sbin scripts to bindir for python-exec linking
# they will be relocated in pkg_preinst()

View File

@@ -8,15 +8,23 @@ PYTHON_COMPAT=( pypy3 python3_{10..11} )
PYTHON_REQ_USE='bzip2(+),threads(+)'
TMPFILES_OPTIONAL=1
inherit distutils-r1 git-r3 linux-info toolchain-funcs tmpfiles prefix
inherit distutils-r1 linux-info toolchain-funcs tmpfiles prefix
DESCRIPTION="The package management and distribution system for Gentoo"
HOMEPAGE="https://wiki.gentoo.org/wiki/Project:Portage"
EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/portage.git
https://github.com/gentoo/portage.git"
if [[ ${PV} == 9999 ]] ; then
EGIT_REPO_URI="
https://anongit.gentoo.org/git/proj/portage.git
https://github.com/gentoo/portage.git
"
inherit git-r3
else
SRC_URI="https://gitweb.gentoo.org/proj/portage.git/snapshot/${P}.tar.bz2"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
fi
LICENSE="GPL-2"
KEYWORDS=""
SLOT="0"
IUSE="apidoc build doc gentoo-dev +ipc +native-extensions +rsync-verify selinux test xattr"
RESTRICT="!test? ( test )"
@@ -25,15 +33,19 @@ BDEPEND="
test? ( dev-vcs/git )
"
DEPEND="
!build? ( $(python_gen_impl_dep 'ssl(+)') )
>=app-arch/tar-1.27
dev-lang/python-exec:2
>=sys-apps/sed-4.0.5 sys-devel/patch
doc? ( app-text/xmlto ~app-text/docbook-xml-dtd-4.4 )
!build? ( $(python_gen_impl_dep 'ssl(+)') )
apidoc? (
dev-python/sphinx[${PYTHON_USEDEP}]
dev-python/sphinx-epytext[${PYTHON_USEDEP}]
)"
)
doc? (
app-text/xmlto
~app-text/docbook-xml-dtd-4.4
)
"
# Require sandbox-2.2 for bug #288863.
# For whirlpool hash, require python[ssl] (bug #425046).
# For compgen, require bash[readline] (bug #445576).
@@ -67,7 +79,10 @@ RDEPEND="
!<app-admin/logrotate-3.8.0
!<app-portage/gentoolkit-0.4.6
!<app-portage/repoman-2.3.10
!~app-portage/repoman-3.0.0"
!~app-portage/repoman-3.0.0
"
# coreutils-6.4 rdep is for date format in emerge-webrsync #164532
# NOTE: FEATURES=installsources requires debugedit and rsync
PDEPEND="
!build? (
>=net-misc/rsync-2.6.4
@@ -75,8 +90,8 @@ PDEPEND="
>=sys-apps/file-5.44-r3
)
"
# coreutils-6.4 rdep is for date format in emerge-webrsync #164532
# NOTE: FEATURES=installsources requires debugedit and rsync
distutils_enable_tests setup.py
pkg_pretend() {
local CONFIG_CHECK="~IPC_NS ~PID_NS ~NET_NS ~UTS_NS"
@@ -91,6 +106,10 @@ pkg_pretend() {
python_prepare_all() {
distutils-r1_python_prepare_all
if [[ ${PV} != 9999 ]] ; then
sed -e "s:^VERSION = \"HEAD\"$:VERSION = \"${PV}\":" -i lib/portage/__init__.py || die
fi
if use gentoo-dev; then
einfo "Disabling --dynamic-deps by default for gentoo-dev..."
sed -e 's:\("--dynamic-deps", \)\("y"\):\1"n":' \
@@ -177,10 +196,6 @@ python_compile_all() {
fi
}
python_test() {
esetup.py test
}
python_install() {
# Install sbin scripts to bindir for python-exec linking
# they will be relocated in pkg_preinst()
@@ -256,6 +271,16 @@ pkg_preinst() {
if chown portage:portage "${ED}"/var/log/portage{,/elog} 2>/dev/null ; then
chmod g+s,ug+rwx "${ED}"/var/log/portage{,/elog}
fi
if has_version "<${CATEGORY}/${PN}-2.3.77"; then
elog "The emerge --autounmask option is now disabled by default, except for"
elog "portions of behavior which are controlled by the --autounmask-use and"
elog "--autounmask-license options. For backward compatibility, previous"
elog "behavior of --autounmask=y and --autounmask=n is entirely preserved."
elog "Users can get the old behavior simply by adding --autounmask to the"
elog "make.conf EMERGE_DEFAULT_OPTS variable. For the rationale for this"
elog "change, see https://bugs.gentoo.org/658648."
fi
}
pkg_postinst() {