From 37c69d4e7124fb03edf46bea4eb38f6721f2aa2a Mon Sep 17 00:00:00 2001 From: joey Date: Mon, 6 Sep 1999 05:47:41 +0000 Subject: r266: * FHS complience. Patch from Johnie Ingram . For the most part, this was a straight-forward substitution, dh_installmanpages needed a non-obvious change though. * Closes: #42489, #42587, #41732. * dh_installdocs: Adds code to postinst and prerm as specified in http://www.debian.org/Lists-Archives/debian-ctte-9908/msg00038.html, to make /usr/doc/ a compatability symlink to /usr/share/doc/. Note that currently if something exists in /usr/doc/ when the postinst is run, it will silently not make the symlink. I'm considering more intellingent handing of this case. * Note that if you build a package with this version of debhelper, it will use /usr/share/man, /usr/share/doc, and /usr/share/info. You may need to modify other files in your package that reference the old locations. --- dh_undocumented | 93 +++++++++++++++++++++++++++++---------------------------- 1 file changed, 48 insertions(+), 45 deletions(-) (limited to 'dh_undocumented') diff --git a/dh_undocumented b/dh_undocumented index ebde8904..c8aa5623 100755 --- a/dh_undocumented +++ b/dh_undocumented @@ -1,51 +1,54 @@ -#!/bin/sh -e +#!/usr/bin/perl -w # # Passed a list of undocumented man pages, generates symlinks to -# undocumented.7 for those man pages. +# undocumented.7.gz 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 +BEGIN { push @INC, "debian", "/usr/share/debhelper" } +use Dh_Lib; +init(); + +foreach $PACKAGE (@{$dh{DOPACKAGES}}) { + $TMP=tmpdir($PACKAGE); + $undocumented=pkgfile($PACKAGE,"undocumented"); + + @undoc=(); + if ($undocumented) { + @undoc=filearray($undocumented); + } + + if (($PACKAGE eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) { + push @undoc, @ARGV; + } + + foreach $file (@undoc) { + $file=~s/.gz$//; # .gz extention is optional in input. + + # Determine what directory the file belongs in, + # /usr/share/man, or /usr/X11R6/man, and how the link to + # the undocuemtned.7 man page will look. + ($section)=$file=~m/^.*\.(\d)/; + if (!$section) { + error("\"$file\" does not have an extention."); + } + if ($file=~/.*\.\dx/) { + $dir="usr/X11R6/man/man$section"; + $reldir="../../../man/man7/"; + } + elsif ($section != 7) { + $dir="usr/share/man/man$section"; + $reldir="../man7/"; + } + else { + $dir="usr/share/man/man$section"; + $reldir=""; + } + + if (! -d "$TMP/$dir") { + doit("install","-d","$TMP/$dir"); + } + doit("ln","-sf","${reldir}undocumented.7.gz","$TMP/$dir/$file.gz"); + } +} -- cgit v1.2.3