[Pkg-octave-devel] Re: update-alternatives and Octave packages

Rafael Laboissiere rafael at debian.org
Thu Feb 9 16:48:30 UTC 2006


* John W. Eaton <jwe at bevo.che.wisc.edu> [2006-02-09 10:24]:

> On  9-Feb-2006, Rafael Laboissiere wrote:
> 
> | Yes, by using the /etc/alternatives mechanism.  We are already doing this
> | for a bunch of other files.
> 
> I have a question about the way the alternatives mechanism is used.
> When I tried to use it, I ran
> 
>   update-alternatives --config octave
> 
> and selected my preferrred version.  I thought that would switch all
> Octave-related links to the same version, but it only switched Octave.
> Then when I ran mkoctfile, I build a .oct file for the other version,
> which did not work with the octave binary that started when I typed
> mkoctfile.  I don't think most users will know to run
> update-alternatives for all these.  Would it be possible to have
> update-alternatives switch the links for mkoctfile, octave,
> octave-bug, octave-config, and octave-depends all at once?

Yes, it is possible in principle by using the --slave option of
update-alternatives in the postinst script.  We are doing now:

    for f in octave octave-bug ; do 
        update-alternatives  --install /usr/bin/$f $f \
                                       /usr/bin/$f-$VERSION $PRIORITY \
                             --slave /usr/share/man/man1/$f.1.gz $f.1.gz \
                                     /usr/share/man/man1/$f-$VERSION.1.gz
    done

but we could do instead:

     update-alternatives  --install /usr/bin/octave octave \
                                   /usr/bin/octave-$VERSION $PRIORITY \
                          --slave /usr/share/man/man1/octave.1.gz octave.1.gz \
                                  /usr/share/man/man1/octave-$VERSION.1.gz \
                          --slave /usr/bin/octave-bug octave-bug \
                                  /usr/share/man/man1/octave-bug-$VERSION
			     

However, the octave and octave-bug commands are in the octave2.* package
while mkoctfile, octave, and octave-config are in octave2.*-headers.  I
do not now how to unify the code in the postinst scripts of different
packages.  If someone has an idea, please post here.

-- 
Rafael



More information about the Pkg-octave-devel mailing list