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.
10 use Debian::Debhelper::Dh_Lib;
13 foreach my $package (@{$dh{DOPACKAGES}}) {
14 my $tmp=tmpdir($package);
15 my $undocumented=pkgfile($package,"undocumented");
19 @undoc=filearray($undocumented);
22 if (($package eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) {
26 foreach my $file (@undoc) {
27 $file=~s/.gz$//; # .gz extension is optional in input.
29 # Determine what directory the file belongs in,
30 # /usr/share/man, or /usr/X11R6/man, and how the link to
31 # the undocuemtned.7 man page will look.
33 my ($section)=$file=~m/^.*\.(\d)/;
35 error("\"$file\" does not have an extension.");
37 if ($file=~/.*\.\dx/) {
38 $dir="usr/X11R6/man/man$section";
39 $reldir="../../../share/man/man7/";
41 elsif ($section != 7) {
42 $dir="usr/share/man/man$section";
46 $dir="usr/share/man/man$section";
50 if (! -d "$tmp/$dir") {
51 doit("install","-d","$tmp/$dir");
53 doit("ln","-sf","${reldir}undocumented.7.gz","$tmp/$dir/$file.gz");