I could not find an answer in the devmanual. A look at $ meld /usr/lib/portage/python2.7/ebuild-helpers/do{bin,exe} & did not help me either. Reproducible: Always
Referencing PMS [0]: """ dobin Installs the given files into DESTTREE/bin, where DESTTREE defaults to /usr. Gives the files mode 0755 and transfers file ownership to the superuser or its equivalent on the system or installation at hand. doexe Installs the given files into the directory specified by the most recent exeinto call. If exeinto has not yet been called, behaviour is undefined. Files are installed by default with file mode 0755, or with the install options set by the most recent exeopts call. """ I agree that the explanations in devmanual are ambiguous: """ dobin Install a binary doexe Install an executable """ [0] https://dev.gentoo.org/~ulm/pms/head/pms.html#x1-14000011.3.3.9
commit 7aaea52be77d25a4adad322627d79e1d699330b5 Author: Wim Muskee <wimmuskee@gmail.com> AuthorDate: Thu Nov 17 20:46:35 2016 +0100 Commit: Göktürk Yüksek <gokturk@gentoo.org> CommitDate: Wed Nov 30 00:25:12 2016 -0500 function-reference/install-functions: differentiate doexe and dobin better Gentoo-Bug: 586632
Cool to see progress on this! I still wonder when to use which: Both can have their target path changed (through into/exeinto). If the file owner is the main difference: When do I not want the binary to be owned by root?
(In reply to Sebastian Pipping from comment #3) > Cool to see progress on this! > > I still wonder when to use which: Both can have their target path changed > (through into/exeinto). If the file owner is the main difference: When do I > not want the binary to be owned by root? I don't quite get the same impression. The following variables control the paths for the corresponding helpers (from portage's implementation): DESTREE - into INSDESTREE - insinto _E_EXEDESTREE - exeinto This is what dobin does: install -m0755 -o ${PORTAGE_INST_UID:-0} -g ${PORTAGE_INST_GID:-0} "${x}" "${ED}${DESTTREE}/bin" This is what doexe does: install $EXEOPTIONS "$mysrc" "$ED$_E_EXEDESTTREE_" where export DESTTREE=/usr export INSDESTTREE="" export _E_EXEDESTTREE_="" export INSOPTIONS="-m0644" export EXEOPTIONS="-m0755" are the defaults. Even though it's possible to manipulate DESTREE path for dobin using into, the developer has no full control due to "${ED}${DESTTREE}/bin". dobin always installs into a "bin" folder. Moreover, '-m0755' is hardcoded and cannot be modified. In terms of the user, dobin strictly specifies who the owner is. Conversely, doexe just inherits the owner of the phase. Usually people call doexe in src_install() which runs with root privileges, so it ends up being the same thing in practice. I think the main drive here is that dobin isn't flexible in terms of install path whereas doexe is. I think the text should be updated to reflect that. Any ideas?
Thanks for your research! (In reply to Göktürk Yüksek from comment #4) > I think the main drive here is that dobin isn't flexible in terms of install > path whereas doexe is. I think the text should be updated to reflect that. > Any ideas? How about changing the documentation on dobin to: dobin Install an executable into subfolder `bin` of the location provided by `into` (resulting in `/usr/bin` by default) with mode 0755 and with ownership set to superuser or its equivalent on the system or installation at hand.
Created attachment 760068 [details, diff] function-reference/install-functions: be more specific about dobin location Sorry for the delay. How about attached patch?
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/devmanual.git/commit/?id=59830bf240718914323abcd7e77260e7a2858080 commit 59830bf240718914323abcd7e77260e7a2858080 Author: Ulrich Müller <ulm@gentoo.org> AuthorDate: 2021-12-22 15:56:47 +0000 Commit: Ulrich Müller <ulm@gentoo.org> CommitDate: 2022-01-17 16:52:09 +0000 function-reference/install-functions: be more specific about dobin location Bug: https://bugs.gentoo.org/586632 Suggested-by: Sebastian Pipping <sping@gentoo.org> Signed-off-by: Ulrich Müller <ulm@gentoo.org> function-reference/install-functions/text.xml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
Can this bug be closed now?
(In reply to Ulrich Müller from comment #8) > Can this bug be closed now? I just re-checked the new text and to be honest the page still doesn't really help about the decision when to use which, which this ticket seems to be about at the core. Is doexe just the more flexible big brother of dobin then? So I would use dobin by default and only use doexe if I need to later more than just the target location of the binary (because dobin can already do that)? That's how I personally read it with the latest changes.