From 6a8c1f1989f77d1cbfb63c938b9a9ad0093803ce Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sat, 1 Dec 2018 22:46:56 +0000 Subject: bib2gls (1dec18) git-svn-id: svn://tug.org/texlive/trunk@49293 c570f23f-e606-0410-a88d-b1316a301751 --- .../texk/texlive/linked_scripts/bib2gls/bib2gls.sh | 24 +++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) (limited to 'Build/source') diff --git a/Build/source/texk/texlive/linked_scripts/bib2gls/bib2gls.sh b/Build/source/texk/texlive/linked_scripts/bib2gls/bib2gls.sh index 124091e7f3b..2e720ffb545 100755 --- a/Build/source/texk/texlive/linked_scripts/bib2gls/bib2gls.sh +++ b/Build/source/texk/texlive/linked_scripts/bib2gls/bib2gls.sh @@ -1,12 +1,22 @@ #!/bin/sh +# Adapted from tlcockpit.sh to ensure the script works with cygwin -kernel=`uname -s` -if test "${kernel#*CYGWIN}" != "$kernel" -then - jarpath=`cygpath -w $(kpsewhich --progname=bib2gls --format=texmfscripts bib2gls.jar)` -else - jarpath=`kpsewhich --progname=bib2gls --format=texmfscripts bib2gls.jar` +scriptname=`basename "$0" .sh` +jar="$scriptname.jar" +jarpath=`kpsewhich --progname="$scriptname" --format=texmfscripts "$jar"` + +kernel=`uname -s 2>/dev/null` +if echo "$kernel" | grep CYGWIN >/dev/null; then + CYGWIN_ROOT=`cygpath -w /` + export CYGWIN_ROOT + jarpath=`cygpath -w "$jarpath"` fi -java -Djava.locale.providers=CLDR,JRE,SPI -jar "$jarpath" "$@" +# User may have globally set their locale provider preference in +# $JAVA_TOOL_OPTIONS so don't override it. +if [ -z "$JAVA_TOOL_OPTIONS" ]; then + exec java -Djava.locale.providers=CLDR,JRE,SPI -jar "$jarpath" "$@" +else + exec java -jar "$jarpath" "$@" +fi -- cgit v1.2.3