xjed package should provide jed via alternatives

Rafael Laboissiere rafael at debian.org
Tue Oct 30 14:56:55 UTC 2007


* G. Milde <milde at users.sourceforge.net> [2007-10-30 13:46]:

> On 23.10.07, Rafael Laboissiere wrote:
> > * G. Milde <g.milde at quantentunnel.de> [2007-10-23 10:38]:
> 
> > > the xjed package
> > > should provide the `jed` command via the alternatives system.
> > > 
> > > Idea: 
> > > 
> > > Package xjed should:
> > > 
> > >  * save the above wrapper as `xjed-without-x` on a sensible place.
> > >  * register it as /usr/bin/jed  with alternatives
> > > 
> > > Package jed should:
> > > 
> > >  * save the jed executable under a different name
> > >  * register it as /usr/bin/jed with a higher priority than xjed-without-x 
> 
> > This is an excellent proposal.  Would you implement it?
> 
> Actually, my knowledge of the alternatives system is limited.
> Also, what would be a "sensible" place or name to store the actual binaries
> under?

The implementation should not be hard.  Let us say that the packages install
the following files:

    * jed:
        /usr/bin/jed-console
    * xjed:
        /usr/bin/xjed-without-x (the script you proposed)

Then, the postinst scripts should contain the following (inside the
"configure" conditional):

    * debian/jed.postinst:
         update-alternatives                        \
             --install /usr/bin/jed jed             \
                       /usr/bin/jed-console  90

    * debian/xjed.postinst:
         update-alternatives                        \
             --install /usr/bin/jed jed             \
                       /usr/bin/xjed-without-x  80

Note the priorities 90 and 80 to jed-console and xjed-without-x,
respectively.  You may adjust those.  
	
The prerm scripts should contain:

    * debian/jed.prerm:
         update-alternatives --remove jed /usr/bin/jed-console

    * debian/xjed.prerm:
         update-alternatives --remove jed /usr/bin/xjed-without-x

A related question: should the xjed package "Provides: jed"?  

-- 
Rafael



More information about the Pkg-jed-devel mailing list