summaryrefslogtreecommitdiffstats
path: root/abuild.in
diff options
context:
space:
mode:
authorSören Tempel <soeren+git@soeren-tempel.net>2015-08-14 17:07:28 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2015-08-17 11:41:19 +0200
commitcf65c9b41b2020138d751ffdca58530d9009d8f2 (patch)
treebe8a208e2f6f4918ee60d735b09d6348fbc30dd5 /abuild.in
parentb8b492924505656dd45f6e3720203e1f8a2dcfd4 (diff)
downloadabuild-cf65c9b41b2020138d751ffdca58530d9009d8f2.tar.bz2
abuild-cf65c9b41b2020138d751ffdca58530d9009d8f2.tar.xz
abuild: check for /usr/share/{doc,man}
Output a warning if those directories exist on a non-doc package. Furthermore, check if uncompressed man pages where installed to /usr/share/man.
Diffstat (limited to 'abuild.in')
-rw-r--r--abuild.in23
1 files changed, 23 insertions, 0 deletions
diff --git a/abuild.in b/abuild.in
index 01b4b62..17fae62 100644
--- a/abuild.in
+++ b/abuild.in
@@ -645,6 +645,24 @@ postcheck() {
error "Found /usr/lib/charset.alias"
return 1
fi
+ # look for /usr/share/doc
+ if [ -e "$dir"/usr/share/doc ] \
+ && ! is_doc_pkg; then
+ warning "Found /usr/share/doc but package name doesn't end with -doc"
+ fi
+ # look for /usr/share/man
+ if [ -e "$dir"/usr/share/man ] \
+ && ! is_doc_pkg; then
+ warning "Found /usr/share/man but package name doesn't end with -doc"
+
+ # check for uncompressed man pages
+ i=$(find "$dir"/usr/share/man -name '*.[0-9]' -type f | sed "s|^$dir|\t|")
+ if [ -n "$i" ]; then
+ error "Found uncompressed man pages:"
+ echo "$i"
+ return 1
+ fi
+ fi
# check directory permissions
i=$(find "$dir" -type d -perm -777 | sed "s|^$dir|\t|")
if [ -n "$i" ]; then
@@ -946,6 +964,11 @@ is_dev_pkg() {
test "${subpkgname%-dev}" != "$subpkgname"
}
+# returns true if this is the -doc package
+is_doc_pkg() {
+ test "${subpkgname%-doc}" != "$subpkgname"
+}
+
# check that noarch is set if needed
archcheck() {
options_has "!archcheck" && return 0