[texworks] Regression in r410 (bashism)

Jonathan Kew jfkthame at googlemail.com
Wed Sep 9 16:20:40 CEST 2009


Oops, sorry about that! This patch looks ok, checked in as r.415.

Thanks,

JK

On 9 Sep 2009, at 13:40, David Jurenka wrote:

> Hi,
> switching from /bin/bash to /bin/sh in r410 introduced a regression  
> for systems where /bin/sh points to shells that do not understand  
> the double bracket testing syntax, such as Bourne shell or Debian  
> Almquist shell (e.g. Debian Squeeze, Ubuntu). A possible patch is  
> attached.
> Cheers,
>
> David Jurenka
>
> P.S. BTW, the original script didn't work properly in Bash either as  
> [[ "$BINPATHS" == ":$NEWPATH:" ]] tests only for full string  
> matching, whereas substring matching could be checked by  
> [[ "$BINPATHS" == *":$NEWPATH:"* ]] .
> --- texworks-r413/getDefaultBinPaths.sh	2009-09-09  
> 13:48:07.365771633 +0200
> +++ texworks-fix/getDefaultBinPaths.sh	2009-09-09 13:51:20.257889818  
> +0200
> @@ -9,12 +9,11 @@
> appendPath()
> {
> 	NEWPATH="$1"
> -	if [[ "$BINPATHS" == ":$NEWPATH:" ]]; then
> -		echo $NEWPATH already present
> -	else
> -		# note that BINPATHS already ends with colon
> -		BINPATHS="$BINPATHS$NEWPATH:"
> -	fi
> +	case "$BINPATHS" in
> +		*:"$NEWPATH":*)	echo $NEWPATH already present;;
> +		*)				# note that BINPATHS already ends with colon
> +						BINPATHS="$BINPATHS$NEWPATH:";;
> +	esac
> }
>
> # (1) try to find tex and ghostscript



More information about the texworks mailing list