This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: octave-forge dependency?


On Wed, 7 Dec 2005, John W. Eaton wrote:

> OK, let's back up a bit, and see why kpsexpand is needed in the first
> place.

Yes, let's.

> Graphics in Octave use gnuplot.  The legend function from Octave Forge
> sends a "save FILE" command to gnuplot so that it can extract some
> information about gnuplot's current state.  If you do the following
>
>   mv /usr/bin/kpsexpand. /usr/bin/kpsexpand-save
>   gnuplot
>   ...
>   gnuplot> save "foo"
>
> you should see the errors
>
>   sh: kpsexpand: command not found

Ok, so first off, octave-forge *shouldn't* depend on tetex-bin.  If
anything needs to depend on tetex-bin, it should be gnuplot.  The presence
of tetex-bin in octave-forge's requires: line is a packaging bug (even if
it's intended to work around gnuplot's missing dependency).

> So, why does gnuplot need kpsexpand to save state?

Yes, why does it *need* kpsexpand/kpsewhich to save state?  Looks like the
kpsexpand command can easily fail with no adverse effects.  The only
problem is the error message -- so this looks to me to be a bug in gnuplot
(either a minor one if all it does is display the message, or a major one
if it stops processing the curr_fontpath array on such errors).

> So gnuplot is using kpsexpand to locate some font files.
> It looks like there are a couple of options.
>
> One is to set GNUPLOT_FONTPATH in the environment before calling
> gnuplot.

That would avoid the use of kpsexpand altogether, but will hard-code the
paths.  A better solution would be to use kpsexpand if it's available, and
ignore it if it isn't (but this has to be done in gnuplot).

> Another is to make a wrapper kpsexpand that looks for the real version
> and does nothing if the real version is not present:
>
>   #! /bin/sh
>   if [ -x /usr/bin/kpsexpand ]; then
>     exec /usr/bin/kspexpand "$@"
>   fi
>
> (though you might want to add some comments about why this is needed).

Ugh.  Why not just modify gnuplot to test whether an executable is present
before blindly calling it?

> If the real kpsexpand is not present, then chances are the font files
> are not -either, so it should not matter that the corresponding
> directories named in the fontpath are bogus.

Bingo.

> You could install the wrapper script in one of the directories in
> Octave's DEFAULT_EXEC_PATH (for example,
> /usr/lib/octave/2.1.72/exec/i686-pc-cygwin, where a couple of other
> scripts are already installed), then it would only be found by Octave
> and should not introduce any other conflicts.

Either one is a reasonable hack pending the appropriate gnuplot change,
but both are still hacks, IMO.
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

If there's any real truth it's that the entire multidimensional infinity
of the Universe is almost certainly being run by a bunch of maniacs. /DA

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]