From 16d2a8915c345f17eadd1f085a7933dac8c5e453 Mon Sep 17 00:00:00 2001 From: jlam Date: Sun, 15 Jul 2001 08:46:00 +0000 Subject: Fix several nonportable shell constructs: (1) [ doesn't understand ==; use = instead. (2) (( ... )) isn't valid /bin/sh; use [ ... ] instead. (3) ${foo:0:4} to get the first 4 letters of ${foo} isn't valid /bin/sh, so use a loop to remove letters off the end until only 4 letters remain. --- wm/windowmaker/patches/patch-af | 63 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 wm/windowmaker/patches/patch-af (limited to 'wm') diff --git a/wm/windowmaker/patches/patch-af b/wm/windowmaker/patches/patch-af new file mode 100644 index 00000000000..4f69f5ed7a8 --- /dev/null +++ b/wm/windowmaker/patches/patch-af @@ -0,0 +1,63 @@ +$NetBSD: patch-af,v 1.1 2001/07/15 08:46:00 jlam Exp $ + +--- util/wmchlocale.in.orig Fri Feb 9 11:05:49 2001 ++++ util/wmchlocale.in +@@ -9,7 +9,7 @@ + PROGRAM=`basename $0` + VERSION="0.1" + +-if [ "x$GNUSTEP_USER_ROOT" == "x" ]; then ++if [ "x$GNUSTEP_USER_ROOT" = "x" ]; then + GSDIR="$HOME/GNUstep" + else + GSDIR="$GNUSTEP_USER_ROOT" +@@ -33,7 +33,7 @@ + exit 0 + } + +-if (( $# == 0 )); then ++if [ $# -eq 0 ]; then + help_msg + fi + +@@ -52,7 +52,7 @@ + fi;; + esac + done +-if [ "$new_locale" == "default" ]; then ++if [ "$new_locale" = "default" ]; then + new_locale="" + fi + +@@ -75,7 +75,7 @@ + + echo -n "Setting Window Maker root menu... " + +-if [ -z "$new_locale" ] || [ "$new_locale" == "en" ]; then ++if [ -z "$new_locale" ] || [ "$new_locale" = "en" ]; then + menu_list="plmenu menu" + else + menu_list="plmenu.$new_locale menu.$new_locale plmenu menu" +@@ -88,7 +88,12 @@ + else + echo "fail (copying default)" + fi +- if [ "${new_menu:0:4}" == "menu" ]; then # plain ++ new_menu_tmp=$new_menu ++ # Set new_menu_tmp to first 4 letters of $new_menu. ++ while [ ${#new_menu_tmp} -gt 4 ]; do ++ new_menu_tmp=${new_menu_tmp%?} ++ done ++ if [ "${new_menu_tmp}" = "menu" ]; then # plain + echo "\"$wm_dir/$new_menu\"" >"$GSDIR/Defaults/WMRootMenu" + else # proplist + cp -f "$wm_dir/$new_menu" "$GSDIR/Defaults/WMRootMenu" +@@ -104,7 +109,7 @@ + + echo -n "Setting Window Maker fonts... " + +-if [ -z "$new_locale" ] || [ "$new_locale" == "en" ]; then ++if [ -z "$new_locale" ] || [ "$new_locale" = "en" ]; then + args="default $nodef" + else + args="--locale=$new_locale $nodef" -- cgit v1.2.3