Re: [groovy-scm] [18112] trunk/groovy/groovy-core/src/bin: (GROOVY-3849) Resolve links before including startGroovy

View: New views
20 Messages — Rating Filter:   Alert me  
< Prev | 1 - 2 | Next >

Parent Message unknown Re: [groovy-scm] [18112] trunk/groovy/groovy-core/src/bin: (GROOVY-3849) Resolve links before including startGroovy

by Russel Winder-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Jason,

It seems icky to have the same code in all the interface scripts.  Is it
really necessary?  If so I will amend the Gant script in line with the
changes here.

I am guessing the problem is finding the startGroovy script?

On Tue, 2009-10-27 at 03:10 -0500, user57@... wrote:

> Revision
>         18112
> Author
>         user57
> Date
>         2009-10-27 03:10:41 -0500 (Tue, 27 Oct 2009)
> Log Message
> (GROOVY-3849) Resolve links before including startGroovy
> Modified Paths
>       * trunk/groovy/groovy-core/src/bin/grape
>       * trunk/groovy/groovy-core/src/bin/groovy
>       * trunk/groovy/groovy-core/src/bin/groovyConsole
>       * trunk/groovy/groovy-core/src/bin/groovyc
>       * trunk/groovy/groovy-core/src/bin/groovysh
>       * trunk/groovy/groovy-core/src/bin/java2groovy
> Diff
> Modified: trunk/groovy/groovy-core/src/bin/grape (18111 => 18112)
> --- trunk/groovy/groovy-core/src/bin/grape 2009-10-26 20:49:19 UTC (rev 18111)
> +++ trunk/groovy/groovy-core/src/bin/grape 2009-10-27 08:10:41 UTC (rev 18112)
> @@ -14,7 +14,31 @@
>  ##
>  
>  GROOVY_APP_NAME=Grape
> -DIRNAME=`dirname "$0"`
> -. "$DIRNAME/startGroovy"
>  
> +# Resolve links
> +PRG=$0
> +while [ -h "$PRG" ] ; do
> +    ls=`ls -ld "$PRG"`
> +    link=`expr "$ls" : '.*-> \(.*\)$'`
> +    if expr "$link" : '.*/.*' > /dev/null; then
> +        if expr "$link" : '^/' > /dev/null; then
> +            PRG="$link"
> +        else
> +            PRG="`dirname ${PRG}`/${link}"
> +        fi
> +    else
> +        PRG="`dirname $PRG`/$link"
> +    fi
> +done
> +
> +GROOVY_HOME=`dirname "$PRG"`
> +if [ "GROOVY_HOME" = '.' ] ; then
> +    cwd=`pwd`
> +    GROOVY_HOME=`dirname $cwd`
> +else
> +    GROOVY_HOME=`dirname "$GROOVY_HOME"`
> +fi
> +
> +. "$GROOVY_HOME/bin/startGroovy"
> +
>  startGroovy org.codehaus.groovy.tools.GrapeMain "$@"
[ . . . ]
>
--
Russel.
=============================================================================
Dr Russel Winder      Partner
                                            xmpp: russel@...
Concertant LLP        t: +44 20 7585 2200, +44 20 7193 9203
41 Buckmaster Road,   f: +44 8700 516 084   voip: sip:russel.winder@...
London SW11 1EN, UK   m: +44 7770 465 077   skype: russel_winder


signature.asc (204 bytes) Download Attachment

Re: Re: [groovy-scm] [18112] trunk/groovy/groovy-core/src/bin: (GROOVY-3849) Resolve links before including startGroovy

by Jason Dillon :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I agree its icky, but the problem as you mention is finding the  
startGroovy script.  `dirname $0` does not cut it if the script has  
been linked to some place and executed from there.  Hence the icky  
bits. :-\

--jason


On Oct 27, 2009, at 10:46 PM, Russel Winder wrote:

> Jason,
>
> It seems icky to have the same code in all the interface scripts.  
> Is it
> really necessary?  If so I will amend the Gant script in line with the
> changes here.
>
> I am guessing the problem is finding the startGroovy script?
>
> On Tue, 2009-10-27 at 03:10 -0500, user57@... wrote:
>> Revision
>>        18112
>> Author
>>        user57
>> Date
>>        2009-10-27 03:10:41 -0500 (Tue, 27 Oct 2009)
>> Log Message
>> (GROOVY-3849) Resolve links before including startGroovy
>> Modified Paths
>>      * trunk/groovy/groovy-core/src/bin/grape
>>      * trunk/groovy/groovy-core/src/bin/groovy
>>      * trunk/groovy/groovy-core/src/bin/groovyConsole
>>      * trunk/groovy/groovy-core/src/bin/groovyc
>>      * trunk/groovy/groovy-core/src/bin/groovysh
>>      * trunk/groovy/groovy-core/src/bin/java2groovy
>> Diff
>> Modified: trunk/groovy/groovy-core/src/bin/grape (18111 => 18112)
>> --- trunk/groovy/groovy-core/src/bin/grape 2009-10-26 20:49:19 UTC  
>> (rev 18111)
>> +++ trunk/groovy/groovy-core/src/bin/grape 2009-10-27 08:10:41 UTC  
>> (rev 18112)
>> @@ -14,7 +14,31 @@
>> ##
>>
>> GROOVY_APP_NAME=Grape
>> -DIRNAME=`dirname "$0"`
>> -. "$DIRNAME/startGroovy"
>>
>> +# Resolve links
>> +PRG=$0
>> +while [ -h "$PRG" ] ; do
>> +    ls=`ls -ld "$PRG"`
>> +    link=`expr "$ls" : '.*-> \(.*\)$'`
>> +    if expr "$link" : '.*/.*' > /dev/null; then
>> +        if expr "$link" : '^/' > /dev/null; then
>> +            PRG="$link"
>> +        else
>> +            PRG="`dirname ${PRG}`/${link}"
>> +        fi
>> +    else
>> +        PRG="`dirname $PRG`/$link"
>> +    fi
>> +done
>> +
>> +GROOVY_HOME=`dirname "$PRG"`
>> +if [ "GROOVY_HOME" = '.' ] ; then
>> +    cwd=`pwd`
>> +    GROOVY_HOME=`dirname $cwd`
>> +else
>> +    GROOVY_HOME=`dirname "$GROOVY_HOME"`
>> +fi
>> +
>> +. "$GROOVY_HOME/bin/startGroovy"
>> +
>> startGroovy org.codehaus.groovy.tools.GrapeMain "$@"
> [ . . . ]
>>
> --
> Russel.
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> Dr Russel Winder      Partner
>                                            xmpp: russel@...
> Concertant LLP        t: +44 20 7585 2200, +44 20 7193 9203
> 41 Buckmaster Road,   f: +44 8700 516 084   voip: sip:russel.winder@...
> London SW11 1EN, UK   m: +44 7770 465 077   skype: russel_winder


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Re: Re: [groovy-scm] [18112] trunk/groovy/groovy-core/src/bin: (GROOVY-3849) Resolve links before including startGroovy

by Jochen Theodorou :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Jason Dillon schrieb:
> I agree its icky, but the problem as you mention is finding the
> startGroovy script.  `dirname $0` does not cut it if the script has been
> linked to some place and executed from there.  Hence the icky bits. :-\

but can't it be used to search for the right name? The search could be
done in startGroovy, or not?

bye blackdrag

--
Jochen "blackdrag" Theodorou
The Groovy Project Tech Lead (http://groovy.codehaus.org)
http://blackdragsview.blogspot.com/


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Re: Re: [groovy-scm] [18112] trunk/groovy/groovy-core/src/bin: (GROOVY-3849) Resolve links before including startGroovy

by Russel Winder-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wed, 2009-10-28 at 09:09 +0100, Jochen Theodorou wrote:
> Jason Dillon schrieb:
> > I agree its icky, but the problem as you mention is finding the
> > startGroovy script.  `dirname $0` does not cut it if the script has been
> > linked to some place and executed from there.  Hence the icky bits. :-\
>
> but can't it be used to search for the right name? The search could be
> done in startGroovy, or not?

Jason believes there are are many circumstances where you cannot find
the startGroovy script.   This means the search code has to be
replicated in each script.

I think the classic situation is where you install Groovy to somewhere,
~/lib/Java/groovy say, then instead of putting ~/lib/Java/groovy/bin in
the search path, you put a symbolic link in ~/bin printing at
~/lib/Java/groovy/bin/groovy.

--
Russel.
=============================================================================
Dr Russel Winder      Partner
                                            xmpp: russel@...
Concertant LLP        t: +44 20 7585 2200, +44 20 7193 9203
41 Buckmaster Road,   f: +44 8700 516 084   voip: sip:russel.winder@...
London SW11 1EN, UK   m: +44 7770 465 077   skype: russel_winder


signature.asc (204 bytes) Download Attachment

Re: Re: [groovy-scm] [18112] trunk/groovy/groovy-core/src/bin: (GROOVY-3849) Resolve links before including startGroovy

by Jason Dillon :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Oct 28, 2009, at 3:17 PM, Russel Winder wrote:

> On Wed, 2009-10-28 at 09:09 +0100, Jochen Theodorou wrote:
>> Jason Dillon schrieb:
>>> I agree its icky, but the problem as you mention is finding the
>>> startGroovy script.  `dirname $0` does not cut it if the script  
>>> has been
>>> linked to some place and executed from there.  Hence the icky  
>>> bits. :-\
>>
>> but can't it be used to search for the right name? The search could  
>> be
>> done in startGroovy, or not?

The problem is that these scripts try to use the dirname of the  
executing script to locate the startGroovy script.  But when using  
links, the dirname that is resolved is the directory where the link  
is, not where its target is.  So if I have linked $GROOVY_HOME/bin/
groovysh to ~/bin/groovysh, when groovysh runs (without the link  
resolution I added) then it expects to find the startGroovy script in  
~/bin which is not the case.


> Jason believes there are are many circumstances where you cannot find
> the startGroovy script.   This means the search code has to be
> replicated in each script.
>
> I think the classic situation is where you install Groovy to  
> somewhere,
> ~/lib/Java/groovy say, then instead of putting ~/lib/Java/groovy/bin  
> in
> the search path, you put a symbolic link in ~/bin printing at
> ~/lib/Java/groovy/bin/groovy.

This is exactly correct.

--jason


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Re: Re: [groovy-scm] [18112] trunk/groovy/groovy-core/src/bin: (GROOVY-3849) Resolve links before including startGroovy

by Jochen Theodorou :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Russel Winder schrieb:

> On Wed, 2009-10-28 at 09:09 +0100, Jochen Theodorou wrote:
>> Jason Dillon schrieb:
>>> I agree its icky, but the problem as you mention is finding the
>>> startGroovy script.  `dirname $0` does not cut it if the script has been
>>> linked to some place and executed from there.  Hence the icky bits. :-\
>> but can't it be used to search for the right name? The search could be
>> done in startGroovy, or not?
>
> Jason believes there are are many circumstances where you cannot find
> the startGroovy script.   This means the search code has to be
> replicated in each script.
>
> I think the classic situation is where you install Groovy to somewhere,
> ~/lib/Java/groovy say, then instead of putting ~/lib/Java/groovy/bin in
> the search path, you put a symbolic link in ~/bin printing at
> ~/lib/Java/groovy/bin/groovy.

the goal is to avoid having startGroovy there I would say

> +# Resolve links
> +PRG=$0
> +while [ -h "$PRG" ] ; do
> +    ls=`ls -ld "$PRG"`
> +    link=`expr "$ls" : '.*-> \(.*\)$'`
> +    if expr "$link" : '.*/.*' > /dev/null; then
> +        if expr "$link" : '^/' > /dev/null; then
> +            PRG="$link"
> +        else
> +            PRG="`dirname ${PRG}`/${link}"
> +        fi
> +    else
> +        PRG="`dirname $PRG`/$link"
> +    fi
> +done

this here should be mostly ok, but is a it hard to understand for me.
basically we try to get the parent directory I think

> +GROOVY_HOME=`dirname "$PRG"`
> +if [ "GROOVY_HOME" = '.' ] ; then
> +    cwd=`pwd`
> +    GROOVY_HOME=`dirname $cwd`
> +else
> +    GROOVY_HOME=`dirname "$GROOVY_HOME"`
> +fi
> +
> +. "$GROOVY_HOME/bin/startGroovy"
> +

this part puzzles me a bit. For one GROOVY_HOME is set here... what if
it had been set from outside? Also the need to get the parent directory
is a bit unclear to me. If we find the original location of the start
script within the Groovy installation, then we are already in the bin
folder and don't need to get the parent directory and don't need to
descend to a bin directory. Or am I wrong here?

bye blackdrag

--
Jochen "blackdrag" Theodorou
The Groovy Project Tech Lead (http://groovy.codehaus.org)
http://blackdragsview.blogspot.com/


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Re: Re: [groovy-scm] [18112] trunk/groovy/groovy-core/src/bin: (GROOVY-3849) Resolve links before including startGroovy

by Jason Dillon :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I suppose it does not need to set GROOVY_HOME and just resolve links  
to the correct basedir of the target script.

--jason


On Oct 28, 2009, at 3:47 PM, Jochen Theodorou wrote:

> Russel Winder schrieb:
>> On Wed, 2009-10-28 at 09:09 +0100, Jochen Theodorou wrote:
>>> Jason Dillon schrieb:
>>>> I agree its icky, but the problem as you mention is finding the  
>>>> startGroovy script.  `dirname $0` does not cut it if the script  
>>>> has been linked to some place and executed from there.  Hence the  
>>>> icky bits. :-\
>>> but can't it be used to search for the right name? The search  
>>> could be done in startGroovy, or not?
>> Jason believes there are are many circumstances where you cannot find
>> the startGroovy script.   This means the search code has to be
>> replicated in each script.
>> I think the classic situation is where you install Groovy to  
>> somewhere,
>> ~/lib/Java/groovy say, then instead of putting ~/lib/Java/groovy/
>> bin in
>> the search path, you put a symbolic link in ~/bin printing at
>> ~/lib/Java/groovy/bin/groovy.
>
> the goal is to avoid having startGroovy there I would say
>
>> +# Resolve links
>> +PRG=$0
>> +while [ -h "$PRG" ] ; do
>> +    ls=`ls -ld "$PRG"`
>> +    link=`expr "$ls" : '.*-> \(.*\)$'`
>> +    if expr "$link" : '.*/.*' > /dev/null; then
>> +        if expr "$link" : '^/' > /dev/null; then
>> +            PRG="$link"
>> +        else
>> +            PRG="`dirname ${PRG}`/${link}"
>> +        fi
>> +    else
>> +        PRG="`dirname $PRG`/$link"
>> +    fi
>> +done
>
> this here should be mostly ok, but is a it hard to understand for  
> me. basically we try to get the parent directory I think
>
>> +GROOVY_HOME=`dirname "$PRG"`
>> +if [ "GROOVY_HOME" = '.' ] ; then
>> +    cwd=`pwd`
>> +    GROOVY_HOME=`dirname $cwd`
>> +else
>> +    GROOVY_HOME=`dirname "$GROOVY_HOME"`
>> +fi
>> +
>> +. "$GROOVY_HOME/bin/startGroovy"
>> +
>
> this part puzzles me a bit. For one GROOVY_HOME is set here... what  
> if it had been set from outside? Also the need to get the parent  
> directory is a bit unclear to me. If we find the original location  
> of the start script within the Groovy installation, then we are  
> already in the bin folder and don't need to get the parent directory  
> and don't need to descend to a bin directory. Or am I wrong here?
>
> bye blackdrag
>
> --
> Jochen "blackdrag" Theodorou
> The Groovy Project Tech Lead (http://groovy.codehaus.org)
> http://blackdragsview.blogspot.com/
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>   http://xircles.codehaus.org/manage_email
>
>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Re: Re: [groovy-scm] [18112] trunk/groovy/groovy-core/src/bin: (GROOVY-3849) Resolve links before including startGroovy

by Russel Winder-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Jochen,

On Wed, 2009-10-28 at 09:47 +0100, Jochen Theodorou wrote:
> Russel Winder schrieb:
[ . . . ]
> > I think the classic situation is where you install Groovy to somewhere,
> > ~/lib/Java/groovy say, then instead of putting ~/lib/Java/groovy/bin in
> > the search path, you put a symbolic link in ~/bin printing at
> > ~/lib/Java/groovy/bin/groovy.
>
> the goal is to avoid having startGroovy there I would say

There isn't a way of having just a single script to do all the work and
still have the ability for new commands to reuse the core code -- which
is the situation we have now.

> > +# Resolve links
> > +PRG=$0
> > +while [ -h "$PRG" ] ; do
> > +    ls=`ls -ld "$PRG"`
> > +    link=`expr "$ls" : '.*-> \(.*\)$'`
> > +    if expr "$link" : '.*/.*' > /dev/null; then
> > +        if expr "$link" : '^/' > /dev/null; then
> > +            PRG="$link"
> > +        else
> > +            PRG="`dirname ${PRG}`/${link}"
> > +        fi
> > +    else
> > +        PRG="`dirname $PRG`/$link"
> > +    fi
> > +done
>
> this here should be mostly ok, but is a it hard to understand for me.
> basically we try to get the parent directory I think
I am not convinced this is the best way of doing this but it may be the
only way of doing it without taking account of the various differences
between Ubuntu/Debian, Fedora/RHEL/CentOS, SuSE, Solaris, Mac OS X.

> > +GROOVY_HOME=`dirname "$PRG"`
> > +if [ "GROOVY_HOME" = '.' ] ; then
> > +    cwd=`pwd`
> > +    GROOVY_HOME=`dirname $cwd`
> > +else
> > +    GROOVY_HOME=`dirname "$GROOVY_HOME"`
> > +fi
> > +
> > +. "$GROOVY_HOME/bin/startGroovy"
> > +
>
> this part puzzles me a bit. For one GROOVY_HOME is set here... what if
> it had been set from outside? Also the need to get the parent directory
> is a bit unclear to me. If we find the original location of the start
> script within the Groovy installation, then we are already in the bin
> folder and don't need to get the parent directory and don't need to
> descend to a bin directory. Or am I wrong here?
I think you missed the follow up edit; the selection line should read:

        if [ "$GROOVY_HOME" = '.' ] ; then

at which point everything makes much more sense :-)

--
Russel.
=============================================================================
Dr Russel Winder      Partner
                                            xmpp: russel@...
Concertant LLP        t: +44 20 7585 2200, +44 20 7193 9203
41 Buckmaster Road,   f: +44 8700 516 084   voip: sip:russel.winder@...
London SW11 1EN, UK   m: +44 7770 465 077   skype: russel_winder


signature.asc (204 bytes) Download Attachment

Re: Re: [groovy-scm] [18112] trunk/groovy/groovy-core/src/bin: (GROOVY-3849) Resolve links before including startGroovy

by Jochen Theodorou :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Russel Winder schrieb:
[...]
> I am not convinced this is the best way of doing this but it may be the
> only way of doing it without taking account of the various differences
> between Ubuntu/Debian, Fedora/RHEL/CentOS, SuSE, Solaris, Mac OS X.

but don't they ship their own shell scripts anyway?

>>> +GROOVY_HOME=`dirname "$PRG"`
>>> +if [ "GROOVY_HOME" = '.' ] ; then
>>> +    cwd=`pwd`
>>> +    GROOVY_HOME=`dirname $cwd`
>>> +else
>>> +    GROOVY_HOME=`dirname "$GROOVY_HOME"`
>>> +fi
>>> +
>>> +. "$GROOVY_HOME/bin/startGroovy"
>>> +
>> this part puzzles me a bit. For one GROOVY_HOME is set here... what if
>> it had been set from outside? Also the need to get the parent directory
>> is a bit unclear to me. If we find the original location of the start
>> script within the Groovy installation, then we are already in the bin
>> folder and don't need to get the parent directory and don't need to
>> descend to a bin directory. Or am I wrong here?
>
> I think you missed the follow up edit; the selection line should read:
>
>         if [ "$GROOVY_HOME" = '.' ] ; then
>
> at which point everything makes much more sense :-)

but at that point GROOVY_HOM e had been set to `dirname "$PRG"` already.

bye blackdrag


--
Jochen "blackdrag" Theodorou
The Groovy Project Tech Lead (http://groovy.codehaus.org)
http://blackdragsview.blogspot.com/


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Re: Re: [groovy-scm] [18112] trunk/groovy/groovy-core/src/bin: (GROOVY-3849) Resolve links before including startGroovy

by Jochen Theodorou :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Jason Dillon schrieb:
> I suppose it does not need to set GROOVY_HOME and just resolve links to
> the correct basedir of the target script.

I would prefer that.

bye blackdrag

--
Jochen "blackdrag" Theodorou
The Groovy Project Tech Lead (http://groovy.codehaus.org)
http://blackdragsview.blogspot.com/


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Re: Re: [groovy-scm] [18112] trunk/groovy/groovy-core/src/bin: (GROOVY-3849) Resolve links before including startGroovy

by Jason Dillon :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Done.

--jason


On Oct 28, 2009, at 9:08 PM, Jochen Theodorou wrote:

> Jason Dillon schrieb:
>> I suppose it does not need to set GROOVY_HOME and just resolve  
>> links to the correct basedir of the target script.
>
> I would prefer that.
>
> bye blackdrag
>
> --
> Jochen "blackdrag" Theodorou
> The Groovy Project Tech Lead (http://groovy.codehaus.org)
> http://blackdragsview.blogspot.com/
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>   http://xircles.codehaus.org/manage_email
>
>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Re: Re: [groovy-scm] [18112] trunk/groovy/groovy-core/src/bin: (GROOVY-3849) Resolve links before including startGroovy

by Russel Winder-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wed, 2009-10-28 at 15:07 +0100, Jochen Theodorou wrote:
> Russel Winder schrieb:
> [...]
> > I am not convinced this is the best way of doing this but it may be the
> > only way of doing it without taking account of the various differences
> > between Ubuntu/Debian, Fedora/RHEL/CentOS, SuSE, Solaris, Mac OS X.
>
> but don't they ship their own shell scripts anyway?

The Debian packagers certainly do, and I would hope the others do as
well.  Given a particular OS distribution, all the decision making in
the Groovy distribution scripts can be short-circuited making startup
that bit faster.  (Though I think Groovy class load/start dominates the
script usage, so there isn't that much gain.)

--
Russel.
=============================================================================
Dr Russel Winder      Partner
                                            xmpp: russel@...
Concertant LLP        t: +44 20 7585 2200, +44 20 7193 9203
41 Buckmaster Road,   f: +44 8700 516 084   voip: sip:russel.winder@...
London SW11 1EN, UK   m: +44 7770 465 077   skype: russel_winder


signature.asc (204 bytes) Download Attachment

Re: Re: [groovy-scm] [18112] trunk/groovy/groovy-core/src/bin: (GROOVY-3849) Resolve links before including startGroovy

by Jochen Theodorou :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Russel Winder schrieb:

> On Wed, 2009-10-28 at 15:07 +0100, Jochen Theodorou wrote:
>> Russel Winder schrieb:
>> [...]
>>> I am not convinced this is the best way of doing this but it may be the
>>> only way of doing it without taking account of the various differences
>>> between Ubuntu/Debian, Fedora/RHEL/CentOS, SuSE, Solaris, Mac OS X.
>> but don't they ship their own shell scripts anyway?
>
> The Debian packagers certainly do, and I would hope the others do as
> well.  Given a particular OS distribution, all the decision making in
> the Groovy distribution scripts can be short-circuited making startup
> that bit faster.  (Though I think Groovy class load/start dominates the
> script usage, so there isn't that much gain.)

if we say the distributors ship their own stuff here anyway, then what
is the need for the change? Is it the "private" installation? Russel, do
you use a privatly installed Groovy?

bye blackdrag

--
Jochen "blackdrag" Theodorou
The Groovy Project Tech Lead (http://groovy.codehaus.org)
http://blackdragsview.blogspot.com/


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Re: Re: [groovy-scm] [18112] trunk/groovy/groovy-core/src/bin: (GROOVY-3849) Resolve links before including startGroovy

by Jochen Theodorou :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Jason Dillon schrieb:
> Done.

much better... I wonder if we could optimize that more... I don't like
the loop that is in there.... how about using readlink -m to get the
unlinked file and then doing dirname on it to get the directory? That
would eliminate the need for the loop. readlink works also if the file
is not invovled in any symbolic link. readlink is afaik available where
dirname is, so I see here no issue arising.

bye blackdrag

--
Jochen "blackdrag" Theodorou
The Groovy Project Tech Lead (http://groovy.codehaus.org)
http://blackdragsview.blogspot.com/


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Re: Re: [groovy-scm] [18112] trunk/groovy/groovy-core/src/bin: (GROOVY-3849) Resolve links before including startGroovy

by Russel Winder-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, 2009-10-27 at 22:52 +0700, Jason Dillon wrote:
> I agree its icky, but the problem as you mention is finding the  
> startGroovy script.  `dirname $0` does not cut it if the script has  
> been linked to some place and executed from there.  Hence the icky  
> bits. :-\

I failed to mention earlier that I chose to use readlink for solving
this problem in the Gant scripts.  Requires Mac OS / Solaris /
everything else Posixy switch but works.  I guess it would be useful to
review whether the way things are done in groovy or gant is better?
 
--
Russel.
=============================================================================
Dr Russel Winder      Partner
                                            xmpp: russel@...
Concertant LLP        t: +44 20 7585 2200, +44 20 7193 9203
41 Buckmaster Road,   f: +44 8700 516 084   voip: sip:russel.winder@...
London SW11 1EN, UK   m: +44 7770 465 077   skype: russel_winder


signature.asc (204 bytes) Download Attachment

Re: Re: [groovy-scm] [18112] trunk/groovy/groovy-core/src/bin: (GROOVY-3849) Resolve links before including startGroovy

by Jason Dillon :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Could be okay, but I'm not sure about the availability of readlink on  
different platforms.

--jason


On Oct 29, 2009, at 10:12 PM, Jochen Theodorou wrote:

> Jason Dillon schrieb:
>> Done.
>
> much better... I wonder if we could optimize that more... I don't  
> like the loop that is in there.... how about using readlink -m to  
> get the unlinked file and then doing dirname on it to get the  
> directory? That would eliminate the need for the loop. readlink  
> works also if the file is not invovled in any symbolic link.  
> readlink is afaik available where dirname is, so I see here no issue  
> arising.
>
> bye blackdrag
>
> --
> Jochen "blackdrag" Theodorou
> The Groovy Project Tech Lead (http://groovy.codehaus.org)
> http://blackdragsview.blogspot.com/
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>   http://xircles.codehaus.org/manage_email
>
>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Re: Re: [groovy-scm] [18112] trunk/groovy/groovy-core/src/bin: (GROOVY-3849) Resolve links before including startGroovy

by Russel Winder-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, 2009-10-29 at 16:12 +0100, Jochen Theodorou wrote:
> Jason Dillon schrieb:
> > Done.
>
> much better... I wonder if we could optimize that more... I don't like
> the loop that is in there.... how about using readlink -m to get the
> unlinked file and then doing dirname on it to get the directory? That
> would eliminate the need for the loop. readlink works also if the file
> is not invovled in any symbolic link. readlink is afaik available where
> dirname is, so I see here no issue arising.

NB  readlink behaves differently on Linux, Solaris and Mac OS X.  Don't
know about FreeBSD, OpenBSD, etc.
--
Russel.
=============================================================================
Dr Russel Winder      Partner
                                            xmpp: russel@...
Concertant LLP        t: +44 20 7585 2200, +44 20 7193 9203
41 Buckmaster Road,   f: +44 8700 516 084   voip: sip:russel.winder@...
London SW11 1EN, UK   m: +44 7770 465 077   skype: russel_winder


signature.asc (204 bytes) Download Attachment

Re: Re: [groovy-scm] [18112] trunk/groovy/groovy-core/src/bin: (GROOVY-3849) Resolve links before including startGroovy

by Russel Winder-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, 2009-10-29 at 15:53 +0100, Jochen Theodorou wrote:
[ . . . ]
> if we say the distributors ship their own stuff here anyway, then what
> is the need for the change? Is it the "private" installation? Russel, do
> you use a privatly installed Groovy?

I don't follow.  Everyone who downloads the distribution and installs
creates their own private installation.  Certainly I do.
--
Russel.
=============================================================================
Dr Russel Winder      Partner
                                            xmpp: russel@...
Concertant LLP        t: +44 20 7585 2200, +44 20 7193 9203
41 Buckmaster Road,   f: +44 8700 516 084   voip: sip:russel.winder@...
London SW11 1EN, UK   m: +44 7770 465 077   skype: russel_winder


signature.asc (204 bytes) Download Attachment

Re: Re: [groovy-scm] [18112] trunk/groovy/groovy-core/src/bin: (GROOVY-3849) Resolve links before including startGroovy

by Jochen Theodorou :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Russel Winder schrieb:
> On Thu, 2009-10-29 at 15:53 +0100, Jochen Theodorou wrote:
> [ . . . ]
>> if we say the distributors ship their own stuff here anyway, then what
>> is the need for the change? Is it the "private" installation? Russel, do
>> you use a privatly installed Groovy?
>
> I don't follow.  Everyone who downloads the distribution and installs
> creates their own private installation.  Certainly I do.

and then you link the scripts or do you work directly from the
installation directory?

bye blackdrag

--
Jochen "blackdrag" Theodorou
The Groovy Project Tech Lead (http://groovy.codehaus.org)
http://blackdragsview.blogspot.com/


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Re: Re: [groovy-scm] [18112] trunk/groovy/groovy-core/src/bin: (GROOVY-3849) Resolve links before including startGroovy

by Russel Winder-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, 2009-10-29 at 19:41 +0100, Jochen Theodorou wrote:

> Russel Winder schrieb:
> > On Thu, 2009-10-29 at 15:53 +0100, Jochen Theodorou wrote:
> > [ . . . ]
> >> if we say the distributors ship their own stuff here anyway, then what
> >> is the need for the change? Is it the "private" installation? Russel, do
> >> you use a privatly installed Groovy?
> >
> > I don't follow.  Everyone who downloads the distribution and installs
> > creates their own private installation.  Certainly I do.
>
> and then you link the scripts or do you work directly from the
> installation directory?
Originally I did a symbolic link of items from ~/bin to
~/lib/Java/groovy/bin but that screwed up royally and I was forced to
add the directory to my PATH which, to be honest, sucks -- it's not so
much the doing that sucks its the having to do.  The upside of using
PATH is that you don't have to remember to add and delete links as the
set of programs changes.  The downside is that I have to have about 17
directories in my PATH because of the way various packages force
things :-(
 
--
Russel.
=============================================================================
Dr Russel Winder      Partner
                                            xmpp: russel@...
Concertant LLP        t: +44 20 7585 2200, +44 20 7193 9203
41 Buckmaster Road,   f: +44 8700 516 084   voip: sip:russel.winder@...
London SW11 1EN, UK   m: +44 7770 465 077   skype: russel_winder


signature.asc (204 bytes) Download Attachment
< Prev | 1 - 2 | Next >