1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12: die() {
13: echo "$*" 1>&2
14: exit 1
15: }
16:
17: MANDIR=$1
18: if test x"$MANDIR" = x ; then
19: MANDIR=doc/api/man/man3dbus
20: fi
21:
22: cd "$MANDIR" || die "Could not cd to $MANDIR"
23:
24: test -d keep || mkdir keep || die "Could not create $MANDIR/keep directory"
25: test -d nuke || mkdir nuke || die "Could not create $MANDIR/nuke directory"
26:
27:
28: (find . -maxdepth 1 -name "_*" | xargs -I ITEMS /bin/mv ITEMS nuke) || die "could not move all underscore-prefixed items"
29: (find . -maxdepth 1 -name "DBus*Internal*" | xargs -I ITEMS /bin/mv ITEMS nuke) || die "could not move all internal-containing items"
30: (find . -maxdepth 1 -name "dbus_*_internal_*" | xargs -I ITEMS /bin/mv ITEMS nuke) || die "could not move all internal-containing items"
31:
32:
33:
34:
35: for I in DBusCounter.* DBusCredentials.* DBusDataSlot.* DBusDataSlotAllocator.* DBusDataSlotList.* \
36: DBusDirIter.* DBusFakeMutex.* DBusFreedElement.* DBusGroupInfo.* DBusGUID.* DBusHashEntry.* \
37: DBusHashIter.* DBusHashTable.* DBusHeader.* DBusHeaderField.* DBusKey.* DBusKeyring.* DBusList.* \
38: DBusMarshal.* DBusMD5* DBusMemBlock.* DBusMemPool.* DBusMessageGenerator.* DBusMessageLoader.* \
39: DBusMessageRealIter.* DBusObjectSubtree.* DBusObjectTree.* DBusPollFD.* DBusReal* \
40: DBusResources.* DBusServerDebugPipe.* DBusServerSocket.* DBusServerUnix.* \
41: DBusServerVTable.* DBusSHA.* DBusSHAContext.* DBusSignatureRealIter.* DBusStat.* DBusString.* \
42: DBusSysdeps.* DBusSysdepsUnix.* DBusTimeoutList.* DBusTransport* DBusTypeReader* DBusTypeWriter* \
43: DBusUserInfo.* DBusWatchList.* ; do
44: if test -f "$I" ; then
45: /bin/mv "$I" nuke || die "could not move $I to $MANDIR/nuke"
46: fi
47: done
48:
49:
50:
51: for I in * ; do
52: if test -f "$I" ; then
53: LINES=`wc -l "$I" | cut -d ' ' -f 1`
54: if test x"$LINES" = x1 ; then
55: REF_TO=`cat "$I" | sed -e 's/\.so man3dbus\///g'`
56:
57: if ! test -f "$REF_TO" ; then
58: /bin/mv "$I" nuke || die "could not move $I to $MANDIR/nuke"
59: fi
60: fi
61: fi
62: done
63:
64:
65: (find . -maxdepth 1 -name "dbus_*" | xargs -I ITEMS /bin/mv ITEMS keep) || die "could not move all dbus-prefixed items"
66: (find . -maxdepth 1 -name "DBUS_*" | xargs -I ITEMS /bin/mv ITEMS keep) || die "could not move all DBUS_-prefixed items"
67: (find . -maxdepth 1 -name "DBus*" | xargs -I ITEMS /bin/mv ITEMS keep) || die "could not move all DBus-prefixed items"
68:
69:
70:
71: (find . -maxdepth 1 -type f | xargs -I ITEMS /bin/mv ITEMS nuke) || die "could not move remaining items"
72:
73: NUKE_COUNT=`find nuke -type f -name "*" | wc -l`
74: KEEP_COUNT=`find keep -type f -name "*" | wc -l`
75: MISSING_COUNT=`find . -maxdepth 1 -type f -name "*" | wc -l`
76:
77: echo "$KEEP_COUNT man pages kept and $NUKE_COUNT man pages to remove"
78: echo "$MISSING_COUNT not handled"
79:
80: (find keep -type f -name "*" | xargs -I ITEMS /bin/mv ITEMS .) || die "could not move kept items back"
81:
82: rmdir keep || die "could not remove $MANDIR/keep"
83:
84: echo "Man pages to be installed are in $MANDIR and man pages to ignore are in $MANDIR/nuke"
85:
86: exit 0