View | Details | Raw Unified | Return to bug 199106 | Differences between
and this patch

Collapse All | Expand All

(-)Mk/bsd.port.mk (-1 / +1 lines)
Lines 5260-5266 Link Here
5260
.if !target(stage-qa)
5260
.if !target(stage-qa)
5261
stage-qa:
5261
stage-qa:
5262
	@${ECHO_MSG} "====> Running Q/A tests (stage-qa)"
5262
	@${ECHO_MSG} "====> Running Q/A tests (stage-qa)"
5263
	@${SETENV} ${QA_ENV} ${SH} ${SCRIPTSDIR}/qa.sh
5263
	@${SETENV} ${QA_ENV} ${SH} ${SCRIPTSDIR}/qa.sh "${PKGNAME}"
5264
.endif
5264
.endif
5265
5265
5266
# Fake installation of package so that user can pkg delete it later.
5266
# Fake installation of package so that user can pkg delete it later.
(-)Mk/Scripts/qa.sh (-1 / +53 lines)
Lines 7-12 Link Here
7
	exit 1
7
	exit 1
8
fi
8
fi
9
9
10
usage () {
11
	echo "usage: $0 pkg-name"
12
	exit 1
13
}
14
15
[ "$#" -eq 1 ] || usage
16
PKG_NAME=$1
17
10
LF=$(printf '\nX')
18
LF=$(printf '\nX')
11
LF=${LF%X}
19
LF=${LF%X}
12
20
Lines 18-23 Link Here
18
	echo "Error: $@" >&2
26
	echo "Error: $@" >&2
19
}
27
}
20
28
29
listcontains() {
30
	local str lst elt
31
	str=$1
32
	lst=$2
33
34
	for elt in ${lst} ; do
35
		if [ ${elt} = ${str} ] ; then
36
			return 0
37
		fi
38
	done
39
	return 1
40
}
41
42
list_staged_execs() {
43
	find ${STAGEDIR} -type f \
44
		\( -perm -u+x -or -perm -g+x -or -perm -o+x \) \
45
		-and -exec /bin/sh -c "ldd {} > /dev/null 2>&1" \; \
46
		-and -exec echo {} \;
47
}
48
49
list_all_deps() {
50
	ldd "$1" | grep -v "^\/" | sed -e 's/.*=> //' -e 's/ .*//' | sort | uniq
51
}
52
21
shebangonefile() {
53
shebangonefile() {
22
	local f interp rc
54
	local f interp rc
23
55
Lines 255-262 Link Here
255
	fi
287
	fi
256
}
288
}
257
289
258
checks="shebang symlinks paths stripped desktopfileutils sharedmimeinfo suidfiles libtool libperl"
290
basemix() {
291
	if expr "${PKG_NAME}" : '^pkg-[0-9]' > /dev/null ; then
292
		return 0
293
	fi
294
	# shared libraries from base banned from being used by ports
295
	local banned="libssl.so libcrypto.so"
296
	for file in $(list_staged_execs); do
297
		local dep_files=$(list_all_deps "${file}")
298
		for dep_file in $dep_files; do
299
			if expr "$dep_file" : '^/lib/' \| "$dep_file" : '^/usr/lib/' > /dev/null ; then
300
				local so_name=$(echo "${dep_file}" | sed -e "s/.*\///g" -e "s/\.so.*/.so/")
301
				if listcontains "${so_name}" "${banned}" ; then
302
					err "Shared library ${so_name} from the base system should not be used by port."
303
					return 1
304
				fi
305
			fi
306
		done
307
	done
308
}
259
309
310
checks="shebang symlinks paths stripped desktopfileutils sharedmimeinfo suidfiles libtool libperl basemix"
311
260
ret=0
312
ret=0
261
cd ${STAGEDIR}
313
cd ${STAGEDIR}
262
for check in ${checks}; do
314
for check in ${checks}; do

Return to bug 199106