diff options
author | B. Watson <urchlay@slackware.uk> | 2023-02-03 16:12:59 -0500 |
---|---|---|
committer | B. Watson <urchlay@slackware.uk> | 2023-02-03 16:12:59 -0500 |
commit | 01f35ed9fffde74ce22e7fafb336f49fef4427b3 (patch) | |
tree | d2a295d24a7ce5648db7b84e91d630a3b322fefe /sbopkglint.d | |
parent | 92f98a10b4b07885ce48556e94ae476c54057226 (diff) | |
download | sbo-maintainer-tools-01f35ed9fffde74ce22e7fafb336f49fef4427b3.tar.gz |
sbopkglint: add pre-doinst test.
Diffstat (limited to 'sbopkglint.d')
-rw-r--r-- | sbopkglint.d/05-basic-sanity.t.sh | 2 | ||||
-rw-r--r-- | sbopkglint.d/pre-doinst.sh | 42 |
2 files changed, 42 insertions, 2 deletions
diff --git a/sbopkglint.d/05-basic-sanity.t.sh b/sbopkglint.d/05-basic-sanity.t.sh index 3b98c74..b879729 100644 --- a/sbopkglint.d/05-basic-sanity.t.sh +++ b/sbopkglint.d/05-basic-sanity.t.sh @@ -50,8 +50,6 @@ requiredfiles="usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild" # these files must not exist. badfiles="\ -usr/info/dir \ -usr/info/dir.gz \ usr/lib64/perl5/perllocal.pod \ usr/lib/perl5/perllocal.pod \ usr/share/perl5/perllocal.pod \ diff --git a/sbopkglint.d/pre-doinst.sh b/sbopkglint.d/pre-doinst.sh new file mode 100644 index 0000000..8df1a8c --- /dev/null +++ b/sbopkglint.d/pre-doinst.sh @@ -0,0 +1,42 @@ +#!/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. + +# Unlike the rest of the tests (those ending in .t.sh), this one runs +# before the package's doinst.sh does. Purpose for this is to check +# for the existence of stuff in the package tarball that shouldn't be +# there (e.g. /usr/info/dir), but might correctly be created by doinst.sh. + +####################################################################### +badfiles="\ +usr/info/dir \ +usr/info/dir.gz \ +usr/share/icons/hicolor/icon-theme.cache \ +usr/share/glib-2.0/schemas/gschemas.compiled \ +usr/share/mime/mime.cache \ +usr/share/applications/mimeinfo.cache \ +usr/lib/gio/modules/giomodule.cache \ +usr/lib64/gio/modules/giomodule.cache \ +var/cache/fontconfig/CACHEDIR.TAG \ +var/cache/man/usr-man/CACHEDIR.TAG" + +for i in $badfiles; do + if [ -e "$i" ]; then + warn "package contains forbidden file: $i" + fi +done + +if [ -d usr/share/fonts ]; then + badfontstuff="$( find usr/share/fonts -name 'fonts.*' )" + if [ -n "$badfontstuff" ]; then + warn "package contains forbidden file(s): $badfontstuff" + fi +fi + +badlinks="$( find -P . -type l )" +if [ -n "$badfontstuff" ]; then + warn "package contains actual symlinks: $badlinks" +fi |