FS#36959 - [xorg-xinit/gcc?] Empty lines before #!/bin/sh in startx
Attached to Project:
Arch Linux
Opened by Leonid Isaev (lisaev) - Monday, 16 September 2013, 22:43 GMT
Last edited by Andreas Radke (AndyRTR) - Sunday, 27 October 2013, 15:14 GMT
Opened by Leonid Isaev (lisaev) - Monday, 16 September 2013, 22:43 GMT
Last edited by Andreas Radke (AndyRTR) - Sunday, 27 October 2013, 15:14 GMT
|
Details
Since xinit 1.3.3 (but the problem is also present in git),
the startx shell script contains lots of empty lines before
the shebang. This confuses bash making it start additional
login shell ('-bash' in ps(1)).
Apparently, this is not an upstream issue [1] and it was suggested that cpp is to blame... THanks, Leonid. [1] https://bugs.freedesktop.org/show_bug.cgi?id=69439 |
This task depends upon
Closed by Andreas Radke (AndyRTR)
Sunday, 27 October 2013, 15:14 GMT
Reason for closing: Fixed
Additional comments about closing: 1.3.3-2
Sunday, 27 October 2013, 15:14 GMT
Reason for closing: Fixed
Additional comments about closing: 1.3.3-2
...
if [[ $XDG_VTNR == 1 ]]; then
[[ -e $HOME/.startx ]] || (/usr/bin/uniq /usr/bin/startx |\
sed -n '/^#!/,$p' > $HOME/.startx && chmod 755 $HOME/.startx)
[[ -x $HOME/.startx ]] && $HOME/.startx &> $HOME/xsession.log
fi
And the additional login shell disappears.
I agree with Allan in that cpp is not supposed to be a sed replacement. But I also think this bug unlikely to be fixed upstream which most likely used cpp for portability reasons. Moreover, wayland is on the horizon, so I don't know how relevant this xorg package will be.
Hence, I suggest to fix this in package(), e.g.
sed -i '/^\s*$/d' $pkgdir/usr/bin/startx
sed -i '/^\s*$/d' $pkgdir/etc/X11/xinit/xinitrc