public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] Proposal of "uncooperative-root" in SUPPORTED_FEATURES
@ 2014-07-04 16:25 dREPLACEeLETTEReEjBYeLETTEReAatGMA ILcom
  2014-07-04 18:11 ` Rick "Zero_Chaos" Farina
  0 siblings, 1 reply; 3+ messages in thread
From: dREPLACEeLETTEReEjBYeLETTEReAatGMA ILcom @ 2014-07-04 16:25 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 1272 bytes --]

Hello to all,

Summary: I have made many mods to sys-app/portage (2013 version). The result is
a proposal of patch for latest sys-app/portage, see below.

Main result of my mods to gentoo prefix:

  FEATURES=uncooperative-root emerge -bv =firefox-17

now works on EPREFIX on Android-4.1 ARM. I use neither fakeroot nor GNURoot.
root access never required.

@dol-sen advised me one week ago on #gentoo-portage to post here a rebased
patch for HEAD of git.overlays.gentoo.org/proj/portage.git : I just hosted this
patch on
sf.net/projects/gentooandroid/files/sys-app_portage-current-HEAD_patch/download
and it is also attached to this post.

I request comments and discussions about this patch. Summary:

pym/portage/const.py     + (this is SUPPORTED_FEATURES+=uncooperative-root)
cnf/make.conf.example    ++++++++++++++++++++++++++
bin/ebuild-helpers/emake ++++++++
bin/ebuild.sh            --+++++++
bin/misc-functions.sh    -+++++
bin/phase-helpers.sh     +++++

My aim is to take your remarks into account, then to build an overlay (will be
hosted at endrood.sf.net) with up-to-date versions of all my mods. The final
result will be a tested version of above patch, together with lastest builds
for firefox, squeak, scala, gnucash, ...

Thanks for you attention.

Xdej.

[-- Attachment #2: sys-app_portage-current-HEAD_patch.txt --]
[-- Type: text/plain, Size: 5415 bytes --]

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.

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       = frozenset([
+	"uncooperative-root",
 	"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 running on
 #PORTAGE_ELOG_MAILSUBJECT="[portage] ebuild log for \${PACKAGE} on \${HOST}"
+#
+# Variant for Prefix installations
+# ================================
+#
+#MAKEOPTS="-j2 TMPDIR=${EPREFIX}/tmp CONFIG_SHELL=${EPREFIX}/bin/sh SHELL=${EPREFIX}/bin/bash"
+#PORTAGE_PYTHON=$EPREFIX/usr/bin/python # e.g. for portage/bin/misc-functions.sh
+#PREFIX_DISABLE_GEN_USR_LDSCRIPT=set # e.g. for net-libs/libtirpc-0.2.2-r1.ebuild
+#FEATURES="uncooperative-root"
+#USE="uncooperative-root"
+# 
+#     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 buiding time
+# and despite being in various standards (FHS, ...) root administrator will not
+# cooperate or will break compatibility without notice. They are to be used 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 contains
+# SUPPORTED_FEATURES=uncooperative-root.
+# 
+#     use uncooperative-root
+# is the equivalent condition to use in files *.ebuild whose EAPI doesn't
+# officially contain SUPPORTED_FEATURES=uncooperative-root.  To enable that
+# condition, a file *.ebuild not inherite-ing anything should contain
+# IUSE=-uncooperative-root for that (otherwise, prefix.eclass will have
+# IUSE_IMPLICIT=uncooperative-root even if not directly inherited).
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 +0200
+++ portage/bin/ebuild-helpers/emake	2014-07-04 16:30:26.020612108 +0200
@@ -11,6 +11,14 @@
 
 source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
 
+#${MAKEOPTS} is not transmitted to things called by make
+has uncooperative-root ${FEATURES} && { 
+  export TMPDIR="${EPREFIX}"/tmp
+  export BASH="${EPREFIX}"/bin/bash
+  export CONFIG_SHELL="${EPREFIX}"/bin/sh
+}
+
+
 if [[ $PORTAGE_QUIET != 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=$(shopt) OLDIFS="$IFS"
 	local retval
-	"$@"
-	retval=$?
+        if has uncooperative-root ${FEATURES} ; then
+		uncooperative-root-wrapper "$@" # from prefix.eclass
+		retval=$?
+	else
+		"$@"
+		retval=$?
+	fi
 	set +e
 	[[ $shopts != $(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!"
 
 	if has multilib-strict ${FEATURES} && \
-	   [[ -x /usr/bin/file && -x /usr/bin/find ]] && \
+	   [[ -x "`has uncooperative-root ${FEATURES} && echo ${EPREFIX}`/usr/bin/file" && -x "`has uncooperative-root ${FEATURES} && echo ${EPREFIX}`/usr/bin/find" ]] && \
 	   [[ -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."
 
 	# 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=${BASHPID:-$(__bashpid)}
 
+	has uncooperative-root ${FEATURES} && { 
+		export TMPDIR="${EPREFIX}"/tmp
+		export CONFIG_SHELL="${EPREFIX}"/bin/sh
+	}
 	if ! ___eapi_has_prefix_variables; then
 		local EPREFIX=
 	fi
@@ -592,6 +596,7 @@
 
 einstall() {
 	# CONF_PREFIX is only set if they didn't pass in libdir above.
+	has uncooperative-root ${FEATURES} && export TMPDIR="${EPREFIX}"/tmp
 	local LOCAL_EXTRA_EINSTALL="${EXTRA_EINSTALL}"
 	if ! ___eapi_has_prefix_variables; then
 		local ED=${D}

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [gentoo-dev] Proposal of "uncooperative-root" in SUPPORTED_FEATURES
  2014-07-04 16:25 [gentoo-dev] Proposal of "uncooperative-root" in SUPPORTED_FEATURES dREPLACEeLETTEReEjBYeLETTEReAatGMA ILcom
@ 2014-07-04 18:11 ` Rick "Zero_Chaos" Farina
  2014-07-04 20:47   ` Joshua Kinard
  0 siblings, 1 reply; 3+ messages in thread
From: Rick "Zero_Chaos" Farina @ 2014-07-04 18:11 UTC (permalink / raw
  To: gentoo-dev

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 07/04/2014 12:25 PM, dREPLACEeLETTEReEjBYeLETTEReAatGMA ILcom wrote:

It is incredibly hard to seriously review anything with this from email
address.

- -Zero


> Hello to all,
> 
> Summary: I have made many mods to sys-app/portage (2013 version). The result is
> a proposal of patch for latest sys-app/portage, see below.
> 
> Main result of my mods to gentoo prefix:
> 
>   FEATURES=uncooperative-root emerge -bv =firefox-17
> 
> now works on EPREFIX on Android-4.1 ARM. I use neither fakeroot nor GNURoot.
> root access never required.
> 
> @dol-sen advised me one week ago on #gentoo-portage to post here a rebased
> patch for HEAD of git.overlays.gentoo.org/proj/portage.git : I just hosted this
> patch on
> sf.net/projects/gentooandroid/files/sys-app_portage-current-HEAD_patch/download
> and it is also attached to this post.
> 
> I request comments and discussions about this patch. Summary:
> 
> pym/portage/const.py     + (this is SUPPORTED_FEATURES+=uncooperative-root)
> cnf/make.conf.example    ++++++++++++++++++++++++++
> bin/ebuild-helpers/emake ++++++++
> bin/ebuild.sh            --+++++++
> bin/misc-functions.sh    -+++++
> bin/phase-helpers.sh     +++++
> 
> My aim is to take your remarks into account, then to build an overlay (will be
> hosted at endrood.sf.net) with up-to-date versions of all my mods. The final
> result will be a tested version of above patch, together with lastest builds
> for firefox, squeak, scala, gnucash, ...
> 
> Thanks for you attention.
> 
> Xdej.
> 

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJTtu45AAoJEKXdFCfdEflKfD8P/jLdlFM94mIRExJLjf6snELd
lKfKouTlv57gdgI0sp6+ptX56OPbPqfRMuBOToKdV5atbsdUY2T1nyE+3NaJw8C4
UjgaeEvZOzDYz5CgLYsdXvil24bBj5TJ7QYxKNFkBdWln7MF5blFeM37QioC82IA
M1AHp/Ck8Q05WLuvjfKFpA5qCpXfDj7mdcOnqp2pf/CYCI45zsQoRnacDgi/VF3A
vXBQeq2jcTfUb6kuZqqCuXEY0NcTcDAcJxhoPdIMFlnv19JQ0l3qnSwdvePxratU
njR5dMP4rYrnY12AD60vNU0p7HaBF+9XMxWAef8aqc17+9j4bmciHTY1Ncre1mBo
NH/9vHgFlCLYK+PjUzSags9EO5Oo+rEFf1muchjPnYAjEwVKou1pauNRaIRKX8g5
cyQAKu8fTJCvuPvLQRPNvxYk25ByV/a8Mbwi9UgB0C19hmFEP/GuujfNdqNSvzm/
lyOayX4La8XQFiD36AF6o8ro3L/8BtRmcumhJQXBXyXSHDbJumjlhDZ1IulLB6an
oCpTjc0c68oMe5PXJVxjkXiZh1I2pXLLyTwqaqn15tg2zt8tbCC5FGplrx7/ejY5
MmP46+SUJQpJVuPWlY75Ks/756LIbswPo99Lx8tE5bUZQs8aS5LMmqhSrZ0bbUF6
++2rrYvhdbZUxtSy+bR2
=vaB0
-----END PGP SIGNATURE-----


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [gentoo-dev] Proposal of "uncooperative-root" in SUPPORTED_FEATURES
  2014-07-04 18:11 ` Rick "Zero_Chaos" Farina
@ 2014-07-04 20:47   ` Joshua Kinard
  0 siblings, 0 replies; 3+ messages in thread
From: Joshua Kinard @ 2014-07-04 20:47 UTC (permalink / raw
  To: gentoo-dev

On 07/04/2014 14:11, Rick "Zero_Chaos" Farina wrote:
> On 07/04/2014 12:25 PM, dREPLACEeLETTEReEjBYeLETTEReAatGMA ILcom wrote:
> 
> It is incredibly hard to seriously review anything with this from email
> address.
> 
> -Zero
> 
> 
>> Hello to all,
> 
>> Summary: I have made many mods to sys-app/portage (2013 version). The result is
>> a proposal of patch for latest sys-app/portage, see below.

This also should probably be addressed to the gentoo-portage-dev ML, not the
main -dev ML.

-- 
Joshua Kinard
Gentoo/MIPS
kumba@gentoo.org
4096R/D25D95E3 2011-03-28

"The past tempts us, the present confuses us, the future frightens us.  And
our lives slip away, moment by moment, lost in that vast, terrible in-between."

--Emperor Turhan, Centauri Republic


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-07-04 20:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-04 16:25 [gentoo-dev] Proposal of "uncooperative-root" in SUPPORTED_FEATURES dREPLACEeLETTEReEjBYeLETTEReAatGMA ILcom
2014-07-04 18:11 ` Rick "Zero_Chaos" Farina
2014-07-04 20:47   ` Joshua Kinard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox