KDE env broken in startkde because of dash?

Bug #179060 reported by caribo
2
Affects Status Importance Assigned to Milestone
kdebase (Ubuntu)
Invalid
Undecided
Daniel Hahler

Bug Description

Binary package hint: ksmserver

I have a number of scripts in ~/.kde/env folder to setup various KDE environment variables including KDEWM.

Startkde has a shebang of /bin/sh and /bin/sh is linked by default to dash

The following code in startkde does not work correctly under dash...

exepath=`kde-config --path exe | tr : '\n'`

for prefix in `echo "$exepath" | sed -n -e 's,/bin[^/]*/,/env/,p'`; do
  for file in "$prefix"*.sh; do
    test -r "$file" && . "$file"
  done
done

tested using the following shell script under bash and dash...

exepath=`kde-config --path exe | tr : '\n'`

for prefix in `echo "$exepath" | sed -n -e 's,/bin[^/]*/,/env/,p'`; do
  for file in "$prefix"*.sh; do
        echo prefix = $prefix , file = $file
  done
done

which returns the following under bash (OK): -

prefix = /home/paul/.kde/env/ , file = /home/paul/.kde/env/compiz.sh
prefix = /home/paul/.kde/env/ , file = /home/paul/.kde/env/gtk-qt-engine.rc.sh
prefix = /usr/env/ , file = /usr/env/*.sh

and this under dash (NOTOK): -

prefix = /home/paul/.kde/env/ , file = /home/paul/.kde/env/compiz.sh /home/paul/.kde/env/gtk-qt-engine.rc.sh
prefix = /usr/env/ , file = /usr/env/*.sh

...hence the startkde line (test -r "$file" && . "$file") does not work and scripts do not get executed.

WORKAROUND: link /bin/sh to bash

Revision history for this message
Daniel Hahler (blueyed) wrote :

This is caused by a regression is dash (bug 177032).
I'll provide a debdiff to work around it in a minute.

Changed in kdebase:
assignee: nobody → blueyed
status: New → In Progress
Revision history for this message
Daniel Hahler (blueyed) wrote :

As far as I can see, we cannot apply the same workaround here as with bug 177033, because it would break with directories/user names which include spaces.
While this is normally not allowed, it may be possible and I believe that the real bug should be fixed instead.
Therefore I'm marking it as duplicate of bug 177032, where at least the cause/commit has been found.

Changed in kdebase:
status: In Progress → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.