blob: 060568ab5c50569bc5c96fc555e1ad08b363e7a1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
# $NetBSD: check-interpreter.mk,v 1.4 2006/06/09 13:59:08 jlam Exp $
CHECK_INTERPRETER?= no
###########################################################################
# CHECK_INTERPRETER_SKIP is a list of shell globs. Installed files that
# match these globs are skipped when running the check-interpreter target.
#
CHECK_INTERPRETER_SKIP?= # empty
_CHECK_INTERP_SKIP_FILTER= case $$file in
.for _pattern_ in ${CHECK_INTERPRETER_SKIP}
_CHECK_INTERP_SKIP_FILTER+= ${PREFIX}/${_pattern_}|${_pattern_}) continue ;;
.endfor
_CHECK_INTERP_SKIP_FILTER+= *) ;;
_CHECK_INTERP_SKIP_FILTER+= esac
######################################################################
### check-interpreter (PRIVATE)
######################################################################
### check-interpreter verifies that the interpreters for all installed
### scripts exist.
###
.PHONY: check-interpreter
check-interpreter: error-check
@${STEP_MSG} "Checking for non-existent script interpreters" \
"in ${PKGNAME}"
.if !defined(NO_PKG_REGISTER)
${_PKG_SILENT}${_PKG_DEBUG}${RM} -f ${ERROR_DIR}/${.TARGET}
${_PKG_SILENT}${_PKG_DEBUG} \
exec 1>${ERROR_DIR}/${.TARGET}; \
${PKG_FILELIST_CMD} | ${SORT} | ${SED} 's,\\,\\\\,g' | \
while read file; do \
${_CHECK_INTERP_SKIP_FILTER}; \
${SHCOMMENT} "[$$file]"; \
interp=`${SED} -n -e '1s/^#![[:space:]]*\([^[:space:]]*\).*/\1/p' -e '1q' < "$$file"` \
|| { ${WARNING_MSG} "[check-interpreter.mk] sed(1) failed for \"$$file\"."; \
continue; \
}; \
case $$interp in \
"") continue; \
esac; \
if ${TEST} ! -f "$$interp"; then \
if ${TEST} -x "$$file"; then \
${ECHO} "[check-interpreter.mk] The interpreter \"$$interp\" of \"$$file\" does not exist."; \
else \
${WARNING_MSG} "[check-interpreter.mk] The interpreter \"$$interp\" of \"$$file\" does not exist."; \
fi; \
fi; \
done
.endif
|