# HG changeset patch # User Edho Arief # Date 1332061328 -25200 # Node ID 795ad57794a6e052bb9d25dd28712df8842dc570 # Parent 391f2b64900e604b757e3c523dd107d0716faaa4 [setup] Returning solaris compatibility. diff -r 391f2b64900e -r 795ad57794a6 setup --- a/setup Sun Mar 18 13:23:06 2012 +0700 +++ b/setup Sun Mar 18 16:02:08 2012 +0700 @@ -1,5 +1,8 @@ #!/bin/sh +set -u +set -e + basedir="`dirname "${0}"`" cd "${basedir}" basedir="`pwd`" @@ -50,7 +53,7 @@ fi _srcfile="${rcdir}/${2}" _dstfile="${HOME}/${3}" - _dstdir="${_dstfile%/*}" + _dstdir="`_echo "${_dstfile}" | sed -e 's,^\(.*\)/[^/]*$,\1,'`" mkdir -p "${_dstdir}" if test ! -h "${_dstfile}"; then if test -f "${_dstfile}"; then @@ -76,9 +79,10 @@ _init() { _script="${HOME}/${3}" _scripttmp="${HOME}/.tmp.${3}" + rm -f "${_scripttmp}" _data="${2}" if [ -f "${_script}" ]; then - grep -v "`printf "%s\n" "${_data}" | sed 's/.*#//'`" "${_script}" > "${_scripttmp}" + sed -e "/`_echo "${_data}" | sed -e 's/.*#//'`/d" "${_script}" > "${_scripttmp}" mv -f "${_scripttmp}" "${_script}" fi case "${1}" in @@ -100,9 +104,9 @@ case "${1}" in install|uninstall) - for i in tcsh bash zsh; do - _"${i}" "${1}" - done + _tcsh "${1}" + _bash "${1}" + _zsh "${1}" _rc "${1}" "tmux" ".tmux.conf" _rc "${1}" "hg" ".hgrc" _rc "${1}" "vimrc" ".vimrc"