aboutsummaryrefslogtreecommitdiff
path: root/sbopkglint.d/15-noarch.t.sh
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2023-12-13 02:32:07 -0500
committerB. Watson <urchlay@slackware.uk>2023-12-13 02:32:07 -0500
commitb86efd8389fa6b8e7d0974bf02c029474caeab8f (patch)
treef3aeb78d0e460b19c349e754f9ca2f90cca18a7f /sbopkglint.d/15-noarch.t.sh
parentb67c4f3cae5d79a519f8f459638829446006adb7 (diff)
downloadsbo-maintainer-tools-b86efd8389fa6b8e7d0974bf02c029474caeab8f.tar.gz
sbopkglint: don't suggest noarch if package contains static libs.
Diffstat (limited to 'sbopkglint.d/15-noarch.t.sh')
-rw-r--r--sbopkglint.d/15-noarch.t.sh11
1 files changed, 9 insertions, 2 deletions
diff --git a/sbopkglint.d/15-noarch.t.sh b/sbopkglint.d/15-noarch.t.sh
index 858b19e..075fdb1 100644
--- a/sbopkglint.d/15-noarch.t.sh
+++ b/sbopkglint.d/15-noarch.t.sh
@@ -10,15 +10,22 @@
# for packages that aren't noarch, recommend noarch if it looks like one.
# the recommendation is not an error!
+# shared libs and executables:
find * -type f -print0 | xargs -0 file -m /etc/file/magic/elf | grep ELF | cut -d: -f1 | xargs -rd "\n" ls -lb > .elfbins.$$
+# static libs (for now, just going by filename!)
+find * -type f -a -name '*.a' | xargs -rd "\n" ls -lb > .statlibs.$$
+
if [ "$ARCH" = "noarch" ]; then
[ -s .elfbins.$$ ] && \
warn "package claims to be noarch, but contains ELF binaries:" && \
cat .elfbins.$$
-elif [ ! -s .elfbins.$$ ] && [ ! -e usr/lib ] && [ ! -e usr/lib64 ]; then
+ [ -s .statlibs.$$ ] && \
+ warn "package claims to be noarch, but contains static libraries:" && \
+ cat .statlibs.$$
+elif [ ! -s .statlibs.$$ ] && [ ! -s .elfbins.$$ ] && [ ! -e usr/lib ] && [ ! -e usr/lib64 ]; then
x="$( find usr/share/pkgconfig -type f -exec grep 'usr/lib' {} \+ 2>/dev/null )"
[ -z "$x" ] && note "package might be a good candidate for noarch"
fi
-rm -f .elfbins.$$
+rm -f .elfbins.$$ .statlibs.$$