[armedbear-devel] generated abcl shell script executable

Erik Huelsmann ehuels at gmail.com
Mon Jun 7 19:57:08 UTC 2010


Ping!

On Thu, May 13, 2010 at 2:26 PM, Mark Evenson <evenson at panix.com> wrote:
> On 5/12/10 9:07 PM, Matthias Cords wrote:
>>
>> Hi there,
>>
>> just a suggestion.
>>
>> would it be possible to change the generated "abcl" shell script to not
>> use the -cp parameter to the java executable, but set up the classpath
>> like e.g. so
>>
>>   export CLASSPATH=`dirname $0`/dist/abcl.jar:$CLASSPATH
>>
>> and then invoke
>>
>>   exec .../java org.armedbear.lisp.Main "$@"
>>
>> i.e. without the -cp parameter.
>>
>> This would result in the CLASSPATH environment variable that was in
>> effect before the call to the abcl script to remain available to the
>> lisp interpreter.  i.e. jdbc driver classes etc.
>
> I would propose the attached patch for UNIX, but we need to find the
> equivalent behavior under the Windows shell for which I solicit a
> contribution from someone who has the requisite knowledge (or time for
> Google and experimentation)
>
> Some points:
>
> 1)  export CLASSPATH="..." is not legal Bourne shell syntax
>
> 2)  Don't export CLASSPATH unless it is already exported
>
> 3)  If CLASSPATH is not set, don't leave a trailing ':' in the path
>
> 4)  The absolute form of the directory should already have been set in the
> Ant build, so the `dirname $0` isn't necessary (and would break is abcl is
> symlinked)
>
>> apart from that I think abcl is a great great piece of software making
>> life a lot more convenient.  thanks to everyone participating!
>
> Thanks, and welcome aboard!

Mark,

I hope your wrist is starting to do better? Or is it really broken? In
that case, we might want to skype instead!

Anyway, the attached patch hasn't been applied. I have 2 remarks:


-exec @JAVA@ @ABCL_JAVA_OPTIONS@ \
-  -cp  @ABCL_CLASSPATH@ \
+if [ -z ${CLASSPATH} ]; then

----> I thought this should be _-z "${CLASSPATH}" to handle those
cases where there are spaces in the path.

+    CLASSPATH=@ABCL_CLASSPATH@

----> I think it's customary to use lower-case variable names for
non-exported variables; especially if I look at configure scripts,
that's the idea I get. Using lowercase makes the script less confusing
too, because then it doesn't re-assign CLASSPATH.

+else
+    CLASSPATH=@ABCL_CLASSPATH@:${CLASSPATH}
+fi
+
+CLASSPATH=$CLASSPATH exec @JAVA@ @ABCL_JAVA_OPTIONS@ \
   org.armedbear.lisp.Main \
   "$@"

Agreed?

Bye,

Erik - who can create the Windows variant of it.




More information about the armedbear-devel mailing list