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

Colin Ingram synergizedmusic at gmail.com
Fri Feb 10 09:22:05 UTC 2006


On 2/10/06, Rafael Laboissiere <rafael at debian.org> wrote:

>
> It might be possible to write a script (called, say,
> /usr/bin/octave-update-alternatives) which will be called from the
> postinst scripts of both octave2.* and octave2.*-headers packages.  This
> script would install the alternatives with the appropriate slave links
> according to the presence or absence of the octave2.*-headers in the
> system.  I have not yet tested this idea, though, so I do not know if it
> really works.  I will give a try next week, unless someone else beats me
> on that.

this is exactly what i was thinking and this is what I did. proof of
concept, complete patch forthcoming. you'll obviously want to test for
the existence of octave-headers files.

--- octave2.1.postinst.old	2006-02-10 03:13:07.000000000 -0600
+++ ../octave2.1-2.1.72/debian/octave2.1.postinst	2006-02-10
03:05:06.000000000 -0600
@@ -33,7 +33,9 @@
  			--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
+				/usr/share/man/man1/$f-$VERSION.1.gz    \
+			--slave /usr/bin/octave-config octave-config	\
+				/usr/bin/octave-config-$VERSION
 	done

 	;;


colin at jane:~/data/debian/octave/octave2.1/octave2.1-2.1.72/debian$
sudo ./octave2.1.postinst configure

colin at jane:~/data/debian/octave/octave2.1/octave2.1-2.1.72/debian$
sudo update-alternatives --display octave
octave - status is auto.
  link currently points to /usr/bin/octave-2.1.72
/usr/bin/octave-2.1.72 - priority 80
  slave octave.1.gz: /usr/share/man/man1/octave-2.1.72.1.gz
  slave octave-config: /usr/bin/octave-config-2.1.72
/usr/bin/octave-2.9.4 - priority 70
  slave octave.1.gz: /usr/share/man/man1/octave-2.9.4.1.gz
Current `best' version is /usr/bin/octave-2.1.72.



More information about the Pkg-octave-devel mailing list