--- mcore-src/trunk/mcore-tools/daemon/include/daemon.global.class 2013/05/10 09:09:36 2073 +++ mcore-src/trunk/mcore-tools/daemon/include/daemon.global.class 2014/01/02 16:28:46 2115 @@ -226,7 +226,8 @@ # show missing and set the right retval if [[ -z ${missing} ]] then - rvecho "${sorted}" + # do not escape, or CRLFS get printed to screen too + rvecho ${sorted} return 0 else for req in ${sorted} @@ -234,12 +235,14 @@ if no_duplicate "${missing}" "$req" then # print normal - rvecho -n " ${req}" + rvecho -n "${req} " else # print missing - eecho -n " ${req}" + eecho -n "${req} " fi done + # print CRLF + echo return 1 fi } @@ -411,7 +414,7 @@ -mindepth) shift; opts+=" -mindepth $1" ;; -maxdepth) shift; opts+=" -maxdepth $1" ;; -type) shift; type="$1" ;; - -name) shift; opts+="-name $1" ;; + -name) shift; opts+=" -name $1" ;; '') continue ;; *) path="$1" ;; esac @@ -433,13 +436,13 @@ # default to files [[ -z ${type} ]] && type=f - for i in $(find ${path} ${opts} -type ${type} | sort) + for i in $(find ${path} ${opts} -type ${type} -printf '%f\n' | sort) do if [[ -z ${retval} ]] then - retval="$(basename ${i})" + retval="${i}" else - retval="${retval} $(basename ${i})" + retval+=" ${i}" fi done @@ -451,3 +454,20 @@ echo "mcored-$(<${MCLIBDIR}/VERSION)" } +system_chroot() +{ + local cmd="$@" + if [[ -z ${MROOT} ]] + then + echo "system_chroot(): \$MROOT was not set, doing nothing!" + return 1 + fi + if [ ! -d ${MROOT} ] + then + eecho "system_chroot(): MROOT='${MROOT}' does not exist." + return 1 + fi + + chroot ${MROOT} ${cmd} +} +