Changeset View
Changeset View
Standalone View
Standalone View
Mk/Scripts/qa.sh
Show First 20 Lines • Show All 171 Lines • ▼ Show 20 Lines | while read l; do | ||||
# No results presents a blank line from heredoc. | # No results presents a blank line from heredoc. | ||||
[ -z "${l}" ] && continue | [ -z "${l}" ] && continue | ||||
read link | read link | ||||
case "${link}" in | case "${link}" in | ||||
${STAGEDIR}*) | ${STAGEDIR}*) | ||||
err "Bad symlink '${l#${STAGEDIR}${PREFIX}/}' pointing inside the stage directory" | err "Bad symlink '${l#${STAGEDIR}${PREFIX}/}' pointing inside the stage directory" | ||||
rc=1 | rc=1 | ||||
;; | ;; | ||||
/*) | ${PREFIX}/*|${LOCALBASE}/*) | ||||
# Only warn for symlinks within the package. | # Only warn for symlinks within the package. | ||||
if [ -e "${STAGEDIR}${link}" ]; then | if [ -e "${STAGEDIR}${link}" ]; then | ||||
warn "Bad symlink '${l#${STAGEDIR}}' pointing to an absolute pathname '${link}'" | warn "Bad symlink '${l#${STAGEDIR}}' pointing to an absolute pathname '${link}'" | ||||
warn "Use a symlink with a relative pathname instead." | |||||
fi | fi | ||||
# Don't stop here, continue with next check. | |||||
;& | |||||
/*) | |||||
# Also warn if the symlink exists nowhere. | # Also warn if the symlink exists nowhere. | ||||
if [ ! -e "${STAGEDIR}${link}" -a ! -e "${link}" ]; then | if [ ! -e "${STAGEDIR}${link}" -a ! -e "${link}" ]; then | ||||
warn "Symlink '${l#${STAGEDIR}}' pointing to '${link}' which does not exist in the stage directory or in localbase" | warn "Symlink '${l#${STAGEDIR}}' pointing to '${link}' which does not exist in the stage directory or in localbase" | ||||
fi | fi | ||||
;; | ;; | ||||
esac | esac | ||||
# Use heredoc to avoid losing rc from find|while subshell. | # Use heredoc to avoid losing rc from find|while subshell. | ||||
done <<-EOF | done <<-EOF | ||||
▲ Show 20 Lines • Show All 644 Lines • Show Last 20 Lines |