Deciding what gconf defaults to install at postinst

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Deciding what gconf defaults to install at postinst

Gustavo Noronha Silva
Hello,

I may need to provide a default gconf setting for my package based on a
debconf setting. Any suggestions on how to do such a thing? Is anyone
doing it?

The specific usage would be for gksu to determine whether it should use
su or sudo as default backend. Would an alternative (for
update-alternatives) for the schema file do fine, or that seems broken?

Thanks,

--
Gustavo Noronha Silva <[hidden email]>
http://people.debian.org/~kov/


--
To UNSUBSCRIBE, email to [hidden email]
with a subject of "unsubscribe". Trouble? Contact [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Deciding what gconf defaults to install at postinst

Josselin Mouette
Le mardi 22 août 2006 à 23:53 -0300, Gustavo Noronha Silva a écrit :
> Hello,
>
> I may need to provide a default gconf setting for my package based on a
> debconf setting. Any suggestions on how to do such a thing? Is anyone
> doing it?
>
> The specific usage would be for gksu to determine whether it should use
> su or sudo as default backend. Would an alternative (for
> update-alternatives) for the schema file do fine, or that seems broken?

I think you shouldn't use debconf for that. The default should be to use
the sudo backend if sudo is installed, su otherwise. In all cases that
can be done with an alternative or a diversion on the *defaults* file.
You should not modify the schema file anyway, only use a defaults file
in /use/share/gconf/defaults.
--
 .''`.           Josselin Mouette        /\./\
: :' :           [hidden email]
`. `'                        [hidden email]
   `-  Debian GNU/Linux -- The power of freedom

Reply | Threaded
Open this post in threaded view
|

Re: Deciding what gconf defaults to install at postinst

Josselin Mouette
Le mercredi 23 août 2006 à 10:35 +0200, Josselin Mouette a écrit :

> Le mardi 22 août 2006 à 23:53 -0300, Gustavo Noronha Silva a écrit :
> > Hello,
> >
> > I may need to provide a default gconf setting for my package based on a
> > debconf setting. Any suggestions on how to do such a thing? Is anyone
> > doing it?
> >
> > The specific usage would be for gksu to determine whether it should use
> > su or sudo as default backend. Would an alternative (for
> > update-alternatives) for the schema file do fine, or that seems broken?
>
> I think you shouldn't use debconf for that. The default should be to use
> the sudo backend if sudo is installed, su otherwise. In all cases that
> can be done with an alternative or a diversion on the *defaults* file.
> You should not modify the schema file anyway, only use a defaults file
> in /use/share/gconf/defaults.

On second thought there is a much simpler option than alternatives or
diversions. Ship a debian/gconf-defaults file in the gksu source,
containing the following:
        /apps/gksu/sudo-mode    false
(Or don't ship anything, if this is the default.)

Then, ship a debian/gconf-defaults file in the sudo source, with the
following:
        /apps/gksu/sudo-mode    true
and call in the rules file:
        dh_gconf --priority 15

This way, the default from the sudo package will override that of the
gksu package. If gksu isn't installed, it doesn't break anything.
(Of course sudo shouldn't depend on ${misc:Depends} in this case, so
that it doesn't bring gconf2 automatically.)
--
 .''`.           Josselin Mouette        /\./\
: :' :           [hidden email]
`. `'                        [hidden email]
   `-  Debian GNU/Linux -- The power of freedom

Reply | Threaded
Open this post in threaded view
|

Re: Deciding what gconf defaults to install at postinst

Loïc Minier
In reply to this post by Gustavo Noronha Silva
On Tue, Aug 22, 2006, Gustavo Noronha Silva wrote:
> The specific usage would be for gksu to determine whether it should use
> su or sudo as default backend. Would an alternative (for
> update-alternatives) for the schema file do fine, or that seems broken?

 Gedit has a list of charsets to try when it loads a file
 (/apps/gedit-2/preferences/encodings/auto_detected), for example:
 [UTF-8,CURRENT,ISO-8859-15] means to try Utf-8, then the encoding of
 the locale (might be Utf-8 or -16 and fail), then ISO.
   I suggest you use a list of backends as the configuration item
 instead of one backend: [sudo,su].  People can still force su or sudo
 via Gconf, and they can even change the order or preference without
 rebuilding the package.

--
Loïc Minier <[hidden email]>


--
To UNSUBSCRIBE, email to [hidden email]
with a subject of "unsubscribe". Trouble? Contact [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Deciding what gconf defaults to install at postinst

Gustavo Noronha Silva
In reply to this post by Josselin Mouette
Em Wed, 23 Aug 2006 11:47:56 +0200
Josselin Mouette <[hidden email]> escreveu:

> Then, ship a debian/gconf-defaults file in the sudo source, with the
> following:
> /apps/gksu/sudo-mode    true
> and call in the rules file:
> dh_gconf --priority 15

I have sudo installed, but I want su to be the default backend. Many
people could end up having sudo installed but not configuring it to
work for the usual gksu usage.

The context here is a new step in debian-installer which allows the
user to use the su model or the sudo ubuntu-like model of
administration; should debian-installer install files such as
gconf-defaults?

See you,

--
Gustavo Noronha Silva <[hidden email]>
http://people.debian.org/~kov/


--
To UNSUBSCRIBE, email to [hidden email]
with a subject of "unsubscribe". Trouble? Contact [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Deciding what gconf defaults to install at postinst

Josselin Mouette
Le mercredi 23 août 2006 à 14:29 -0300, Gustavo Noronha Silva a écrit :
> I have sudo installed, but I want su to be the default backend. Many
> people could end up having sudo installed but not configuring it to
> work for the usual gksu usage.
>
> The context here is a new step in debian-installer which allows the
> user to use the su model or the sudo ubuntu-like model of
> administration; should debian-installer install files such as
> gconf-defaults?

In this case, alternatives will do the trick (not forgetting to call
update-gconf-defaults after each call to update-alternatives), but I
happen to prefer lool's solution.
--
 .''`.           Josselin Mouette        /\./\
: :' :           [hidden email]
`. `'                        [hidden email]
   `-  Debian GNU/Linux -- The power of freedom