version 1.14, 2010/04/22 23:25:00 |
version 1.19, 2013/04/20 22:34:57 |
|
|
fi |
fi |
|
|
local _roles |
local _roles |
|
unset _roles |
set -A _roles |
set -A _roles |
local _role |
local _role |
while read _role; do |
while read _role; do |
if [ -n "${_role}" ]; then |
if [ -n "${_role}" ]; then |
|
_role=${_role%%#*} # strip comments |
|
test -z "$_role" && continue |
_roles[${#_roles[@]}]="$_role" |
_roles[${#_roles[@]}]="$_role" |
fi |
fi |
done < roles |
done < roles |
|
|
|
|
|
|
append_pkg_path() { |
append_pkg_path() { |
[ ! -e pkg_path ] && return |
[ -e pkg_path -o -d packages ] || return |
|
|
echo ' ==> Setting PKG_PATH' |
echo ' ==> Setting PKG_PATH' |
|
[ -d packages ] && PKG_PATH="${PKG_PATH}:${PWD}/packages" |
|
[ -e pkg_path ] || return; |
local _line |
local _line |
while read _line; do |
while read _line; do |
if [ -z "${PKG_PATH}" ]; then |
_line=${_line%%#*} # strip comments |
PKG_PATH="$_line" |
[ -z "$_line" ] && continue |
else |
PKG_PATH="${PKG_PATH}:${_line}" |
PKG_PATH="${PKG_PATH}:${_line}" |
|
fi |
|
done < pkg_path |
done < pkg_path |
PKG_PATH=`eval echo $PKG_PATH` |
|
|
PKG_PATH=`eval echo $PKG_PATH | sed -e 's/^:*//'` |
} |
} |
|
|
run_command_lists() { |
run_command_lists() { |
|
|
echo " ==> Running $_cmd $_args" |
echo " ==> Running $_cmd $_args" |
local _line |
local _line |
while read _line; do |
while read _line; do |
|
_line=${_line%%#*} # strip comments |
|
test -z "$_line" && continue |
echo " => ${_cmd} ${_args} ${_line}" |
echo " => ${_cmd} ${_args} ${_line}" |
eval ${_cmd} ${_args} ${_line} |
eval ${_cmd} ${_args} ${_line} |
done < ${_f} |
done < "${_f}" |
done |
done |
} |
} |
|
|
|
|
# -N Always assume a forward patch. |
# -N Always assume a forward patch. |
# -t Never prompt; assume the user is expert |
# -t Never prompt; assume the user is expert |
# -p0 full path, always |
# -p0 full path, always |
patch -N -t -p0 -d / < $_p |
patch -N -t -p0 -d / < "$_p" |
done |
done |
} |
} |
|
|
|
|
return |
return |
fi |
fi |
|
|
echo "===> Applying ${_role}" |
echo "===> Applying role ${_role}" |
|
|
cd "${_rolepwd}" |
cd "${_rolepwd}" |
if [ -e ./siteXXrc ]; then |
if [ -e ./siteXXrc ]; then |