version 1.2, 2010/04/20 18:25:35 |
version 1.3, 2010/04/20 18:25:36 |
|
|
local _src=$1 |
local _src=$1 |
local _dst=$2 |
local _dst=$2 |
|
|
if [ ! -d $_src ]; then |
if [ ! -d "$_src" ]; then |
echo "$_src does not exist!" |
echo "$_src does not exist!" |
return |
return |
fi |
fi |
|
|
cd $_src |
cd $_src |
find . \ |
find . \( \ |
! -path './siteXX*' \ |
-path './siteXX' \ |
! -path '*/CVS*' \ |
-o -name 'CVS' \ |
! -path '*/.git*' \ |
-o -name '.git' \ |
! -path '*/.svn*' \ |
-o -name '.svn' \ |
|
\) -prune -o -print \ |
| { |
| { |
local _file |
local _file |
while read _file ; do |
while read _file ; do |
if [ -d $_file ]; then |
if [ -d "$_file" ]; then |
mkdir -p ${_dst}/${_file} |
mkdir -p "${_dst}/${_file}" |
else |
else |
cp $_file ${_dst}/${_file} |
cp "$_file" "${_dst}/${_file}" |
fi |
fi |
done |
done |
} |
} |
|
|
copy_special "${SRCDIR}/${_src}" "${WRKINST}" |
copy_special "${SRCDIR}/${_src}" "${WRKINST}" |
|
|
if [ -d ${SRCDIR}/${_src}/siteXX ]; then |
if [ -d ${SRCDIR}/${_src}/siteXX ]; then |
copy_special ${SRCDIR}/${_src}/siteXX ${WRKINST}/var/siteXX/${_src} |
copy_special "${SRCDIR}/${_src}/siteXX" "${WRKINST}/var/siteXX/${_src}" |
|
|
if [ -e ${SRCDIR}/${_src}/siteXX/roles ]; then |
if [ -e ${SRCDIR}/${_src}/siteXX/roles ]; then |
{ |
local _role |
local _role |
while read _role; do |
while read _role; do |
populate_from $_role |
populate_from $_role |
done < "${SRCDIR}/${_src}/siteXX/roles" |
done |
|
} < ${SRCDIR}/${_src}/siteXX/roles |
|
fi |
fi |
fi |
fi |
|
|
|
|
} |
} |
|
|
|
cd ${SRCDIR} |
|
|
machines=$* |
machines=$* |
if [ X"${machines}" == X"" ]; then |
if [ X"${machines}" == X"" ]; then |
local _d |
local _d |
for _d in *; do |
for _d in *; do |
[ ${_d#role-} != $_d ] && continue |
[ ${_d#role-} != "$_d" ] && continue |
machines="${machines} ${_d}" |
machines="${machines} ${_d}" |
done |
done |
fi |
fi |
|
|
for machine in ${machines} ; do |
for machine in ${machines} ; do |
|
machine=`basename ${machine}` |
|
if [ ! -d ${machine} ]; then |
|
echo ${machine} does not exist |
|
continue |
|
fi |
|
|
local _site=site${OSREV} |
local _site=site${OSREV} |
if [ X"${machine}" != X"${COMMONDIR}" ]; then |
if [ X"${machine}" != X"${COMMONDIR}" ]; then |
_site=${_site}-${machine} |
_site=${_site}-${machine} |