# HG changeset patch # User Edho Prima Arief # Date 1319707903 -25200 # Node ID fcef92b3f37fc2c415e4ae18ed150da54f14f140 # Parent 66a1d79c41617b3007a9bb88d0e7bd773c81611a Forgot to check whether the file actually exists. diff -r 66a1d79c4161 -r fcef92b3f37f setup --- a/setup Thu Oct 27 16:29:39 2011 +0700 +++ b/setup Thu Oct 27 16:31:43 2011 +0700 @@ -47,12 +47,15 @@ _srcfile="${rcdir}/${2}" _dstfile="${HOME}/${3}" if test ! -h "${_dstfile}"; then + _fexist=0 if test -f "${_dstfile}"; then cp "${_dstfile}" "${_dstfile}.bak" + _fexist=1 elif test -d "${_dstfile}"; then cp -r "${_dstfile}" "${_dstfile}.bak" + _fexist=1 fi - _echo "${_dstfile} backed up to ${_dstfile}.bak" + test "${_fexist}" = 1 &&_echo "${_dstfile} backed up to ${_dstfile}.bak" fi rm -f "${_dstfile}" case "${1}" in