summaryrefslogtreecommitdiff
path: root/dh_undocumented
diff options
context:
space:
mode:
authorjoey <joey>1999-08-17 04:34:24 +0000
committerjoey <joey>1999-08-17 04:34:24 +0000
commit1e6dea44772a0c1f57e7cd50ff12e35a1cff0b96 (patch)
tree212e56dc8ea32cf27cd2a33ac901a92a701f063f /dh_undocumented
parentface7b5d7df5fb2b8f434bc7135f27b38329a5c5 (diff)
r11: Initial revision
Diffstat (limited to 'dh_undocumented')
-rwxr-xr-xdh_undocumented51
1 files changed, 51 insertions, 0 deletions
diff --git a/dh_undocumented b/dh_undocumented
new file mode 100755
index 0000000..ebde890
--- /dev/null
+++ b/dh_undocumented
@@ -0,0 +1,51 @@
+#!/bin/sh -e
+#
+# Passed a list of undocumented man pages, generates symlinks to
+# undocumented.7 for those man pages.
+#
+# Also, it looks for debian/undocumented files for more lists of
+# undocumented man pages.
+
+PATH=debian:$PATH:/usr/lib/debhelper
+. dh_lib
+
+for PACKAGE in $DH_DOPACKAGES; do
+ TMP=`tmpdir $PACKAGE`
+ EXT=`pkgext $PACKAGE`
+
+ undoc=""
+
+ if [ -e debian/${EXT}undocumented ]; then
+ undoc=`tr "\n" " " < debian/${EXT}undocumented`
+ fi
+
+ if [ "$PACKAGE" = "$MAINPACKAGE" -a "$*" ]; then
+ undoc="$* $undoc"
+ fi
+
+ if [ "$undoc" ]; then
+ for file in $undoc; do
+ # Remove .gz extention from the filename, if present.
+ if [ `expr "$file" : '\(.*\).gz'` ]; then
+ file=`expr "$file" : '\(.*\).gz'`
+ fi
+
+ # Determine what directory the file belongs in,
+ # /usr/man, or /usr/X11R6/man.
+ section=`expr "$file" : '.*\.\([123456789]\)'`
+ if [ `expr "$file" : '.*\.[123456789]\(x\)'` ] ; then
+ dir=usr/X11R6/man/man$section
+ reldir=../../../man
+ else
+ dir=usr/man/man$section
+ reldir=..
+ fi
+
+ if [ ! -d debian/$TMP/$dir ]; then
+ doit "install -d debian/$TMP/$dir"
+ fi
+
+ doit ln -s $reldir/man7/undocumented.7.gz debian/$TMP/$dir/$file.gz
+ done
+ fi
+done