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

Collapse All | Expand All

(-)Mk/bsd.port.mk (+1 lines)
Lines 1531-1536 Link Here
1531
				LOCALBASE=${LOCALBASE} \
1531
				LOCALBASE=${LOCALBASE} \
1532
				"STRIP=${STRIP}" \
1532
				"STRIP=${STRIP}" \
1533
				TMPPLIST=${TMPPLIST}
1533
				TMPPLIST=${TMPPLIST}
1534
QA_ENV+=		PKGNAME=${PKGNAME}
1534
.if !empty(USES:Mdesktop-file-utils)
1535
.if !empty(USES:Mdesktop-file-utils)
1535
QA_ENV+=		USESDESKTOPFILEUTILS=yes
1536
QA_ENV+=		USESDESKTOPFILEUTILS=yes
1536
.endif
1537
.endif
(-)Mk/Scripts/qa.sh (-1 / +45 lines)
Lines 18-23 Link Here
18
	echo "Error: $@" >&2
18
	echo "Error: $@" >&2
19
}
19
}
20
20
21
listcontains() {
22
	local str lst elt
23
	str=$1
24
	lst=$2
25
26
	for elt in ${lst} ; do
27
		if [ ${elt} = ${str} ] ; then
28
			return 0
29
		fi
30
	done
31
	return 1
32
}
33
34
list_staged_execs() {
35
	find ${STAGEDIR} -type f \
36
		\( -perm -u+x -or -perm -g+x -or -perm -o+x \) \
37
		-and -exec /bin/sh -c "ldd {} > /dev/null 2>&1" \; \
38
		-and -exec echo {} \;
39
}
40
41
list_all_deps() {
42
	ldd "$1" | grep -v "^\/" | sed -e 's/.*=> //' -e 's/ .*//' | sort | uniq
43
}
44
21
shebangonefile() {
45
shebangonefile() {
22
	local f interp rc
46
	local f interp rc
23
47
Lines 255-262 Link Here
255
	fi
279
	fi
256
}
280
}
257
281
258
checks="shebang symlinks paths stripped desktopfileutils sharedmimeinfo suidfiles libtool libperl"
282
basemix() {
283
	if expr "${PKGNAME}" : '^pkg-[0-9]' > /dev/null ; then
284
		return 0
285
	fi
286
	# shared libraries from base banned from being used by ports
287
	local banned="libssl.so libcrypto.so"
288
	for file in $(list_staged_execs); do
289
		local dep_files=$(list_all_deps "${file}")
290
		for dep_file in $dep_files; do
291
			if expr "$dep_file" : '^/lib/' \| "$dep_file" : '^/usr/lib/' > /dev/null ; then
292
				local so_name=$(echo "${dep_file}" | sed -e "s/.*\///" -e "s/\.so.*/.so/")
293
				if listcontains "${so_name}" "${banned}" ; then
294
					err "Shared library ${so_name} from the base system should not be used by port."
295
					return 1
296
				fi
297
			fi
298
		done
299
	done
300
}
259
301
302
checks="shebang symlinks paths stripped desktopfileutils sharedmimeinfo suidfiles libtool libperl basemix"
303
260
ret=0
304
ret=0
261
cd ${STAGEDIR}
305
cd ${STAGEDIR}
262
for check in ${checks}; do
306
for check in ${checks}; do

Return to bug 199106