SRU? bashism in startkde

Bug #688518 reported by Achim Bohnet
16
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Kubuntu PPA
Fix Released
Undecided
Unassigned
kdebase-workspace (Ubuntu)
Fix Released
Undecided
Unassigned
Maverick
Fix Released
Medium
Scott Kitterman

Bug Description

== test operator is not defined in posix shell /bin/sh -> dash

== is used 2 times in startkde:

(0)allee@alleehol:~$ grep -n == /usr/bin/start*
/usr/bin/startkde:238: if `laptop-detect` && [ $HEIGHT -lt 700 ] && [ $HEIGHT -gt 0 ] && [ -z $CDROM ] || [ $1 == "netbook" ]; then
/usr/bin/startkde:248: if [ "$1"=="mobile" ] ; then

Here == without space is used so even parsing is wrong as it's considered as one word not 3. As the work is not emtpy it evaluates to true:

(0)allee@alleehol:~$ /bin/sh
$ if [ "$1"=="mobile" ] ; then echo foo; fi
foo
$ echo "$1"

Here the standard == bashism bug:

$ [ $1 == "netbook" ] && echo foo
[: 5: ==: unexpected operator

Revision history for this message
Achim Bohnet (allee) wrote :
Revision history for this message
Achim Bohnet (allee) wrote :

Opinion about a SRU as the bug is already in maverick kdebase-runtime-bin 4%3a4.5.1-0ubuntu8.

1.==: passing forcing netbook mode (test is in 'or' branch) as arg1 to startkde does not work. I assume more a developer /debug feature.

2.==: as soon as/usr/share/kubuntu-mobile-default-settings/share/autostart/plasma-mobile.desktop exits, KDEDIRS is always set to use mobile defaults. With the fix KDEDIR is only set if startkde is called with mobile as arg1.

So IMHO only extended (devel) feature are not working. Not worth a SRU on it's own. Better wait until something important is found and let bashism fix slip in then.

But the mobile and netbook users/devs have a different POV what is important.

Achim Bohnet (allee)
Changed in kubuntu-ppa:
status: New → Fix Committed
Achim Bohnet (allee)
summary: - bashism in startkde
+ SRU? bashism in startkde
tags: added: patch
Revision history for this message
Philip Muškovac (yofel) wrote :

Fixed by Jonathan in Natty

kdebase-workspace (4:4.5.85-0ubuntu3) natty; urgency=low

  * Remove bashism in kubuntu_108_plasma_netbook_for_small_screens.diff,
    thanks to Achim

 -- Jonathan Riddell <email address hidden> Fri, 10 Dec 2010 12:29:26 +0000

Changed in kdebase-workspace (Ubuntu):
status: New → Fix Released
Changed in kdebase-workspace (Ubuntu Maverick):
assignee: nobody → Scott Kitterman (kitterman)
importance: Undecided → Medium
milestone: none → maverick-updates
status: New → In Progress
Revision history for this message
Martin Pitt (pitti) wrote : Please test proposed package

Accepted into maverick-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in kdebase-workspace (Ubuntu Maverick):
status: In Progress → Fix Committed
Revision history for this message
Achim Bohnet (allee) wrote :

Brown paper bag on :( On the good side only a developer debugging feature does not work as expected.

My patch was not complete. Additionally $1 in [ $1 = "netbook" ] need to be quoted. With the maverick-proposed pkgs I still get in .xsession-errors

...
Start IM through /etc/X11/xinit/xinput.d/all_ALL linked to /etc/X11/xinit/xinput.d/default.
[: 225: =: unexpected operator
startkde: Starting up...
...

That due to $1 not defined when startkde is started by kdm.

root@lap-allee:~# dash
# [ $x = 'bla' ] && echo foo
[: 3: =: unexpected operator
# x=foo
# [ $x = 'bla' ] && echo foo
#

Appended patch fixes it.

Revision history for this message
Achim Bohnet (allee) wrote :
Revision history for this message
Scott Kitterman (kitterman) wrote :

Maverick correction uploaded.

Revision history for this message
Martin Pitt (pitti) wrote :

Accepted kdebase-workspace into maverick-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

tags: added: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package kdebase-workspace - 4:4.5.5-0ubuntu2.1

---------------
kdebase-workspace (4:4.5.5-0ubuntu2.1) maverick-proposed; urgency=low

  * Fix missing quotes in kubuntu_108_plasma_netbook_for_small_screens.diff
    - Fixing LP: #688518 a little harder
 -- Scott Kitterman <email address hidden> Thu, 14 Apr 2011 11:04:50 -0400

Changed in kdebase-workspace (Ubuntu Maverick):
status: Fix Committed → Fix Released
Revision history for this message
demilord (demilord) wrote :

this patch should be ported to kubuntu 11.04

Revision history for this message
Scott Kitterman (kitterman) wrote :

It already is.

Revision history for this message
Ruben (info-rubenfelix) wrote : Re: [Bug 688518] Re: SRU? bashism in startkde

Hey!

Bedankt voor je mail! Ik ben er even tussenuit geknepen naar een lekker warm land! Ik beantwoord je mail na mijn vakantie (11 oktober).

Groetjes!

Ruben

Philip Muškovac (yofel)
Changed in kubuntu-ppa:
status: Fix Committed → Fix Released
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.