Parker Coates | 1 Jun 2009 01:37
Picon
Gravatar

Re: [RFC] reorganizing logout & suspend stuff

On Sat, May 30, 2009 at 8:02 AM, Oswald Buddenhagen wrote:
> hi,
>
> yeah, once more $SUBJECT ...
>
> while investigating some problems relating to logout & shutdown, i was
> reminded of an interesting anomaly: ksmserver shows the suspend options
> only when running under kdm (or another supported display manager),
> which is technically completely unnecessary.
>
> the current "leave" menu splits actions into those which affect only the
> current session and those which affect the entire system.
> however, there is also a second dimension: actions which terminate the
> current session and those which don't. organizing by that, one would get
> a menu which looks like that:
>
> session ->
>  leave
>    logout
>    reboot
>    shutdown
>  suspend
>    switch user
>    lock
>    standby
>    suspend to ram
>    suspend to disk
>
> from ksmserver's perspective, only the first group is interesting.
>
(Continue reading)

Armin Berres | 1 Jun 2009 03:42
Picon
Favicon

[Patch] Bashism in startkde

Heyya,

Debian and Ubuntu both want to support to use something else but
/bin/bash as /bin/sh. Therefore it is required, that all scripts whith
"#!/bin/sh" contain no bash specific code, but just POSIX features.

In startkde §$UID§ is used, which is bash specific. I propose the
following patch:

|Index: kdebase/workspace/startkde.cmake
|===================================================================
|--- kdebase/workspace/startkde.cmake    (revision 975766)
|+++ kdebase/workspace/startkde.cmake    (working copy)
| <at>  <at>  -367,7 +367,7  <at>  <at> 
| export KDE_SESSION_VERSION
| xprop -root -f KDE_SESSION_VERSION 32c -set KDE_SESSION_VERSION 4
|
|-KDE_SESSION_UID=$UID
|+KDE_SESSION_UID=$(id -ru)
| export KDE_SESSION_UID
|
| # We set LD_BIND_NOW to increase the efficiency of kdeinit.

The patch should be safe, but as this is startkde I want you to give me
a go first, before I commit.

Greetings,
Armin

(Continue reading)

David Johnson | 1 Jun 2009 04:15
Favicon
Gravatar

Re: [Patch] Bashism in startkde

On Sunday 31 May 2009 06:42:34 pm Armin Berres wrote:
>
> Debian and Ubuntu both want to support to use something else but
> /bin/bash as /bin/sh. Therefore it is required, that all scripts whith
> "#!/bin/sh" contain no bash specific code, but just POSIX features.

This has been best practice since the early days of bash (and ksh). While bash 
will run Bourne/POSIX shells scripts flawless, the reverse is not true. Debian 
(and most derivatives), Slackware, *BSD, Solaris, many embedded Linuxes, etc, 
don't have bash linked to /bin/sh.

--

-- 
David Johnson

Christoph Feck | 1 Jun 2009 07:19
Picon

Review Request: Optimize bad_ports check in KIO::precheckHttpPost()


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.kde.org/r/786/
-----------------------------------------------------------

Review request for kdelibs.

Summary
-------

While browsing "job.cpp" I noticed that KIO uses a simple loop to check for bad ports. Most times, however,
port 80 is passed, and this patch adds a check for this. Additionally, this patch uses qBinaryFind,
instead of a loop.

Maybe some Qt/core wizard can comment on the correct usage (and actual improvement) of qBinaryFind,
especially the "end" iterator :)

Diffs
-----

  /kde/trunk/KDE/kdelibs/kio/kio/job.cpp 976137 

Diff: http://reviewboard.kde.org/r/786/diff

Testing
-------

Compiles, and I am able to use Konqueror as before. I did not test any illegal ports.

(Continue reading)

Christoph Feck | 1 Jun 2009 07:21
Picon

Re: Review Request: Optimize bad_ports check in KIO::precheckHttpPost()


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.kde.org/r/786/
-----------------------------------------------------------

(Updated 2009-05-31 22:21:53.692629)

Review request for kdelibs.

Summary
-------

While browsing "job.cpp" I noticed that KIO uses a simple loop to check for bad ports. Most times, however,
port 80 is passed, and this patch adds a check for this. Additionally, this patch uses qBinaryFind,
instead of a loop.

Maybe some Qt/core wizard can comment on the correct usage (and actual improvement) of qBinaryFind,
especially the "end" iterator :)

Diffs (updated)
-----

  /trunk/KDE/kdelibs/kio/kio/job.cpp 976137 

Diff: http://reviewboard.kde.org/r/786/diff

Testing
-------

(Continue reading)

Thiago Macieira | 1 Jun 2009 08:51
Picon
Favicon

Re: [Patch] Bashism in startkde

Armin Berres wrote:
>|-KDE_SESSION_UID=$UID
>|+KDE_SESSION_UID=$(id -ru)

Isn't $() another extension? Shouldn't we use `` instead?
--

-- 
  Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
Thiago Macieira | 1 Jun 2009 08:57
Picon
Favicon

Re: Review Request: Optimize bad_ports check in KIO::precheckHttpPost()

Christoph Feck wrote:
>-----------------------------------------------------------
>This is an automatically generated e-mail. To reply, visit:
>http://reviewboard.kde.org/r/786/
>-----------------------------------------------------------
>
>(Updated 2009-05-31 22:21:53.692629)
>
>
>Review request for kdelibs.
>
>
>Summary
>-------
>
>While browsing "job.cpp" I noticed that KIO uses a simple loop to check
> for bad ports. Most times, however, port 80 is passed, and this patch
> adds a check for this. Additionally, this patch uses qBinaryFind,
> instead of a loop.
>
>Maybe some Qt/core wizard can comment on the correct usage (and actual
> improvement) of qBinaryFind, especially the "end" iterator :)

Patch makes sense, but it's also an overkill.

Changing the for continuation loop to bad_ports[cnt] && bad_ports[cnt] <= 
port would be enough.

Also, caching the value of url.port() would be an improvement too (which 
your patch already does).
(Continue reading)

Sune Vuorela | 1 Jun 2009 10:13
Picon

Re: [Patch] Bashism in startkde

On 2009-06-01, Thiago Macieira <thiago <at> kde.org> wrote:
> --nextPart2186971.jIeMmLFcJD
> Content-Type: Text/Plain;
>   charset="utf-8"
> Content-Transfer-Encoding: quoted-printable
>
> Armin Berres wrote:
>>|-KDE_SESSION_UID=3D$UID
>>|+KDE_SESSION_UID=3D$(id -ru)
>
> Isn't $() another extension? Shouldn't we use `` instead?

It depends on what you call "extension".
$() is posix shell, but afaik not supported by the original Bourne
Shell. No one uses Bourne Shell today though.

I just tested:

FOO=$(id -u)
echo $FOO

and I get the expected output in
bash
dash 
posh  
pdksh
ksh93
mksh
zsh

(Continue reading)

David Jarvie | 1 Jun 2009 10:24
Picon
Favicon

Re: [RFC] reorganizing logout & suspend stuff

On Mon, June 1, 2009 12:37 am, Parker Coates wrote:
> On Sat, May 30, 2009 at 8:02 AM, Oswald Buddenhagen wrote:
>> hi,
>>
>> yeah, once more $SUBJECT ...
>>
>> while investigating some problems relating to logout & shutdown, i was
>> reminded of an interesting anomaly: ksmserver shows the suspend options
>> only when running under kdm (or another supported display manager),
>> which is technically completely unnecessary.
>>
>> the current "leave" menu splits actions into those which affect only the
>> current session and those which affect the entire system.
>> however, there is also a second dimension: actions which terminate the
>> current session and those which don't. organizing by that, one would get
>> a menu which looks like that:
>>
>> session ->
>>  leave
>>    logout
>>    reboot
>>    shutdown
>>  suspend
>>    switch user
>>    lock
>>    standby
>>    suspend to ram
>>    suspend to disk
>>
>> from ksmserver's perspective, only the first group is interesting.
(Continue reading)

Thiago Macieira | 1 Jun 2009 10:41
Picon
Favicon

Re: [Patch] Bashism in startkde

Sune Vuorela wrote:
>On 2009-06-01, Thiago Macieira <thiago <at> kde.org> wrote:
>> --nextPart2186971.jIeMmLFcJD
>> Content-Type: Text/Plain;
>>   charset="utf-8"
>> Content-Transfer-Encoding: quoted-printable
>>
>> Armin Berres wrote:
>>>|-KDE_SESSION_UID=3D$UID
>>>|+KDE_SESSION_UID=3D$(id -ru)
>>
>> Isn't $() another extension? Shouldn't we use `` instead?
>
>It depends on what you call "extension".
>$() is posix shell, but afaik not supported by the original Bourne
>Shell. No one uses Bourne Shell today though.
>
>I just tested:
>
>FOO=$(id -u)
>echo $FOO
>
>and I get the expected output in
>bash
>dash
>posh
>pdksh
>ksh93
>mksh
>zsh
(Continue reading)


Gmane