diff options
author | jlam <jlam@pkgsrc.org> | 2001-07-15 08:46:00 +0000 |
---|---|---|
committer | jlam <jlam@pkgsrc.org> | 2001-07-15 08:46:00 +0000 |
commit | c9f42f14c2f9e07eb671ea062d9f2993d53ec717 (patch) | |
tree | d534331a356734d52c1af4329e63d103bb6a8fa5 /wm | |
parent | fceb89172e5e04495e349755886195f4b32ec6bf (diff) | |
download | pkgsrc-c9f42f14c2f9e07eb671ea062d9f2993d53ec717.tar.gz |
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.
Diffstat (limited to 'wm')
-rw-r--r-- | wm/windowmaker/patches/patch-af | 63 |
1 files changed, 63 insertions, 0 deletions
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" |