1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-31 11:02:35 +01:00

Applied patch from Marcelo E. Magallon <marcelo.magallon@bigfoot.com>

to fix some more bash specific constructs in wsetfont.
This commit is contained in:
dan
2001-07-24 20:18:19 +00:00
parent 6c494f1a2e
commit 46e12bffb6
2 changed files with 28 additions and 26 deletions

View File

@@ -1,3 +1,5 @@
- Fixed some more bash specific constructs in wsetfont.
(Marcelo E. Magallon <marcelo.magallon@bigfoot.com>)
Changes since version 0.65.0: Changes since version 0.65.0:
............................. .............................

View File

@@ -33,12 +33,11 @@ WDREAD="wdread"
PROGRAM=`basename $0` PROGRAM=`basename $0`
help_msg() { help_msg() {
echo -e "\n"\
"$PROGRAM - font/language setting utility for Window Maker\n"\
"\n"\
"Usage: $VERSION\n"\
" $PROGRAM [--nodef] [--auto] <font_family>" >/dev/stderr
cat >/dev/stderr <<EOF cat >/dev/stderr <<EOF
$PROGRAM - font/language setting utility for Window Maker
Usage: $VERSION
$PROGRAM [--nodef] [--auto] <font_family>
----------------------------------------------------------------------- -----------------------------------------------------------------------
[font_fam] [Fontset] [Font Information] [font_fam] [Fontset] [Font Information]
default helvetica default helvetica
@@ -76,10 +75,10 @@ for i in $*; do
nodef="YES";; nodef="YES";;
"--auto") "--auto")
auto="YES";; auto="YES";;
--locale=*)
new_locale=`echo $i |sed -e "s|--locale=||" -`;;
*) *)
if echo $i |grep "^--locale=" >/dev/null 2>&1; then if [ -z $family ]; then
new_locale=$(echo $i |sed -e "s|--locale=||")
elif [ -z $family ]; then
family=$i family=$i
else else
help_msg help_msg
@@ -234,10 +233,10 @@ for i in $Supported; do
fi fi
done done
if test -z "$is_supported"; then # unknown coding if test -z "$is_supported"; then # unknown coding
echo -e "\n"\ cat >/dev/stderr <<EOT
"Sorry, font coding $family or locale $locale not recognized.\n"\ Sorry, font coding $family or locale $locale not recognized.
"Type $PROGRAM with no arguments for list of supported font codings...\n"\ Type $PROGRAM with no arguments for list of supported font codings...
"" >/dev/stderr EOT
exit 1 exit 1
fi fi
@@ -248,12 +247,12 @@ is_nodef_unable=""
for i in $NodefUnable; do for i in $NodefUnable; do
if test "$family" = "$i"; then if test "$family" = "$i"; then
if test -n "$nodef"; then # --nodef with one from $NodefUnable if test -n "$nodef"; then # --nodef with one from $NodefUnable
echo -e "\n"\ cat >/dev/stderr <<-EOT
"Sorry, --nodef argument is not allowed for these font codings:\n"\ Sorry, --nodef argument is not allowed for these font codings:
" $NodefUnable\n"\ $NodefUnable
"Run $PROGRAM without --nodef argument to set default fonts for your\n"\ Run $PROGRAM without --nodef argument to set default fonts for your
"font coding.\n"\ font coding.
"" >/dev/stderr EOT
exit 1 exit 1
else else
is_nodef_unable="YES" is_nodef_unable="YES"
@@ -289,13 +288,14 @@ if test -z "$nodef"; then
fi fi
done done
else else
echo -e "\n"\ cat >/dev/stderr <<EOT
"You used --nodef command line argument. You should note, that this\n"\ You used --nodef command line argument. You should note, that this
"works with these font codings only:\n"\ works with these font codings only:
" $NodefAble\n"\ $NodefAble
"You should not use it to change fonts from other font codings than\n"\ You should not use it to change fonts from other font codings than
"those listed above. If your WindowMaker does not appear to find fonts,\n"\ those listed above. If your WindowMaker does not appear to find fonts,
"you should run $PROGRAM once again without --nodef argument." >/dev/stderr you should run $PROGRAM once again without --nodef argument.
EOT
fi fi
# #
@@ -325,7 +325,7 @@ for i in $DomainNames; do
#TODO:better (or at least any) check, whether wmaker is installed... #TODO:better (or at least any) check, whether wmaker is installed...
tmp1="${family}Coding" tmp1="${family}Coding"
eval _tmp1="\$${tmp1}" eval _tmp1="\$${tmp1}"
eval $j=$($WDREAD $i $j | sed -e "s/\(^-.*-\).*-.*$/\1${_tmp1}/g") eval $j=`$WDREAD $i $j | sed -e "s/\(^-.*-\).*-.*$/\1${_tmp1}/g"`
eval _j="\$$j" eval _j="\$$j"
if test -z "${_j}"; then # failed, load default if test -z "${_j}"; then # failed, load default
tmp2="Default$j" tmp2="Default$j"