Summary: | sys-apps/portage - bashrc problems introduced by update | ||
---|---|---|---|
Product: | Portage Development | Reporter: | Nick Bowler <nbowler> |
Component: | Unclassified | Assignee: | Portage team <dev-portage> |
Status: | CONFIRMED --- | ||
Severity: | normal | CC: | tsmksubc |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: | https://bugs.gentoo.org/show_bug.cgi?id=636672 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: | Full emerge output from failing command. |
Description
Nick Bowler
2017-11-23 22:36:06 UTC
It works fine for me. I would guess that you have either modified the binutils ebuild, or you have some weird code in /etc/portage/bashrc. (In reply to Mike Gilbert from comment #1) > I would guess that you have either modified the binutils ebuild, or you have > some weird code in /etc/portage/bashrc. You are right, crossdev was a red herring. The awk call is in my bashrc. Not sure why bashrc is suddenly broken now but I changed it to use command -p awk and now metadata generation works again... Assuming this change was intentional perhaps the portage documentation (e.g., man 5 portage) should note that bashrc is run with a bogus PATH. Thanks. NOTE: It's possible to avoid having die by using [[ ${EBUILD_PHASE} != depend ]] conditionals, like this: if [[ ${EBUILD_PHASE} != depend ]]; then # safely execute commands in global scope here echo "hello world" fi (In reply to Zac Medico from comment #3) > NOTE: It's possible to avoid having die by using [[ ${EBUILD_PHASE} != > depend ]] conditionals, like this: > > > if [[ ${EBUILD_PHASE} != depend ]]; then > # safely execute commands in global scope here > echo "hello world" > fi You posted just before I did, Zac. :-) I've been doing something similar. As long as your /etc/portage/bashrc doesn't need to be sourced during dependency resolution for some reason, you could try a variation of Zac's workaround, with reversed logic. Just make this the fist line of code in your bashrc (outside of any functions): [[ ${EBUILD_PHASE} != depend ]] || return 0 This line will cause the sourced bashrc to bail out safely during the "depend" phase. It will also always return success so as to avoid frightening any callers. Then you can safely fire away like you always have without having to change anything else. I use return statements frequently to avoid having my package bashrc scripts executed repeatedly. I agree with the OP that the potential side effects of disallowing commands in the global scope could use some documenting. I think it's a good idea, just think it could have been documented. Both good suggestions, thanks. None of my bashrc bits matter during dependency generation, so I think I will do something similar. |