[Sugar-devel] Check for binaries, not config files, when deciding if a tool is installed

Jonas Smedegaard dr at jones.dk
Thu Sep 10 10:25:26 EDT 2009


On Thu, Sep 10, 2009 at 03:09:12PM +0200, Sascha Silbe wrote:
>On Thu, Sep 10, 2009 at 02:41:15PM +0200, Jonas Smedegaard wrote:
>
>>Not sure, but it seems from src/sugar/activity/activityfactory.py  
>>(approx. line 250) of recent sugar-toolkit that rainbow is used if 
>>the   path /etc/olpc-security exists on the system.
>The intention is to be able to de/activate Rainbow use inside Sugar 
>without uninstalling Rainbow. Maybe we should parse the file contents 
>(i.e. store something in it) instead of just checking for existence.

I see.  there is nothing technically wrong in using the existence of a 
file or directory as a "configuration flag".  Debian does so with 
/etc/nologin .

Just beware that if same file/folder also contains some other data, you 
make it awkward for users (i.e. admins) to manipulate such "flag", as 
simply "remove that file to disable the feature" causes potential loss 
of other customizations, and "rename file foo to foo.off" might cause 
problems as foo.off might exist already.



>>If that is correct, then I recommend changing that to instead test 
>>for   the existence of some binary, as the Debian packaging system 
>>(and most  probably other packaging systems as well) preserve 
>>configuration files  when removing a package.
>An additional check for existence of the binary might be a good idea.

Indeed: If (as you write above) the intend of /etc/olpc-security check 
is for local admin configuration, then the code lack a check for sanity 
of considering rainbow at all:

if rainbow is installed:
   if rainbow is enabled:
     use rainbow

It seems to me that the code currently does not check if rainbow is 
installed, only if some rainbow config space exist - which seems wrong 
to me.


Kin regards,

  - Jonas

-- 
* Jonas Smedegaard - idealist & Internet-arkitekt
* Tlf.: +45 40843136  Website: http://dr.jones.dk/

  [x] quote me freely  [ ] ask before reusing  [ ] keep private
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
Url : http://lists.sugarlabs.org/archive/sugar-devel/attachments/20090910/172ae954/attachment.pgp 


More information about the Sugar-devel mailing list