+debhelper (1.2.2) unstable; urgency=low
+
+ * dh_du, dh_shlibdeps, dh_undocumented: rewrite in perl.
+ * dh_undocumented: shortened the symlink used for section 7 undocumented
+ man pages, since it can link to undocuemented.7.gz in the same directory.
+
+ -- Joey Hess <joeyh@master.debian.org> Tue, 10 Nov 1998 13:40:22 -0800
+
debhelper (1.2.1) unstable; urgency=low
* dh_strip, dh_installinit: rewrite in perl.
-#!/bin/sh -e
+#!/usr/bin/perl -w
#
# Generate a DEBIAN/du file, that lists the disk usage of the directories in
# the package.
#
# No longer - it was decided these files are a bad idea.
-echo "dh_du: this program does nothing and is deprecated. Remove it from debian/rules." >&2
+print STDERR "dh_du: this program does nothing and is deprecated. Remove it from debian/rules.\n";
$options{DOPACKAGES}=join " ",@{$options{DOPACKAGES}};
if ($#{$options{EXCLUDE}} > -1) {
$options{EXCLUDE_GREP}=join '|', @{$options{EXCLUDE}};
- foreach (@{$options{EXCLUDE}}) {
- $options{EXCLUDE_FIND}.="-regex .*".quotemeta($_).".* -or ";
- }
- $options{EXCLUDE_FIND}=~s/ -or $//;
}
$options{EXCLUDE}=join " ",@{$options{EXCLUDE}};
-#!/bin/sh -e
+#!/usr/bin/perl -w
#
# Automatically generate shlibs files.
-PATH=debian:$PATH:/usr/lib/debhelper
-. dh_lib
+BEGIN { push @INC, "debian", "/usr/lib/debhelper" }
+use Dh_Lib;
+init();
-for PACKAGE in $DH_DOPACKAGES; do
- TMP=`tmpdir $PACKAGE`
+foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
+ $TMP=tmpdir($PACKAGE);
- if [ -e "$TMP/DEBIAN/shlibs" ]; then
- error "$TMP/DEBIAN/shlibs already exists."
- fi
+ if (-e "$TMP/DEBIAN/shlibs") {
+ error("$TMP/DEBIAN/shlibs already exists.");
+ }
- for file in `find $TMP -type f -name "*.so.*" | tr "\n" " "` ; do
- LIBRARY=`expr $file : ".*/\(.*\)\.so\..*"` || true
- LIB_VERSION=`expr $file : ".*/.*\.so\.\(.*\)"` || true
- if [ -z "$DH_M_PARAMS" ]; then
- MAJOR=`expr $LIB_VERSION : "\([0-9]*\)\."` || true
- else
- MAJOR="$DH_M_PARAMS"
- fi
-# LIBSTUB=`expr $file : "\(.*\/.*\.so\)\..*"` || true
- if [ ! -d "$TMP/DEBIAN" ] ; then
- doit "install -d $TMP/DEBIAN"
- fi
- DEPS=$PACKAGE
- if [ "$DH_V_FLAG_SET" ]; then
- if [ "$DH_V_FLAG" ]; then
- DEPS="$DH_V_FLAG"
- else
- # Call isnative becuase it sets $VERSION
+ open (FIND, "find $TMP -type f -name '*.so.*' |");
+ while (<FIND>) {
+ chomp;
+ ($library, $major)=m#.*/(.*)\.so\.(\d*)\.#;
+ if (defined($dh{M_PARAMS}) && $dh{M_PARAMS} ne '') {
+ $major=$dh{M_PARAMS};
+ }
+ if (! -d "$TMP/DEBIAN") {
+ doit("install","-d","$TMP/DEBIAN");
+ }
+ $deps=$PACKAGE;
+ if ($dh{V_FLAG_SET}) {
+ if ($dh{V_FLAG} ne '') {
+ $deps=$dh{V_FLAG};
+ }
+ else {
+ # Call isnative becuase it sets $dh{VERSION}
# as a side effect.
- isnative || true
- DEPS="$PACKAGE (>= $VERSION)"
- fi
- fi
- if [ "$LIBRARY" -a "$MAJOR" -a "$DEPS" ]; then
- complex_doit "echo '$LIBRARY $MAJOR $DEPS' >>$TMP/DEBIAN/shlibs"
- fi
- done
+ isnative($PACKAGE);
+ $deps="$PACKAGE (>= $dh{VERSION})";
+ }
+ }
+ if (defined($library) && defined($major) && defined($deps) &&
+ $library ne '' && $major ne '' && $deps ne '') {
+ complex_doit("echo '$library $major $deps' >>$TMP/DEBIAN/shlibs");
+ }
+ }
+ close FIND;
- if [ -e "$TMP/DEBIAN/shlibs" ]; then
- doit "chmod 644 $TMP/DEBIAN/shlibs"
- doit "chown root.root $TMP/DEBIAN/shlibs"
- fi
-done
+ if (-e "$TMP/DEBIAN/shlibs") {
+ doit("chmod",644,"$TMP/DEBIAN/shlibs");
+ doit("chown","root.root","$TMP/DEBIAN/shlibs");
+ }
+}
-#!/bin/sh -e
+#!/usr/bin/perl -w
#
# Passed a list of undocumented man pages, generates symlinks to
# 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`
- undocumented=`pkgfile $PACKAGE undocumented`
-
- undoc=""
-
- if [ "$undocumented" ]; then
- undoc=`tr "\n" " " < $undocumented`
- fi
-
- if [ \( "$PACKAGE" = "$DH_FIRSTPACKAGE" -o "$DH_PARAMS_ALL" \) \
- -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]\)'` \
- || error "\"$file\" does not have an extention."
- if [ `expr "$file" : '.*\.[123456789]\(x\)'` ] ; then
- dir=usr/X11R6/man/man$section
- reldir=../../../man
- else
- dir=usr/man/man$section
- reldir=..
- fi
-
- if [ ! -d $TMP/$dir ]; then
- doit "install -d $TMP/$dir"
- fi
-
- doit "ln -s $reldir/man7/undocumented.7.gz $TMP/$dir/$file.gz"
- done
- fi
-done
+BEGIN { push @INC, "debian", "/usr/lib/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/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/man/man$section";
+ $reldir="../man7/";
+ }
+ else {
+ $dir="usr/man/man$section";
+ $reldir="";
+ }
+
+ if (! -d "$TMP/$dir") {
+ doit("install","-d","$TMP/$dir");
+ }
+ doit("ln","-sf","${reldir}undocumented.7.gz","$TMP/$dir/$file.gz");
+ }
+}