aboutsummaryrefslogtreecommitdiff
path: root/sbopkglint.d/15-noarch.t.sh
blob: 55c17f6d800971152ebb8ec5915a245f8de54b99 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/sh

# sbopkglint test, must be sourced by sbopkglint (not run standalone).

# PKG, PRGNAM, VERSION, ARCH are set by sbopkglint. also the current
# directory is the root of the installed package tree.

########################################################################
# makes sure "noarch" packages really are noarch.

if [ "$ARCH" = "noarch" ]; then
	elfbins="$( find * -type f -print0 | xargs -0 file -m /etc/file/magic/elf | grep ELF | cut -d: -f1 )"
	[ -n "$elfbins" ] && warn "package claims to be noarch, but contains ELF binaries:" && ls -l $elfbins
fi