aboutsummaryrefslogtreecommitdiff
path: root/sbopkglint.d/pre-doinst.sh
blob: 523b21e7446fae6b99f83d6f0c1bd24fc56b353d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/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 \
usr/lib/perl5/perllocal.pod \
usr/lib64/perl5/perllocal.pod \
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

[ -f install/slack-desc ] || warn "required file install/slack-desc is missing"