]> git.donarmstrong.com Git - debhelper.git/commitdiff
r136: Initial Import
authorjoey <joey>
Tue, 17 Aug 1999 05:03:35 +0000 (05:03 +0000)
committerjoey <joey>
Tue, 17 Aug 1999 05:03:35 +0000 (05:03 +0000)
debian/changelog
dh_du
dh_getopt.pl
dh_makeshlibs
dh_undocumented

index 26d6963f89bcde3743a5391729a4e4d14d4cb3a1..5f3eb36745a0d5ccf9d83c605b649922adec6102 100644 (file)
@@ -1,3 +1,11 @@
+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.
diff --git a/dh_du b/dh_du
index 9e641a27490cfdb80031ce7dc9a5381bd5d7f311..78518f8ef06de36909b08bd8159a413335109b09 100755 (executable)
--- a/dh_du
+++ b/dh_du
@@ -1,8 +1,8 @@
-#!/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";
index b1dcf7b185423a6c86bc2f9d0a895c13bf3338bf..4d1d39039567294d2f7dddc55b2c55d996aa20a1 100755 (executable)
@@ -27,10 +27,6 @@ my %options=Dh_Getopt::parseopts();
 $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}};
 
index eb88f448363fc902288ac99b5aa0486e6500e20c..68dc83ebf798397ff3931bf07df1b5b03903b8b7 100755 (executable)
@@ -1,47 +1,49 @@
-#!/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");
+       }
+}
index edd873f79d6647a6822cd0fdd0a3c2e8a11c9087..c4264d6b2ab77d94802e0c0426dbd89acc5ea1f7 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/sh -e
+#!/usr/bin/perl -w
 #
 # Passed a list of undocumented man pages, generates symlinks to
 # undocumented.7.gz for those man pages.
@@ -6,48 +6,49 @@
 # 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");
+       }
+}