[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ltsp-developer
Subject:    Re: [Ltsp-developer] boolean_is_true()?
From:       vagrant () freegeek ! org
Date:       2008-02-21 21:38:05
Message-ID: 20080221213805.GU5297 () ryukin ! fglan
[Download RAW message or body]

On Thu, Feb 21, 2008 at 03:27:57PM -0500, Warren Togami wrote:
> ltsp-trunk/client/initscripts/ltsp-core:
> 
> boolean_is_true(){
>      case "$(echo $1 | tr 'A-Z' 'a-z')" in
>         true|y|yes) return 0 ;;
>         *) return 1 ;;
>      esac
> }
> 
> ,,,
> 
> start_sound() {
>      if boolean_is_true "$SOUND" ; then
> ...
> 
> Why not simply:
> if [ -n "$SOUND" ]; then
> 
> And make SOUND unset in /usr/lib/ltsp/ltsp_config if there is no sound 
> server?

because this makes it difficult to set SOUND=False in lts.conf. i like
the explicitness of the boolean_is_true function.

with [ -n "$FOO" ] it's far too easy to end up with code where you set a
vale to False in lts.conf and it behaves identical to setting to True.

live well,
  vagrant

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_____________________________________________________________________
Ltsp-developer mailing list.   To un-subscribe, or change prefs, goto:
      https://lists.sourceforge.net/lists/listinfo/ltsp-developer
For additional LTSP help,   try #ltsp channel on irc.freenode.net
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic