X-Git-Url: http://git.tuebingen.mpg.de/?p=gsu.git;a=blobdiff_plain;f=common;h=fe64cd6b61f690d6ad06da0b2cae747e2ba1f308;hp=a7c39b11ae9f08f528fee3769665a50cbbb5151f;hb=77fd8c08604bb7a1c641c4f36bdf4f839d114656;hpb=03ad6fa34ffda8f6846dd83056c0722f884b57cf diff --git a/common b/common index a7c39b1..fe64cd6 100644 --- a/common +++ b/common @@ -1,5 +1,6 @@ #!/bin/bash -# (C) 2006-2011 Andre Noll +# Copyright (C) 2006 Andre Noll +# Licensed under the LGPL, version 3. See COPYING and COPYING.LESSER. _gsu_init_errors() { @@ -15,6 +16,9 @@ E_GSU_BAD_ARG_COUNT invalid number of arguments E_GSU_EDITOR failed to execute editor E_GSU_MKDIR failed to create directory E_GSU_GETOPTS getopts error +E_GSU_DIALOG dialog error +E_GSU_MKTEMP mktemp error +E_GSU_MENU_TREE invalid menu tree $gsu_errors " local a b i=0 @@ -35,7 +39,7 @@ EOF gsu_is_a_number() { result="$1" - if test "$1" -eq "$1" &> /dev/null; then + if (("$1" == "$1")) &> /dev/null; then ret=$GSU_SUCCESS else ret=-$E_GSU_NOT_A_NUMBER @@ -62,11 +66,11 @@ gsu_err_msg() local txt="$result" err gsu_is_a_number "$ret" - if test $ret -lt 0; then + if (($ret < 0)); then gsu_msg "unknown error ($ret:$txt)" exit 1 fi - if test $result -ge 0; then + if (($result >= 0)); then gsu_msg "unknown error ($result:$txt)" exit 1 fi