On Thu, 2007-04-19 at 15:55 -0400, Laszlo (Laca) Peter wrote:
> Jedy,
> 
> Can you add some comment lines that explain what's happening?
> Also, it's more readable if you use variables for long gconf
> key names that appear multiple times, e.g.
> 
> APPLET_LIST_KEY=/apps/panel/default_setup/general/applet_id_list_jds
> ...
> 
> What are all the sed commands for?
> 
> Thanks,
> Laca

Hi Laca,

> 
> On Thu, 2007-04-19 at 17:56 +0800, Jedy Wang wrote:
> >    echo '$PKG_INSTALL_ROOT/usr/bin/gconftool-2 --makefile-uninstall-rule 
> > $schemas'
> > +  echo 'test -c /devices/pseudo/battery at 0:battery0 && {';
> > +  echo '       $PKG_INSTALL_ROOT/usr/bin/gconftool-2  --direct 
> > --config-source=$GCONF_CONFIG_SOURCE --unload 
> > $SDIR/panel-default-setup-laptop.entries';
> > +  echo '       $PKG_INSTALL_ROOT/usr/bin/gconftool-2  --direct 
> > --config-source=$GCONF_CONFIG_SOURCE --unload 
> > $SDIR/panel-default-setup-laptop.entries /apps/panel/profiles/default';

These 2 lines were copied from SUNWgnome-panel.spec. They will load the
gconf entries in the file into gconf database.

> > +  echo '       APPLETS=`gconftool-2 --direct 
> > --config-source=$GCONF_CONFIG_SOURCE --owner=panel --get 
> > /apps/panel/default_setup/general/applet_id_list_jds | sed  -n 
> > "s/\(\[.*\),battstat\(\]\)/\1\\2/p"`';
> > +  echo '       gconftool-2 --direct --config-source=$GCONF_CONFIG_SOURCE 
> > --owner=panel --unset /apps/panel/default_setup/general/applet_id_list_jds'
> > +  echo '       gconftool-2 --direct --config-source=$GCONF_CONFIG_SOURCE 
> > --owner=panel --type=list --list-type=string --set 
> > /apps/panel/default_setup/general/applet_id_list_jds $APPLETS'

These 3 lines will modify the
list /apps/panel/default_setup/general/applet_id_list_jds. The 1st line
will get the list value from gconf database and the sed command will
insert ",battssat" into the value. So the list value will be changed
from [a,b,c] to [a,b,c,battstat]. The 2nd line will unset the list
value. The 3rd line will set the list value to [a,bc,c,battstat].

> > +  echo '       APPLETS=`gconftool-2 --direct 
> > --config-source=$GCONF_CONFIG_SOURCE --owner=panel --get 
> > /apps/panel/profiles/default/general/applet_id_list_jds | sed  -n 
> > "s/\(\[.*\),battstat\(\]\)/\1\\2/p"`';
> > +  echo '       gconftool-2 --direct --config-source=$GCONF_CONFIG_SOURCE 
> > --owner=panel --unset 
> > /apps/panel/profiles/default/general/applet_id_list_jds'
> > +  echo '       gconftool-2 --direct --config-source=$GCONF_CONFIG_SOURCE 
> > --owner=panel --type=list --list-type=string --set 
> > /apps/panel/profiles/default/general/applet_id_list_jds $APPLETS'

These 3 lines are almost the same with the previous 3 lines, but will
modify the list /apps/panel/profiles/default/general/applet_id_list_jds.

> > +  echo '}'; 
> 


Reply via email to