Skip to content

Commit ceeced7

Browse files
committed
filters/retro-drop-docs: drop unneeded manual pages
We should only keep manual pages in section 1 (User Commands), section 5 (File Formats), Section 6 (Games), Section 7 (Conventions and Misc.) and Section 8 (Administrative Commands).
1 parent 52b1e50 commit ceeced7

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

filters/20-retro_drop_docs.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,32 @@
11
#!/bin/bash
22
##filter/retro_drop_docs.sh: Drop /usr/share/{,gtk-}doc for Retro architectures.
33
##@copyright GPL-2.0+
4+
5+
# Drop any manpage that is not in Section 1 (User Commands), Section 5
6+
# (File Formants), Section 6 (Games), Section 7 (conventions) and
7+
# Section 8 (Administrative Commands).
8+
_retro_drop_manpages() {
9+
local tgt="$1"
10+
if [ -z "$tgt" ] ; then
11+
tgt="$PKGDIR/usr/share/man"
12+
fi
13+
for dir in `find "$tgt" -mindepth 1 -maxdepth 1 -type d -printf '%P\n'` ; do
14+
# Check the translations first: /usr/share/man/$LOCALE
15+
if [ "${dir##man}" == "$dir" ] ; then
16+
_retro_drop_manpages "$tgt"/"$dir"
17+
continue
18+
fi
19+
if [ "${dir%%[15678]}" == "$dir" ] ; then
20+
for manfile in `find "$tgt"/"$dir" -mindepth 1 -not -type d` ; do
21+
abinfo "Removing $manfile ..."
22+
rm "$manfile"
23+
done
24+
abinfo "Removing $tgt/$dir ..."
25+
rm -rv "$tgt/$dir"
26+
fi
27+
done
28+
}
29+
430
filter_retro_drop_docs() {
531
if ab_match_archgroup retro; then
632
if [ -d "$PKGDIR"/usr/share/doc ]; then
@@ -15,6 +41,11 @@ filter_retro_drop_docs() {
1541
abinfo "Dropping gtk-doc ..."
1642
rm -r "$PKGDIR"/usr/share/gtk-doc
1743
fi
44+
45+
# Drop any unnecessary manual pages.
46+
if [ -d "$PKGDIR"/usr/share/man ] ; then
47+
_retro_drop_manpages "$PKGDIR"/usr/share/man
48+
fi
1849
else
1950
abinfo "Non-Retro architectures detected, skipping retro_drop_docs ..."
2051
fi

0 commit comments

Comments
 (0)