Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.sbin/postinstall Clean up cat pages that are older than ...
details: https://anonhg.NetBSD.org/src/rev/03c8fea25f8b
branches: trunk
changeset: 773752:03c8fea25f8b
user: joerg <joerg%NetBSD.org@localhost>
date: Wed Feb 15 13:01:00 2012 +0000
description:
Clean up cat pages that are older than the corresponding man pages.
Remove cat page directories that are empty.
diffstat:
usr.sbin/postinstall/postinstall | 60 ++++++++++++++++++++++++++++++++++++++-
1 files changed, 58 insertions(+), 2 deletions(-)
diffs (83 lines):
diff -r 85fe1898d0fb -r 03c8fea25f8b usr.sbin/postinstall/postinstall
--- a/usr.sbin/postinstall/postinstall Wed Feb 15 12:11:42 2012 +0000
+++ b/usr.sbin/postinstall/postinstall Wed Feb 15 13:01:00 2012 +0000
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $NetBSD: postinstall,v 1.128 2011/12/17 13:37:49 tsutsui Exp $
+# $NetBSD: postinstall,v 1.129 2012/02/15 13:01:00 joerg Exp $
#
# Copyright (c) 2002-2008 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -1143,7 +1143,7 @@
irdaattach iscsi_target isdnd isibootd \
kdc \
ldconfig local lpd lvm\
- mdnsd mixerctl mopd motd mountall mountcritlocal \
+ makemandb mdnsd mixerctl mopd motd mountall mountcritlocal \
mountcritremote mountd moused mrouted \
named ndbootd network newsyslog nfsd nfslocking npf \
ntpd ntpdate \
@@ -1583,6 +1583,62 @@
return ${failed}
}
+#
+# catpages
+#
+obsolete_catpages()
+{
+ basedir="$2"
+ section="$3"
+ mandir="${basedir}/man${section}"
+ catdir="${basedir}/cat${section}"
+ test -d "$mandir" || return 0
+ test -d "$catdir" || return 0
+ (cd "$mandir" && find . -type f) | {
+ failed=0
+ while read manpage; do
+ manpage="${manpage#./}"
+ case "$manpage" in
+ *.Z)
+ catname="$catdir/${manpage%.*.Z}.0"
+ ;;
+ *.gz)
+ catname="$catdir/${manpage%.*.gz}.0"
+ ;;
+ *)
+ catname="$catdir/${manpage%.*}.0"
+ ;;
+ esac
+ test -e "$catname" -a "$catname" -ot "$mandir/$manpage" || continue
+ if [ "$1" = "fix" ]; then
+ rm "$catname"
+ failed=$(( ${failed} + $? ))
+ echo "Removed obsolete cat page $catname"
+ else
+ echo "Obsolete cat page $catname"
+ failed=1
+ fi
+ done
+ exit $failed
+ }
+}
+
+additem catpages "remove outdated cat pages"
+do_catpages()
+{
+ failed=0
+ for manbase in /usr/share/man /usr/X11R6/man /usr/X11R7/man; do
+ for sec in 1 2 3 4 5 6 7 8 9; do
+ obsolete_catpages $1 ${DEST_DIR}${manbase} ${sec}
+ failed=$(( ${failed} + $? ))
+ if [ "$1" = "fix" ]; then
+ rmdir ${DEST_DIR}${manbase}/cat${sec}/* 2>/dev/null
+ rmdir ${DEST_DIR}${manbase}/cat${sec} 2>/dev/null
+ fi
+ done
+ done
+ return $failed
+}
#
# obsolete
Home |
Main Index |
Thread Index |
Old Index