summaryrefslogtreecommitdiffstats
path: root/source/ap/man-pages/man-pages.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'source/ap/man-pages/man-pages.SlackBuild')
-rwxr-xr-xsource/ap/man-pages/man-pages.SlackBuild15
1 files changed, 10 insertions, 5 deletions
diff --git a/source/ap/man-pages/man-pages.SlackBuild b/source/ap/man-pages/man-pages.SlackBuild
index 643be6153..09bf90cbd 100755
--- a/source/ap/man-pages/man-pages.SlackBuild
+++ b/source/ap/man-pages/man-pages.SlackBuild
@@ -85,13 +85,18 @@ gzip -9 $PKG/usr/man/man*/*.*
# If a man page exists in some other package, assume that's the
# newer, better version:
echo "Pruning manpages found in other packages..."
+TEMPDIR=$(mktemp -d)
+chmod 700 $TEMPDIR
+( cd $PKG ; /bin/ls usr/man/man*/*.gz | sort > $TEMPDIR/man-pages-pages )
+( cd /var/log/packages
+ GLOBIGNORE="$(/bin/ls man-pages-*)"
+ cat * | grep usr/man | sort | uniq > $TEMPDIR/other-packages-pages
+ unset GLOBIGNORE
+)
( cd $PKG
- for file in usr/man/man*/*.gz ; do
- if grep -l $file /var/log/packages/* | grep -v var/log/packages/man-pages ; then
- rm -f --verbose $file
- fi
- done
+ comm -12 $TEMPDIR/man-pages-pages $TEMPDIR/other-packages-pages | xargs rm --verbose
)
+rm -r $TEMPDIR
# Some of the posix pages don't display correctly without this
( cd $PKG/usr/man ; ln -s man3 man3p )