=================================================================== RCS file: /cvs/openbsd/sxxu/Attic/install.sxxu,v retrieving revision 1.14 retrieving revision 1.18 diff -u -r1.14 -r1.18 --- openbsd/sxxu/Attic/install.sxxu 2010/04/22 23:25:00 1.14 +++ openbsd/sxxu/Attic/install.sxxu 2010/04/23 22:27:27 1.18 @@ -1,5 +1,5 @@ #!/bin/ksh - -# $Id: install.sxxu,v 1.14 2010/04/22 22:25:00 andrew Exp $ +# $Id: install.sxxu,v 1.18 2010/04/23 21:27:27 andrew Exp $ # Copyright (c) 2010 Andrew Fresh # @@ -42,10 +42,13 @@ fi local _roles + unset _roles set -A _roles local _role while read _role; do if [ -n "${_role}" ]; then + _role=${_role%%#*} # strip comments + test -z "$_role" && continue _roles[${#_roles[@]}]="$_role" fi done < roles @@ -64,12 +67,15 @@ echo ' ==> Setting PKG_PATH' local _line while read _line; do + _line=${_line%%#*} # strip comments + test -z "$_line" && continue if [ -z "${PKG_PATH}" ]; then PKG_PATH="$_line" else PKG_PATH="${PKG_PATH}:${_line}" fi done < pkg_path + PKG_PATH=`eval echo $PKG_PATH` } @@ -84,9 +90,11 @@ echo " ==> Running $_cmd $_args" local _line while read _line; do + _line=${_line%%#*} # strip comments + test -z "$_line" && continue echo " => ${_cmd} ${_args} ${_line}" eval ${_cmd} ${_args} ${_line} - done < ${_f} + done < "${_f}" done } @@ -101,7 +109,7 @@ # -N Always assume a forward patch. # -t Never prompt; assume the user is expert # -p0 full path, always - patch -N -t -p0 -d / < $_p + patch -N -t -p0 -d / < "$_p" done } @@ -123,7 +131,7 @@ return fi - echo "===> Applying ${_role}" + echo "===> Applying role ${_role}" cd "${_rolepwd}" if [ -e ./siteXXrc ]; then