From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id C2CFA13877A for ; Sat, 5 Jul 2014 21:25:32 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 54D6DE07F1; Sat, 5 Jul 2014 21:25:31 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 99D4EE07DB for ; Sat, 5 Jul 2014 21:25:30 +0000 (UTC) Received: from pomiot.lan (77-254-166-236.adsl.inetia.pl [77.254.166.236]) (using SSLv3 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: mgorny) by smtp.gentoo.org (Postfix) with ESMTPSA id BF80633FEC8; Sat, 5 Jul 2014 21:25:28 +0000 (UTC) Date: Sat, 5 Jul 2014 23:25:10 +0200 From: =?ISO-8859-2?B?TWljaGGzIEfzcm55?= To: X dej Cc: gentoo-portage-dev@lists.gentoo.org Subject: Re: [gentoo-portage-dev] Proposal of "uncooperative-root" in SUPPORTED_FEATURES Message-ID: <20140705232510.642b8823@pomiot.lan> In-Reply-To: References: Organization: Gentoo X-Mailer: Claws Mail 3.10.1 (GTK+ 2.24.24; x86_64-pc-linux-gnu) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-portage-dev@lists.gentoo.org Reply-to: gentoo-portage-dev@lists.gentoo.org MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/LDcqaSQoS3pbCyqKZbtb+b5"; protocol="application/pgp-signature" X-Archives-Salt: f87cf7e3-0e4d-4f03-acf7-1bbc2805913c X-Archives-Hash: 1c40aaec597bd8475fa30c458b30da43 --Sig_/LDcqaSQoS3pbCyqKZbtb+b5 Content-Type: text/plain; charset=ISO-8859-2 Content-Transfer-Encoding: quoted-printable Dnia 2014-07-05, o godz. 10:24:03 X dej napisa=B3(a): > Patch to apply against HEAD of sys-app/portage project. > I did git clone git://git.overlays.gentoo.org/proj/portage.git on 2014-07= -04 > 13:47:53.442947599 +0000. >=20 > diff -ru old_portage/pym/portage/const.py portage/pym/portage/const.py > --- old_portage/pym/portage/const.py 2014-07-04 16:35:37.462942289 +0200 > +++ portage/pym/portage/const.py 2014-07-04 17:03:00.347420753 +0200 > @@ -119,6 +119,7 @@ > "other", > ) > SUPPORTED_FEATURES =3D frozenset([ > + "uncooperative-root", I don't want to nitpick but the name seems very unclear. The feature name should tell what it does or enables. > "assume-digests", > "binpkg-logs", > "buildpkg", > diff -ru old_portage/cnf/make.conf.example portage/cnf/make.conf.example > --- old_portage/cnf/make.conf.example 2014-07-04 16:52:24.438859863 +0200 > +++ portage/cnf/make.conf.example 2014-07-04 17:08:10.658545393 +0200 > @@ -362,3 +362,29 @@ > # ${PACKAGE} - see description of PORTAGE_= ELOG_COMMAND > # ${HOST} - FQDN of the host portage is ru= nning on > #PORTAGE_ELOG_MAILSUBJECT=3D"[portage] ebuild log for \${PACKAGE} on \${= HOST}" > +# > +# Variant for Prefix installations > +# =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D > +# > +#MAKEOPTS=3D"-j2 TMPDIR=3D${EPREFIX}/tmp CONFIG_SHELL=3D${EPREFIX}/bin/s= h SHELL=3D${EPREFIX}/bin/bash" > +#PORTAGE_PYTHON=3D$EPREFIX/usr/bin/python # e.g. for portage/bin/misc-fu= nctions.sh > +#PREFIX_DISABLE_GEN_USR_LDSCRIPT=3Dset # e.g. for net-libs/libtirpc-0.2.= 2-r1.ebuild > +#FEATURES=3D"uncooperative-root" > +#USE=3D"uncooperative-root" A general remark: wouldn't it be better to substitute this to the main part of make.conf.example when 'use prefix' is in use? > +#=20 > +# has uncooperative-root ${FEATURES} > +# is a condition meaning that /tmp, /bin/bash, > +# /bin/sh, /dev, /usr/bin/{env,find,file} may not be available at buidin= g time > +# and despite being in various standards (FHS, ...) root administrator w= ill not > +# cooperate or will break compatibility without notice. They are to be u= sed now > +# in .eclass and in sys-app/portage (typical example: Android; needed for > +# gentooandroid.sourceforge.net). > +# It will likely be used in any *.ebuild file whose EAPI officially cont= ains > +# SUPPORTED_FEATURES=3Duncooperative-root. > +#=20 > +# use uncooperative-root > +# is the equivalent condition to use in files *.ebuild whose EAPI doesn't > +# officially contain SUPPORTED_FEATURES=3Duncooperative-root. To enable= that > +# condition, a file *.ebuild not inherite-ing anything should contain > +# IUSE=3D-uncooperative-root for that (otherwise, prefix.eclass will have > +# IUSE_IMPLICIT=3Duncooperative-root even if not directly inherited). This doesn't belong in make.conf.example but rather in the manpage. Which is a good point to note that you haven't added the description of the new FEATURE to make.conf(5). > diff -ru old_portage/bin/ebuild-helpers/emake portage/bin/ebuild-helpers/= emake > --- old_portage/bin/ebuild-helpers/emake 2014-07-04 16:17:50.847841909 +0= 200 > +++ portage/bin/ebuild-helpers/emake 2014-07-04 16:30:26.020612108 +0200 > @@ -11,6 +11,14 @@ > =20 > source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh > =20 > +#${MAKEOPTS} is not transmitted to things called by make > +has uncooperative-root ${FEATURES} && {=20 > + export TMPDIR=3D"${EPREFIX}"/tmp Isn't TMPDIR already set by portage? PMS says it ought to be. > + export BASH=3D"${EPREFIX}"/bin/bash > + export CONFIG_SHELL=3D"${EPREFIX}"/bin/sh > +} If you export it all anyway... what's the point of passing them via MAKEOPTS? > + > + > if [[ $PORTAGE_QUIET !=3D 1 ]] ; then > ( > for arg in ${MAKE:-make} $MAKEOPTS $EXTRA_EMAKE "$@" ; do > diff -ru old_portage/bin/ebuild.sh portage/bin/ebuild.sh > --- old_portage/bin/ebuild.sh 2014-07-04 15:59:24.022279274 +0200 > +++ portage/bin/ebuild.sh 2014-07-04 16:01:08.613886159 +0200 > @@ -90,8 +90,13 @@ > __qa_call() { > local shopts=3D$(shopt) OLDIFS=3D"$IFS" > local retval > - "$@" > - retval=3D$? > + if has uncooperative-root ${FEATURES} ; then > + uncooperative-root-wrapper "$@" # from prefix.eclass I don't think it is a good idea to call eclass functions from within portage. > + retval=3D$? > + else > + "$@" > + retval=3D$? > + fi > set +e > [[ $shopts !=3D $(shopt) ]] && > eqawarn "QA Notice: Global shell options changed and were not restored= while calling '$*'" > diff -ru old_portage/bin/misc-functions.sh portage/bin/misc-functions.sh > --- old_portage/bin/misc-functions.sh 2014-07-04 16:03:59.416144645 +0200 > +++ portage/bin/misc-functions.sh 2014-07-04 16:57:13.327124754 +0200 > @@ -820,7 +820,7 @@ > rm -f "${ED}"/usr/share/info/dir{,.gz,.bz2} || die "rm failed!" > =20 > if has multilib-strict ${FEATURES} && \ > - [[ -x /usr/bin/file && -x /usr/bin/find ]] && \ > + [[ -x "`has uncooperative-root ${FEATURES} && echo ${EPREFIX}`/usr/b= in/file" && -x "`has uncooperative-root ${FEATURES} && echo ${EPREFIX}`/usr= /bin/find" ]] && \ Please use $() instead of `` because the latter is hard to read and doesn't support nesting. Doesn't this also need to consider ${ROOT}? > [[ -n ${MULTILIB_STRICT_DIRS} && -n ${MULTILIB_STRICT_DENY} ]] > then > rm -f "${T}/multilib-strict.log" > @@ -1193,6 +1193,10 @@ > fi > [ -n "${md5_hash}" ] && \ > echo ${md5_hash} > "${PORTAGE_BUILDDIR}"/build-info/BINPKGMD5 > + # inform about trial patching done by uncooperative-root > + has uncooperative-root ${FEATURES} && bzip2 -c \ > + < "${PORTAGE_BUILDDIR}"/temp/build.log \ > + > "${PORTAGE_BUILDDIR}"/build-info/build.log.bz2 > __vecho ">>> Done." > =20 > # cleanup our temp tree > diff -ru old_portage/bin/phase-helpers.sh portage/bin/phase-helpers.sh > --- old_portage/bin/phase-helpers.sh 2014-07-04 16:27:01.655594020 +0200 > +++ portage/bin/phase-helpers.sh 2014-07-04 16:27:22.888250815 +0200 > @@ -471,6 +471,10 @@ > local x > local pid=3D${BASHPID:-$(__bashpid)} > =20 > + has uncooperative-root ${FEATURES} && {=20 > + export TMPDIR=3D"${EPREFIX}"/tmp > + export CONFIG_SHELL=3D"${EPREFIX}"/bin/sh > + } > if ! ___eapi_has_prefix_variables; then > local EPREFIX=3D > fi > @@ -592,6 +596,7 @@ > =20 > einstall() { > # CONF_PREFIX is only set if they didn't pass in libdir above. > + has uncooperative-root ${FEATURES} && export TMPDIR=3D"${EPREFIX}"/tmp > local LOCAL_EXTRA_EINSTALL=3D"${EXTRA_EINSTALL}" > if ! ___eapi_has_prefix_variables; then > local ED=3D${D} --=20 Best regards, Micha=B3 G=F3rny --Sig_/LDcqaSQoS3pbCyqKZbtb+b5 Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQJ8BAEBCgBmBQJTuG06XxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ2REJCMDdDQzRGMERBRDA2RUEwQUZFNDFC MDdBMUFFQUVGQjQ0NjRFAAoJELB6GurvtEZOXW8P/02EiUFGUp/DP2jNeMunrWTe aO9aU2sBANdHsRuHaI6sRuidszLlUEXSPYZUffFyjE0aP7bKc9KIPbcu5slnV93Y sfsBhTmPSfBWX/uUd3r1HRURLs10E7aM0Bp1f78yJ93qwjjFGlg1AYItEh4t7JSb wRybuBuXx++LJPFWvdOxo21v9OuuV4yBwTtUfkmB6zeq72mEZeYBDPgV7op7ciqa C8xHOvU+qmxfDgzPFt4/yWGHG3dSD0p8u+MB3AI2l9BlOahRw1pa+fuFu0yXEzVM zRTk28TFL9GB23OrxyfYvvhiNgVWQ1UCwNGKtBfLaFjW1KxdwKzKKZK2Bo18+u1k PWohEPUJ96iHUpIvYBDZvtmCPgfS8zJXdVeR1D/C/2yxsxM45AUBBl4Z/CUcULLa mZSP5qqxu3kz6WxSimjX66YtqYFGP3YsNiUgQJ33WIoxzxtiqmM+Q4bJ1vteUs/L TAXVeMXNqEDTtsiyxDxmq1DIE9NWcOzE/ncoTjN5ex839H9gPi18CzWGhnsoRoFT BTKJQ0VvjPlwA65dHlyMXk+yX21N/oNvfJuTUGKpJRSucTeR5wwuwIhSMEpumbQS eaDln0GStWMr9WN4osuCsx01hzSQO0B3Kcn8Ef9GlKNI7SWHp/wTjdW3limFt2Cs fnst8J3MIGMFdx75weOf =kkZR -----END PGP SIGNATURE----- --Sig_/LDcqaSQoS3pbCyqKZbtb+b5--