Mail archive
alpine-devel

[alpine-devel] [PATCH] abuild: check for man pages in non-standard locations

From: Sören Tempel <soeren+git_at_soeren-tempel.net>
Date: Tue, 18 Aug 2015 22:00:59 +0200

Some packages like fakeroot install man pages to
/usr/share/man/{de,fr,pl,...}. In my opinion we don't need those man
pages and thus I would suggest that only /usr/share/man[0-8] should
exist.

This also allows us to simply our check for non-compressed man pages.
---
 abuild.in | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/abuild.in b/abuild.in
index 6d393c8..da83ca1 100644
--- a/abuild.in
+++ b/abuild.in
_at_@ -655,13 +655,20 @@ postcheck() {
 		if ! is_doc_pkg "$name"; then
 			warning "Found /usr/share/man but package name doesn't end with -doc"
 		fi
-		# check for uncompressed man pages
-		i=$(find "$dir"/usr/share/man -name '*.[0-9]' -type f | sed "s|^$dir|\t|")
+		# check for man pages in non-standard locations
+		i=$(find "$dir"/usr/share/man -maxdepth 1 \! \( -name man[0-8] -a -type d \) -a \! -path "$dir"/usr/share/man | sed "s|^$dir|\t|")
 		if [ -n "$i" ]; then
-			error "Found uncompressed man pages:"
-			echo "$i"
+			error "Found non-standard man page sections:"
+			echo $i
 			return 1
 		fi
+		# check for uncompressed man pages
+		for i in "$dir"/usr/share/man/man[0-8]/*.[0-8]; do
+			if [ -e "$i" ]; then
+				error "Found uncompressed man pages: ${i#$dir/}"
+				return 1
+			fi
+		done
 	fi
 	# check directory permissions
 	i=$(find "$dir" -type d -perm -777 | sed "s|^$dir|\t|")
-- 
2.5.0
---
Unsubscribe:  alpine-devel+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-devel+help_at_lists.alpinelinux.org
---
Received on Tue Aug 18 2015 - 22:00:59 GMT