3 # Passed a list of undocumented man pages, generates symlinks to
4 # undocumented.7.gz for those man pages.
6 # Also, it looks for debian/undocumented files for more lists of
7 # undocumented man pages.
9 use Debian::Debhelper::Dh_Lib;
12 foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
13 $TMP=tmpdir($PACKAGE);
14 $undocumented=pkgfile($PACKAGE,"undocumented");
18 @undoc=filearray($undocumented);
21 if (($PACKAGE eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) {
25 foreach $file (@undoc) {
26 $file=~s/.gz$//; # .gz extension is optional in input.
28 # Determine what directory the file belongs in,
29 # /usr/share/man, or /usr/X11R6/man, and how the link to
30 # the undocuemtned.7 man page will look.
31 ($section)=$file=~m/^.*\.(\d)/;
33 error("\"$file\" does not have an extension.");
35 if ($file=~/.*\.\dx/) {
36 $dir="usr/X11R6/man/man$section";
37 $reldir="../../../share/man/man7/";
39 elsif ($section != 7) {
40 $dir="usr/share/man/man$section";
44 $dir="usr/share/man/man$section";
48 if (! -d "$TMP/$dir") {
49 doit("install","-d","$TMP/$dir");
51 doit("ln","-sf","${reldir}undocumented.7.gz","$TMP/$dir/$file.gz");