Justification: When Gentoo Prefix is not the user's main system, it may be useful to create wrapper scripts in ~/bin/. Implementation: # As far as I can tell, this is the simplest way to still execute login scripts. # Unfortunately, bash seems to skip the logout script... # that's an unrelated bug though. if [ $# -eq 0 ] then env -i HOME=$HOME TERM=$TERM USER=$USER SHELL=$SHELL $DOPROFILEREAD $SHELL -l else env -i HOME=$HOME TERM=$TERM USER=$USER SHELL=$SHELL $DOPROFILEREAD $SHELL -l -c '"$@"' iminurshellstartingyourprogs "$@" fi
Would you like to prepare a patch? I don't really like the idea myself, but if the patch is small and non-intrusive, I don't mind applying it.
Created attachment 337694 [details, diff] allow startprefix to take arguments Okay, here goes. It should be obvious that it does nothing different in the case of having no arguments. I found a workaround for the bash bug - ~/.bash_logout *is* called when 'exit'ing explicitly, just not when falling off the end of the -c. Disclaimer: not tested with shells other than bash. However, it will probably work.
how about env -i HOME=$HOME TERM=$TERM USER=$USER SHELL=$SHELL $DOPROFILEREAD ${EPREFIX}/bin/bash -c "$1" -prefix-bash "$@" instead? (it doesn't indeed work with all other shells, and since you're just executing a command, why bother doing that with the user's shell)
(In reply to Fabian Groffen from comment #3) > env -i HOME=$HOME TERM=$TERM USER=$USER SHELL=$SHELL $DOPROFILEREAD > ${EPREFIX}/bin/bash -c "$1" -prefix-bash "$@" That doesn't work at all. It just executes $1 without arguments, since the $@ is passed to the shell, but the shell doesn't pass them to $1. You need to have "$@" somewhere within the -c argument, which itself is surrounded by ''. Also, to prevent unwanted whitespace splits in the child, you really can't split the command separately. Of course, hard-coding shell=bash would otherwise work with my patch.
I'm pretty sure you've found a workaround by now, sorry for not following up in a timely manner.