This is really not a big deal, it may however indicate some more serious problem? I don't know. In an ebuild, in order to output a \ (backslash), one has to issue the command einfo "\\". OK. One would expect that in order to output \\ one would have to issue einfo "\\\\". The latter, however, prints a single \. In fact, einfo "\\\\\\" and einfo "\\\\\\\\" produce double backslashes. Reproducible: Always Steps to Reproduce: 1. have the line einfo "\\\\" in an ebuild. 2. emerge that ebuild Actual Results: The output is \. Expected Results: The output is \\. just out of interest, I did not find the code for einfo. Where is it?
it is defined in /sbin/functions.sh and then ebuild.sh sources it early on einfo "\\ \\" works fine ... you get '\ \' ... einfo uses 'echo -e "blah"' ... if you do `echo -e "\\\\"` at a cmd prompt you get the 'bug' ... in other words i dont think its something we can change :/
I see. So echo really acts in an unexpected way (for me, that is). I agree that protage should not be changed but echo should (which, of course, is outside of gentoo's realm). The echo manpage says "\\ backslash", which should imply "\\\\ backslashbackslash". I really need to output \\ as opposed to \ \, as it is part of a line one must add to .emacs exactly as is. The persistent workaround is einfo "\x5c\x5c", by the way.
OK, the behaviour of both einfo and echo is completely normal, sorry for my confusion. By typing echo -e "something", something gets evaluated by the shell first, and the result gets evaluated by echo. So echo -e "\\\\" has the same effect as echo -e '\\' which would be to output \. The same goes for einfo. If one does not want to have the argument of einfo being processed by bash, one can simply use single quotes.
so this can be closed