aboutsummaryrefslogtreecommitdiff
path: root/sbopkglint.d/15-noarch.t.sh
diff options
context:
space:
mode:
Diffstat (limited to 'sbopkglint.d/15-noarch.t.sh')
-rw-r--r--sbopkglint.d/15-noarch.t.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/sbopkglint.d/15-noarch.t.sh b/sbopkglint.d/15-noarch.t.sh
new file mode 100644
index 0000000..55c17f6
--- /dev/null
+++ b/sbopkglint.d/15-noarch.t.sh
@@ -0,0 +1,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