scripts/finish: do not try to symlink if sed expr is a no-op

If the sed expression does not transform the
tuple, do not try to create the symlink.
This commit is contained in:
Yann E. MORIN" 2010-07-07 22:33:49 +02:00
parent e8a36ea13c
commit 58ade1d7aa

View File

@ -31,8 +31,12 @@ do_finish() {
fi fi
if [ -n "${CT_TARGET_ALIAS_SED_EXPR}" ]; then if [ -n "${CT_TARGET_ALIAS_SED_EXPR}" ]; then
_t=$(echo "$t" |sed -r -e "${CT_TARGET_ALIAS_SED_EXPR}") _t=$(echo "$t" |sed -r -e "${CT_TARGET_ALIAS_SED_EXPR}")
if [ "${_t}" = "${t}" ]; then
CT_DoLog WARN "The sed expression '${CT_TARGET_ALIAS_SED_EXPR}' has no effect on '${t}'"
else
CT_DoExecLog ALL ln -sv "${t}" "${_t}" CT_DoExecLog ALL ln -sv "${t}" "${_t}"
fi fi
fi
done done
CT_Popd CT_Popd