discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: thoughts on openapp


From: Nicola Pero
Subject: Re: thoughts on openapp
Date: Wed, 27 Feb 2002 12:20:22 +0000 (GMT)

> > We already put xxx/Tools directories into the PATH.  This happens when 
> > you
> > source GNUstep.sh at startup.
> >
> > Perhaps we could put a shell script into Tools,
> >
> > /usr/GNUstep/Local/Tools/EasyDiff
> >
> > containing the lines
> >
> > #! /bin/sh
> > exec "/usr/GNUstep/Local/Apps/EasyDiff.app/EasyDiff" "$@"
> >
> > when you install EasyDiff.app.
> >
> >
> > Then by typing EasyDiff, the app would be started.
> >
> > That should work, but ... Any comments about this change ?
> 
> Make the install a bit more intelligent ... do that on windoze, but
> just create a symbolic link from the Tools directory to the binary
> on unix systems ... avoiding the overhead of running a shellscript.

Unfortunately, I'm afraid we can't use symlinks that way.

The reason is that if you, say, create a symlink

/usr/GNUstep/Local/Tools/EasyDiff --> 
/usr/GNUstep/Local/Apps/EasyDiff.app/EasyDiff

then, when the EasyDiff.app/EasyDiff shell script is executed, it needs to
know the path to itself (in order to locate the actual executable inside
the application wrapper).  But because of the symlink, the nominal path to
itself is /usr/GNUstep/Local/Tools/, not
/usr/GNUstep/Local/Apps/EasyDiff.app/ ! Which means that the shell script
will not be able to find the actual executable.


What we might perhaps do, is that we can create a symlink to the final
executable,

/usr/GNUstep/Local/Tools/ix86/linux-gnu/gnu-gnu-gnu/EasyDiff -->
/usr/GNUstep/Local/Apps/EasyDiff.app/ix86/linux-gnu/gnu-gnu-gnu/EasyDiff

that seems to work, because NSBundle is enough smart as to get the
executable path right (it needs that to get the application main bundle).

I suspect this might not work on windows, but then we don't have symlinks
on windows either :-)

Doing this change might mean that starting applications by name on the
command line is going to be extremely much faster than running them using
openapp, since when you run openapp, two or three shell scripts including
sed invocations and that stuff are called each time before the app is
started.

I suppose I might optimize openapp but ... this change would supersede
that anyway.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]