From 94daae34cb1be6ed6a4591604af22c5d43542475 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:53:30 +0000 Subject: r94: Initial Import --- doc/PROGRAMMING | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doc/PROGRAMMING') diff --git a/doc/PROGRAMMING b/doc/PROGRAMMING index 7dc0c638..faaa9360 100644 --- a/doc/PROGRAMMING +++ b/doc/PROGRAMMING @@ -81,6 +81,8 @@ switch variable description DH_EXCLUDE_GREP same as DH_EXCLUDE, except all items are separated by '|' characters, instead of spaces, handy for egrep -v + DH_EXCLUDE_FIND same as DH_EXCLUDE, except all items are + separated by " -or " -x DH_INCLUDE_CONFFILES include conffiles. It's -x for obscure historical reasons. -- cgit v1.2.3 From 168cfd101a2d522c0c7cbe06480f50e133ef1d40 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:53:44 +0000 Subject: r95: Initial Import --- debian/changelog | 8 ++++++++ dh_compress | 4 ++-- doc/PROGRAMMING | 6 ++++-- 3 files changed, 14 insertions(+), 4 deletions(-) (limited to 'doc/PROGRAMMING') diff --git a/debian/changelog b/debian/changelog index 180a6423..cca97b6f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +debhelper (0.98) unstable; urgency=low + + * dh_lib: isnative: pass -l to dpkg-parsechangelog, to support + odd packages with multiple different debian changelogs. + * doc/PROGRAMMING: cleaned up the docs on DH_EXCLUDE_FIND. + + -- Joey Hess Mon, 6 Jul 1998 12:45:13 -0700 + debhelper (0.97) unstable; urgency=low * doc/from-debstd: fixed a typo. diff --git a/dh_compress b/dh_compress index d24a561a..1b58f70a 100755 --- a/dh_compress +++ b/dh_compress @@ -28,8 +28,8 @@ filelist () { # Call only if DH_EXCLUDE_GREP is non-empty. filelist_excluded () { # Use grep -F so we don't have to worry about regexp's. - filelist | grep -v -F \ - "`echo "$DH_EXCLUDE_GREP" | tr "|" "\n"`" + (filelist | grep -v -F \ + "`echo "$DH_EXCLUDE_GREP" | tr "|" "\n"`") || true } for PACKAGE in $DH_DOPACKAGES; do diff --git a/doc/PROGRAMMING b/doc/PROGRAMMING index faaa9360..402d5e78 100644 --- a/doc/PROGRAMMING +++ b/doc/PROGRAMMING @@ -81,8 +81,10 @@ switch variable description DH_EXCLUDE_GREP same as DH_EXCLUDE, except all items are separated by '|' characters, instead of spaces, handy for egrep -v - DH_EXCLUDE_FIND same as DH_EXCLUDE, except all items are - separated by " -or " + DH_EXCLUDE_FIND same as DH_EXCLUDE, except all items are put + into a string in a way that they will make + find find them. (Use ! in front to negate + that, of course) -x DH_INCLUDE_CONFFILES include conffiles. It's -x for obscure historical reasons. -- cgit v1.2.3 From df34bdaa1381eafc3f6ecea44866849c2a80fe67 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:56:36 +0000 Subject: r105: Initial Import --- debian/changelog | 28 +++++++++++++++------------- dh_compress | 16 ++++++++++++---- dh_compress.1 | 9 ++++++++- dh_getopt.pl | 2 ++ dh_movefiles | 21 ++++++++++++++++++--- doc/PROGRAMMING | 6 +++--- doc/TODO | 4 ---- 7 files changed, 58 insertions(+), 28 deletions(-) (limited to 'doc/PROGRAMMING') diff --git a/debian/changelog b/debian/changelog index 10b81798..38ae7771 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,16 +1,18 @@ -debhelper (1.0.1) unstable; urgency=low - - * Backported bug fixes from the 1.1 tree: - * dh_installdocs: used -m 655 for a TODO file. (minor, dh_fixperms cleans - up after it) - * dh_fixperms: had a problem with removing x bits on examples files - * dh_compress: since version 0.88 or so, dh_compress has bombed out if - a debian/compress file returned an error code. This was actually - unintentional - in fact, the debian/compress example in the man page - will fail this way if usr/info or usr/X11R6 is not present. Corrected - the program to not fail. (#26214) - - -- Joey Hess Sun, 30 Aug 1998 22:21:26 -0700 +debhelper (1.1.0) unstable; urgency=low + + * New unstable branch of debhelper. + + * TODO: list all current bugs, in order I plan to tackle them. + * Added debhelper.1 man page, which groups all the debhelper options that + are common to all commands in once place so I can add new options w/o + updating 27 man pages. + * dh_*.1: updated all debheper man pages to refer to debhelper(1) where + appropriate. Also corrected a host of little errors. + * doc/README: moved a lot of this file into debhelper.1. + * dh_*: -N option now excludes a package from the list of packages the + programs act on. (#25247) + + -- Joey Hess Sat, 8 Aug 1998 17:49:56 -0700 debhelper (1.0) stable unstable; urgency=low diff --git a/dh_compress b/dh_compress index 1b58f70a..b94cfcfe 100755 --- a/dh_compress +++ b/dh_compress @@ -8,8 +8,16 @@ PATH=debian:$PATH:/usr/lib/debhelper # Returns a list of all the files that we want to compress, # (ignoring any files we were asked to exclude on the command -# line). Assummes we are already in the temp directory. +# line). Assumes we are already in the temp directory. filelist () { + # First of all, deal with any files specified right on the command line. + if [ \( "$PACKAGE" = "$DH_FIRSTPACKAGE" -o "$DH_PARAMS_ALL" \) \ + -a "$*" ]; then + # Convert to having each file on its own line + # so grep will work. + echo "$*" | tr " " "\n" + fi + if [ "$compress" ]; then # The config file is a sh script that outputs the files to be compressed # (typically using find). @@ -28,7 +36,7 @@ filelist () { # Call only if DH_EXCLUDE_GREP is non-empty. filelist_excluded () { # Use grep -F so we don't have to worry about regexp's. - (filelist | grep -v -F \ + (filelist "$*" | grep -v -F \ "`echo "$DH_EXCLUDE_GREP" | tr "|" "\n"`") || true } @@ -45,9 +53,9 @@ for PACKAGE in $DH_DOPACKAGES; do # Get the list of files to compress. if [ "$DH_EXCLUDE_GREP" ]; then - files=`filelist_excluded` + files=`filelist_excluded $*` else - files=`filelist` + files=`filelist $*` fi if [ "$files" ]; then diff --git a/dh_compress.1 b/dh_compress.1 index ec0def52..4e5ed9e8 100644 --- a/dh_compress.1 +++ b/dh_compress.1 @@ -3,7 +3,7 @@ dh_compress \- compress files and fix symlinks in package build directories .SH SYNOPSIS .B dh_compress -.I "[debhelper options] [-Xitem]" +.I "[debhelper options] [-Xitem] [-A] [file ...]" .SH "DESCRIPTION" dh_compress is a debhelper program that is responsible for compressing the files in package build directories, and makes sure that any symlinks @@ -42,6 +42,13 @@ compressed. For example, -X=.jpeg will exclude jpeg's from compression. You may use this option multiple times to build up a list of things to exclude. You can accomplish the same thing by using a debian/compress file, but this is easier. +.TP +.B \-A, \--all +Compress all files specified by command line parameters in ALL packages +acted on. +.TP +.B file ... +Add these files to the list of files to compress. .SH NOTES The debian/compress file applies to the first binary package listed in your control file. For the other packages, you can make files named diff --git a/dh_getopt.pl b/dh_getopt.pl index f1aa7cec..9b97089e 100755 --- a/dh_getopt.pl +++ b/dh_getopt.pl @@ -157,6 +157,8 @@ foreach (@exclude) { } $exclude_find=~s/ -or $//; +$include=join ' ', @include; + # Remove excluded packages from the list of packages to act on. undef @package_list; foreach $package (@packages) { diff --git a/dh_movefiles b/dh_movefiles index a5669bfc..f44121c8 100755 --- a/dh_movefiles +++ b/dh_movefiles @@ -40,16 +40,31 @@ for PACKAGE in $DH_DOPACKAGES; do # # (The echo is in here to expand wildcards. Note that 'ls' # won't work properly.) - # The filelist is used, so even very weird filenames can be + # The file list is used, so even very weird filenames can be # moved. doit "rm -f movelist" for i in `(cd debian/tmp; echo $tomove)`; do - complex_doit "(cd debian/tmp ; find $i ! -type d -and ! -type l -print) >> movelist" + if [ ! -e "debian/tmp/$i" ]; then + fail=1 + fi + complex_doit "(cd debian/tmp ; find $i ! -type d -and ! -type l -print || true) >> movelist" done for i in `(cd debian/tmp; echo $tomove)`; do - complex_doit "(cd debian/tmp ; find $i ! -type d -and -type l -print) >> movelist" + if [ ! -e "debian/tmp/$i" ]; then + fail=1 + fi + complex_doit "(cd debian/tmp ; find $i ! -type d -and -type l -print || true) >> movelist" done complex_doit "(cd debian/tmp;tar --create --remove-files --files-from=../../movelist --file -) | (cd $TMP;tar xpf -)" doit "rm -f movelist" fi done + +# If fail is set, we wern't actually able to find some +# files that were specified to be moved, and we should +# exit with the code in fail. This program puts off +# exiting with an error until all files have been tried +# to be moved, because this makes it easier for some +# packages that arn't always sure exactly which files need +# to be moved. +exit $fail diff --git a/doc/PROGRAMMING b/doc/PROGRAMMING index 402d5e78..878c5a2e 100644 --- a/doc/PROGRAMMING +++ b/doc/PROGRAMMING @@ -68,11 +68,11 @@ switch variable description -v DH_VERBOSE should the program verbosely output what it is doing? --no-act DH_NO_ACT should the program not actually do anything? --i,-a,-p DH_DOPACKAGES a space delimited list of the binary packages +-i,-a,-p,-N DH_DOPACKAGES a space delimited list of the binary packages to act on --i,-p DH_DOINDEP a space delimited list of the binary independent +-i,-p,-N DH_DOINDEP a space delimited list of the binary independent packages to act on --a,-p DH_DOARCH a space delimited list of the binary dependent +-a,-p,-N DH_DOARCH a space delimited list of the binary dependent packages to act on -n DH_NOSCRIPTS if set, do not make any modifications to the package's postinst, postrm, etc scripts. diff --git a/doc/TODO b/doc/TODO index dbfc2771..0a2a5bde 100644 --- a/doc/TODO +++ b/doc/TODO @@ -3,8 +3,6 @@ list grows - I welcome patches to fix items on it! Bugs: -* dh_movefiles bombs if the argument is a wildcard pattern that matches - nothing (reported by Drow). * dh_installdocs fails if debian/docs is empty except for a blank line. There are probably other instances of this. Debhelper should behave better (#24686). @@ -13,8 +11,6 @@ Bugs: Wishlist items: -* Add option to dh_compress to allow addition of files to compress besides - the default ones. * Add emacsen support to debhelper. (#21401) * Make dh_movefiles remove emptied directories after it's moved all the files out of them (#17111). -- cgit v1.2.3 From 03d1a2e0c10456c65fbf36e1f38619803f4f2bfd Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:57:23 +0000 Subject: r110: Initial Import --- Dh_Lib.pm | 24 +++++---- debian/changelog | 20 ++++++++ dh_builddeb | 15 +++--- dh_du | 17 +------ dh_installchangelogs | 58 +++++++++++---------- dh_installchangelogs.1 | 2 +- dh_installdebfiles | 2 +- dh_installdebfiles.1 | 2 +- dh_installdirs | 79 ++++++++++++++-------------- dh_installdirs.1 | 3 +- dh_installexamples.1 | 3 +- doc/PROGRAMMING | 136 +++++++++++++++++++++++++++++-------------------- doc/TODO | 4 +- 13 files changed, 204 insertions(+), 161 deletions(-) (limited to 'doc/PROGRAMMING') diff --git a/Dh_Lib.pm b/Dh_Lib.pm index c58d5c08..49e337a9 100644 --- a/Dh_Lib.pm +++ b/Dh_Lib.pm @@ -72,6 +72,12 @@ sub init { $dh{FIRSTPACKAGE}=${$dh{DOPACKAGES}}[0]; } +# Escapes out shell metacharacters in a word of shell script. +sub escape_shell { my $word=shift; + $word=~s/([\s><&!\[\]\{\}\(\)\$])/\\$1/g; + return $word; +} + # Run a command, and display the command to stdout if verbose mode is on. # All commands that modifiy files in $TMP should be ran via this # function. @@ -79,7 +85,7 @@ sub init { # Note that this cannot handle complex commands, especially anything # involving redirection. Use complex_doit instead. sub doit { - verbose_print(join(" ",@_)); + verbose_print(join(" ",map { escape_shell($_) } @_)); if (! $dh{NO_ACT}) { system(@_) == 0 @@ -171,30 +177,30 @@ sub pkgext { my $package=shift; # As a side effect, sets $dh{VERSION} to the version of this package. { # Caches return code so it only needs to run dpkg-parsechangelog once. - my $isnative_cache; + my %isnative_cache; sub isnative { my $package=shift; - if ($isnative_cache eq undef) { + if (! defined $isnative_cache{$package}) { # Make sure we look at the correct changelog. my $isnative_changelog=pkgfile($package,"changelog"); if (! $isnative_changelog) { $isnative_changelog="debian/changelog"; } - + # Get the package version. my $version=`dpkg-parsechangelog -l$isnative_changelog`; - ($dh{VERSION})=$version=~s/[^|\n]Version: \(.*\)\n//m; - + ($dh{VERSION})=$version=~m/Version: (.*)/m; + # Is this a native Debian package? if ($dh{VERSION}=~m/.*-/) { - $isnative_cache=1; + $isnative_cache{$package}=0; } else { - $isnative_cache=0; + $isnative_cache{$package}=1; } } - return $isnative_cache; + return $isnative_cache{$package}; } } diff --git a/debian/changelog b/debian/changelog index 22b55879..06f1f332 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,23 @@ +debhelper (1.1.4) unstable; urgency=low + + * dh_movefiles: fixed bug introduced in 1.1.1 where it would fail in some + cases if you tried to move a broken symlink. + * dh_installdocs: was only operating on the first package. + * dh_installexamples: rewritten in perl. + * Dh_Lib.pm: all multiple package operations were broken. + * Dh_Lib.pm: implemented complex_doit() and autoscript(). + * Made all perl code work with use strict and -w (well, except + dh_getopt.pl, but that's a hack that'll go away one day). + * I didn't realize, but rewriting dh_installdocs in perl fixed bug #24686, + although this same problem applies to other debhelper programs... like + dh_installexamples, which had the same bug fixed when I rewrote it in + perl just now. + * Dh_Lib.pm: accidentially didn't check DH_VERBOSE if commands were not + passed any switches. + * Dh_Getopt.pm: --noscripts was broken. + + -- Joey Hess Tue, 11 Aug 1998 12:44:04 -0700 + debhelper (1.1.3) unstable; urgency=low * dh_md5sums: -x was broken since version 1.1.1 - fixed. diff --git a/dh_builddeb b/dh_builddeb index 9ddd21dc..06cc1beb 100755 --- a/dh_builddeb +++ b/dh_builddeb @@ -1,11 +1,12 @@ -#!/bin/sh -e +#!/usr/bin/perl -w # # Build the .deb package, assuming all the files are set up. -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` - doit "dpkg --build $TMP .." -done +foreach $PACKAGE (@{$dh{DOPACKAGES}}) { + $TMP=tmpdir($PACKAGE); + doit("dpkg","--build",$TMP,".."); +} diff --git a/dh_du b/dh_du index 73df2a0b..9e641a27 100755 --- a/dh_du +++ b/dh_du @@ -5,19 +5,4 @@ # # No longer - it was decided these files are a bad idea. -PATH=debian:$PATH:/usr/lib/debhelper -. dh_lib - -echo "* Note: dh_du does nothing and is deprecated. Remove it from debian/rules." >&2 - -#for PACKAGE in $DH_DOPACKAGES; do -# TMP=`tmpdir $PACKAGE` -# -# if [ ! -d "$TMP/DEBIAN" ]; then -# doit "install -d $TMP/DEBIAN" -# fi -# -# # Note that the tabs in this next line are important. -# complex_doit "du -k $TMP | sed 's: $TMP/: :' | grep -v ' DEBIAN$' | grep -v ' $TMP$' >$TMP/DEBIAN/du" -# doit "chown root.root $TMP/DEBIAN/du" -#done +echo "dh_du: this program does nothing and is deprecated. Remove it from debian/rules." >&2 diff --git a/dh_installchangelogs b/dh_installchangelogs index 15a42c09..0024fc10 100755 --- a/dh_installchangelogs +++ b/dh_installchangelogs @@ -1,4 +1,4 @@ -#!/bin/sh -e +#!/usr/bin/perl -w # # Installs debian/changelog. If another filename is passed to it, installs # that file as the upstream changelog. @@ -7,35 +7,41 @@ # if so, the debian changelog is just installed as "changelog", and it is an # error to specify an upstream changelog on the command line. -PATH=debian:$PATH:/usr/lib/debhelper -. dh_lib +BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +use Dh_Lib; +init(); -UPSTREAM=$1 +$upstream=shift; -if isnative && [ "$UPSTREAM" ]; then - error "Cannot specify an upstream changelog for a native debian package." -fi +if (isnative($dh{MAINPACKAGE}) && defined $upstream) { + error("Cannot specify an upstream changelog for a native debian package."); +} -if isnative; then - CHANGELOG_NAME=changelog -else - CHANGELOG_NAME=changelog.Debian -fi +if (isnative($dh{MAINPACKAGE})) { + $changelog_name='changelog'; +} +else { + $changelog_name='changelog.Debian'; +} -for PACKAGE in $DH_DOPACKAGES; do - TMP=`tmpdir $PACKAGE` +foreach $PACKAGE (@{$dh{DOPACKAGES}}) { + $TMP=tmpdir($PACKAGE); + $changelog=pkgfile($PACKAGE,"changelog"); - changelog=`pkgfile $PACKAGE changelog` - if [ ! "$changelog" ]; then - changelog=debian/changelog - fi + if (!$changelog) { + $changelog="debian/changelog"; + } - if [ ! -d $TMP/usr/doc/$PACKAGE ]; then - doit "install -d $TMP/usr/doc/$PACKAGE" - fi - doit "install -p -m644 $changelog $TMP/usr/doc/$PACKAGE/$CHANGELOG_NAME" + if (! -e $changelog) { + error("could not find changelog $changelog"); + } - if [ "$UPSTREAM" ]; then - doit "install -p -m644 $UPSTREAM $TMP/usr/doc/$PACKAGE/changelog" - fi -done + if (! -d "$TMP/usr/doc/$PACKAGE") { + doit("install","-d","$TMP/usr/doc/$PACKAGE"); + } + doit("install","-p","-m644",$changelog,"$TMP/usr/doc/$PACKAGE/$changelog_name"); + + if ($upstream) { + doit("install","-p","-m644",$upstream,"$TMP/usr/doc/$PACKAGE/changelog"); + } +} diff --git a/dh_installchangelogs.1 b/dh_installchangelogs.1 index 70822338..9a579a65 100644 --- a/dh_installchangelogs.1 +++ b/dh_installchangelogs.1 @@ -26,7 +26,7 @@ See for a list of options common to all debhelper commands. .TP .B upstream -Instal this file as the upstream changelog. +Install this file as the upstream changelog. .SH NOTES It is an error to specify an upstream changelog file for a debian native package. diff --git a/dh_installdebfiles b/dh_installdebfiles index 0fba35a5..d999c91b 100755 --- a/dh_installdebfiles +++ b/dh_installdebfiles @@ -5,7 +5,7 @@ PATH=debian:$PATH:/usr/lib/debhelper -warn "Note: use of this program is deprecated." +echo "dh_installdebfiles: use of this program is deprecated, see man page." >&2 dh_installdeb $* dh_shlibdeps $* diff --git a/dh_installdebfiles.1 b/dh_installdebfiles.1 index ae4782d2..5e41117a 100644 --- a/dh_installdebfiles.1 +++ b/dh_installdebfiles.1 @@ -16,7 +16,7 @@ programs, and you may replace any calls to this program by: dh_shlibdeps dh_gencontrol .SH WARNING -This program will be removed at some time in the furture. +This program will be removed at some time in the future. .SH OPTIONS Any options passed to this program will be sent to each of the 3 programs listed above. diff --git a/dh_installdirs b/dh_installdirs index 725cdb2c..2d12b76b 100755 --- a/dh_installdirs +++ b/dh_installdirs @@ -1,43 +1,42 @@ -#!/bin/sh -e +#!/usr/bin/perl -w # -# Reads debian/dirs, creates the directories listed there there +# Reads debian/dirs, creates the directories listed there + +BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +use Dh_Lib; +init(); + +foreach $PACKAGE (@{$dh{DOPACKAGES}}) { + $TMP=tmpdir($PACKAGE); + $file=pkgfile($PACKAGE,"dirs"); + + if (! -e $TMP) { + doit("install","-d",$TMP); + } + + undef @dirs; + + if ($file) { + @dirs=filearray($file) + } + + if (($PACKAGE eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) { + push @dirs, @ARGV; + } + + if (@dirs) { + # Stick the $TMP onto the front of all the dirs. + # This is necessary, for 2 reasons, one to make them + # be in the right directory, but more importantly, it + # protects against the danger of absolute dirs being + # specified. + @dirs=map { + $_="$TMP/$_"; + tr:/:/:s; # just beautification. + $_ + } @dirs; -PATH=debian:$PATH:/usr/lib/debhelper -. dh_lib - -for PACKAGE in $DH_DOPACKAGES; do - TMP=`tmpdir $PACKAGE` - file=`pkgfile $PACKAGE dirs` - - if [ ! -d $TMP ]; then - doit "install -d $TMP" - fi - - dirs="" - - if [ "$file" ]; then - dirs=`tr "\n" " " < $file` - fi - - if [ \( "$PACKAGE" = "$DH_FIRSTPACKAGE" -o "$DH_PARAMS_ALL" \) \ - -a "$*" ]; then - dirs="$* $dirs" - fi - - if [ "$dirs" ]; then - # Check to see if any of the dirs are absolute. - for dir in "$dirs" ; do - if expr "$dir" : "/" >/dev/null ; then - error "Absolute directory name \"$dir\" specified." - fi - done # Create dirs. - olddir=`pwd` - verbose_echo "cd $TMP" - cd "$TMP" - doit "install -d $dirs" - verbose_echo "cd $olddir" - cd "$olddir" - fi -done - + doit("install","-d",@dirs); + } +} diff --git a/dh_installdirs.1 b/dh_installdirs.1 index 77c992d9..95be7151 100644 --- a/dh_installdirs.1 +++ b/dh_installdirs.1 @@ -40,6 +40,7 @@ for a list of environment variables that affect all debhelper commands. .SH "SEE ALSO" .BR debhelper (1) .SH BUGS -Directories with spaces in them will not currently be installed properly. +It's impossible to specify filenames with spaces or other whitespace in them +in debian/dirs file. This is more a historical design flaw than a bug. .SH AUTHOR Joey Hess diff --git a/dh_installexamples.1 b/dh_installexamples.1 index 776aef79..91d9988b 100644 --- a/dh_installexamples.1 +++ b/dh_installexamples.1 @@ -40,7 +40,8 @@ for a list of environment variables that affect all debhelper commands. .SH "SEE ALSO" .BR debhelper (1) .SH BUGS -Filenames with spaces in them will not currently be installed. +It's impossible to specify filenames with spaces or other whitespace in them +in debian/examples file. This is more a historical design flaw than a bug. .SH "CONFORMS TO" Debian policy, version 2.3.0.0 .SH AUTHOR diff --git a/doc/PROGRAMMING b/doc/PROGRAMMING index 878c5a2e..e514095d 100644 --- a/doc/PROGRAMMING +++ b/doc/PROGRAMMING @@ -36,15 +36,18 @@ merge these modifications into the actual postinst scripts. There are always exceptions. Just ask me. -Introducing dh_lib: ------------------- +Introducing dh_lib and Dh_Lib.pm: +-------------------------------- -All debhelper programs use the dh_lib library (actually it's a shell script) -to parse their arguments and set some useful variables. It's not mandatory -that your program use dh_lib, but it will make it a lot easier to keep it in +dh_lib/Dh_lib.pm is the library used by all debhelper programs to parse +their arguments and set some useful variables. It's not mandatory that your +program use dh_lib/Dh_lib.pm, but it will make it a lot easier to keep it in sync with the rest of debhelper if it does, so this is highly encouraged. +There are two versions of this library - dh_lib is a shell library, while +Dh_Lib.pm is a perl module. -Typically, you invoke dh_lib like this: +Typically, you invoke dh_lib like this if your debhelper program is a shell +script: PATH=debian:$PATH:/usr/lib/debhelper . dh_lib @@ -53,74 +56,93 @@ The path statement is there to make your program look first in debian/ for dh_lib (so users can install a modified version there if necessary), then the rest of the path, then the canonical location of dh_lib, /usr/lib/debhelper. +If you are writing a perl program instead, use Dh_lib.pm like this: + +BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +use Dh_Lib; +init(); + +The BEGIN block is there to make perl look for the module in all the right +places. + +Notice the init() function in the perl version. dh_lib automatically parses +the command line and does some other initialization tasks. Dh_Lib.pm +requires you to run init() to accomplish the same task. + Argument processing: ------------------- All debhelper programs should respond to certain arguments, such as -v, -i, --a, and -p. To help you make this work right, dh_lib handles argument -processing. +-a, and -p. To help you make this work right, dh_lib/Dh_Lib.pm handles +argument processing. As soon as dh_lib loads, it processes any arguments that have been passed to -your program. The following variables may be set during this stage; your -program can use them later: +your program. On the other hand, you need to call init() in Dh_Lib.pm before +it will parse arguments. + +After argument processing, some global variables are used to hold the +results; program can use them later. If using dh_lib, prefix DH_ to the name +of each of these variables to get the name of the environment variable that +is set. If using Dh_lib.pm, these variables are in the %dh hash. switch variable description --v DH_VERBOSE should the program verbosely output what it is +-v VERBOSE should the program verbosely output what it is doing? ---no-act DH_NO_ACT should the program not actually do anything? --i,-a,-p,-N DH_DOPACKAGES a space delimited list of the binary packages - to act on --i,-p,-N DH_DOINDEP a space delimited list of the binary independent +--no-act NO_ACT should the program not actually do anything? +-i,-a,-p,-N DOPACKAGES a space delimited list of the binary packages + to act on (in Dh_Lib.pm, this is an array) +-i,-p,-N DOINDEP a space delimited list of the binary independent packages to act on --a,-p,-N DH_DOARCH a space delimited list of the binary dependent +-a,-p,-N DOARCH a space delimited list of the binary dependent packages to act on --n DH_NOSCRIPTS if set, do not make any modifications to the +-n NOSCRIPTS if set, do not make any modifications to the package's postinst, postrm, etc scripts. --X DH_EXCLUDE exclude a something from processing (you +-X EXCLUDE exclude a something from processing (you decide what this means for your program) - DH_EXCLUDE_GREP same as DH_EXCLUDE, except all items are + (In Dh_Lib.pm, this is an array) + EXCLUDE_GREP same as DH_EXCLUDE, except all items are separated by '|' characters, instead of spaces, - handy for egrep -v - DH_EXCLUDE_FIND same as DH_EXCLUDE, except all items are put + handy for egrep -v (only available to dh_lib) + EXCLUDE_FIND same as DH_EXCLUDE, except all items are put into a string in a way that they will make find find them. (Use ! in front to negate - that, of course) --x DH_INCLUDE_CONFFILES + that, of course) (only available to dh_lib) +-x INCLUDE_CONFFILES include conffiles. It's -x for obscure historical reasons. --d DH_D_FLAG you decide what this means to your program --r DH_R_FLAG you decide what this means to your program --k DH_K_FLAG you decide what this means to your program --P DH_TMPDIR package build directory (implies only one +-d D_FLAG you decide what this means to your program +-r R_FLAG you decide what this means to your program +-k K_FLAG you decide what this means to your program +-P TMPDIR package build directory (implies only one package is being acted on) --u DH_U_PARAMS will be set to a string, that is typically +-u U_PARAMS will be set to a string, that is typically parameters your program passes on to some other program. --m DH_M_PARAMS will be set to a string, you decide what it +-m M_PARAMS will be set to a string, you decide what it means to your program --V DH_V_FLAG will be set to a string, you decide what it +-V V_FLAG will be set to a string, you decide what it means to your program --V DH_V_FLAG_SET will be 1 if -V was specified, even if no +-V V_FLAG_SET will be 1 if -V was specified, even if no parameters were passed along with the -V --A DH_PARAMS_ALL generally means that additional command line +-A PARAMS_ALL generally means that additional command line parameters passed to the program (other than those processed here), will apply to all binary packages the program acts on, not just the first ---init-script DH_INIT_SCRIPT will be set to a string, which specifies an +--init-script INIT_SCRIPT will be set to a string, which specifies an init script name (probably only dh_installinit will ever use this) Any additional command line parameters that do not start with "-" will be -ignored, and you can access them later just as you normally would ($1, $2, -etc). +ignored, and you can access them later just as you normally would. If you need a new command line option, just ask me, and I will add it. Global variables: ---------------- -The following variables are also set, you can use any of them: +If using dh_lib, the following variables are also set as soon as you load +the library: MAINPACKAGE the name of the first binary package listed in debian/control @@ -128,21 +150,28 @@ DH_FIRSTPACKAGE the first package we were instructed to act on. This package typically gets special treatment, additional arguments specified on the command line may effect it. +If using Dh_Lib.pm, these are only set after init(), and they are named +$dh{MAINPACKAGE} and $dh{FIRSTPACKAGE}, instead. + Functions: --------- -Dh_lib also contains a number of functions you may find useful. +dh_lib/Dh_Lib.pm also contains a number of functions you may find useful. +Note that the functions calling conventions are slightly different between +the two versions of the library. doit() - Pass this function a string that is a shell command. It will run the - command (unless DH_NO_ACT is set), and if DH_VERBOSE is set, it will - also output the command to stdout. You should use this function for - almost all commands your program performs that manipulate files in - the package build directories. + Pass this function a string (dh_lib) or array (Dh_Lib.pm) that is a + shell command. It will run the command (unless DH_NO_ACT is set), and + if DH_VERBOSE is set, it will also output the command to stdout. You + should use this function for almost all commands your program performs + that manipulate files in the package build directories. complex_doit() - This is the same as doit(), except you can pass more complicated - commands to it (ie, commands involving piping redirection) -verbose_echo() + Pass this function a string that is a shell command, it will run it + similarly to how doit() does. You can pass more complicated commands + to this (ie, commands involving piping redirection) +verbose_echo() (dh_lib) +verbose_print() (Dh_Lib.pm) Pass this command a string, and it will echo it if DH_VERBOSE is set. error() Pass this command a string, it will output it to standard error and @@ -174,18 +203,13 @@ isnative() As a side effect, VERSION is set to the version number of the package. autoscript() - Pass 3 parameters: - 1: script to add to - 2: filename of snippet - 3: sed commands to run on the snippet. Ie, s/#PACKAGE#/$PACKAGE/ - (optional) + Pass parameters: + - package to be affected (Dh_Lib.pm only) + - script to add to + - filename of snippet + - sed commands to run on the snippet. Ie, s/#PACKAGE#/$PACKAGE/ + (optional) This command automatically adds shell script snippets to a debian maintainer script (like the postinst or prerm). -Notes: ------ - -Dh_lib is still evolving. -There will probably be a perl version too, in the future. - -- Joey Hess diff --git a/doc/TODO b/doc/TODO index 756eb4bd..a4e4a10d 100644 --- a/doc/TODO +++ b/doc/TODO @@ -9,7 +9,6 @@ Bugs: Wishlist items: -* update PROGRAMMING to cover new perl interface. * Make dh_movefiles remove emptied directories after it's moved all the files out of them (#17111). * info support for debhelper (currently implemented, but I hate how I did it, @@ -50,7 +49,8 @@ Wishlist items: they are stating that they don't do anything later to invalidate the cache, without calling ch_cache again. (#23792) * Add a switch to dh_installdeb to allow it to do user definied - substitutions. (#25235) + substitutions. TOH, maybe it's better if peopld just sed + postinst.in before debhelper gets it's hands on it... (#25235) Depricated: -- cgit v1.2.3 From a08b76c3505687f6298f762a28a80c34d2e9f07f Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 04:58:27 +0000 Subject: r114: Initial Import --- Dh_Getopt.pm | 1 + Dh_Lib.pm | 11 +++++++++-- debian/changelog | 12 ++++++++++++ debian/control | 2 +- dh_gencontrol | 40 ++++++++++++++++++++++------------------ dh_gencontrol.1 | 2 +- dh_installcron | 32 ++++++++++++++++---------------- doc/PROGRAMMING | 2 +- 8 files changed, 63 insertions(+), 39 deletions(-) (limited to 'doc/PROGRAMMING') diff --git a/Dh_Getopt.pm b/Dh_Getopt.pm index 85f0e15b..0f9dafdf 100644 --- a/Dh_Getopt.pm +++ b/Dh_Getopt.pm @@ -90,6 +90,7 @@ sub parseopts { "u=s", => \$options{U_PARAMS}, "update-rcd-params=s", => \$options{U_PARAMS}, "dpkg-shlibdeps-params=s", => \$options{U_PARAMS}, + "dpkg-gencontrol-params=s", => \$options{U_PARAMS}, "m=s", => \$options{M_PARAMS}, "major=s" => \$options{M_PARAMS}, diff --git a/Dh_Lib.pm b/Dh_Lib.pm index b4d0db53..00f28132 100644 --- a/Dh_Lib.pm +++ b/Dh_Lib.pm @@ -70,12 +70,19 @@ sub init { # This package gets special treatement: files and directories specified on # the command line may affect it. $dh{FIRSTPACKAGE}=${$dh{DOPACKAGES}}[0]; + + # Split the U_PARAMS up into an array. + my $u=$dh{U_PARAMS}; + undef $dh{U_PARAMS}; + if (defined $u) { + push @{$dh{U_PARAMS}}, split(/\s+/,$u); + } } # Escapes out shell metacharacters in a word of shell script. sub escape_shell { my $word=shift; - # This list is from )Unix in a Nutshell_. (except '#') - $word=~s/([-\s!"$()*+#;<>?@\[\]\\`|~])/\\$1/g; + # This list is from _Unix in a Nutshell_. (except '#') + $word=~s/([\s!"\$()*+#;<>?@\[\]\\`|~])/\\$1/g; return $word; } diff --git a/debian/changelog b/debian/changelog index e1c7ee75..725f2ac6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,15 @@ +debhelper (1.1.8) unstable; urgency=low + + * Dh_Lib.pm: made U_PARAMS an array of parameters. + * Dh_Lib.pm: fixed bug in the escaping code, numbers don't need to be + escaped. Also, no longer escape "-". + * dh_clean, dh_gencontrol, dh_installcron: converted to perl. + * dh_gencontrol.1, dh_gencontrol: the man page had said that + --update-rcd-params was equivilant to -u for this program. You should + really use --dpkg-gencontrol-params. + + -- Joey Hess Fri, 14 Aug 1998 14:07:35 -0700 + debhelper (1.1.7) unstable; urgency=low * examples/rules.multi: moved dh_movefiles into the install section. diff --git a/debian/control b/debian/control index 0a97ae80..8ba5d999 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: debhelper Section: devel Priority: optional Maintainer: Joey Hess -Standards-Version: 2.4.1.2 +Standards-Version: 2.4.1.3 Package: debhelper Architecture: all diff --git a/dh_gencontrol b/dh_gencontrol index c3698b56..cadfdc03 100755 --- a/dh_gencontrol +++ b/dh_gencontrol @@ -1,26 +1,30 @@ -#!/bin/sh -e +#!/usr/bin/perl -w # # Generate and install the control file. Simple dpkg-gencontrol wrapper. -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` - EXT=`pkgext $PACKAGE` +foreach $PACKAGE (@{$dh{DOPACKAGES}}) { + $TMP=tmpdir($PACKAGE); + $EXT=pkgext($PACKAGE); + + $changelog=pkgfile($PACKAGE,'changelog'); + if (! $changelog) { + $changelog='debian/changelog'; + } - changelog=`pkgfile $PACKAGE changelog` - if [ ! "$changelog" ]; then - changelog=debian/changelog - fi - - if [ ! -d $TMP/DEBIAN ]; then - doit "install -o root -g root -d $TMP/DEBIAN" - fi + if ( ! -d '$TMP/DEBIAN' ) { + doit("install","-o","root","-g","root","-d","$TMP/DEBIAN"); + } # Generate and install control file. - doit "dpkg-gencontrol -l$changelog -isp -p$PACKAGE -Tdebian/${EXT}substvars -P$TMP $DH_U_PARAMS" + doit("dpkg-gencontrol","-l$changelog","-isp","-p$PACKAGE", + "-Tdebian/$EXT\substvars","-P$TMP",@{$dh{U_PARAMS}}); + # This chmod is only necessary if the user sets the umask to something odd. - doit "chmod 644 $TMP/DEBIAN/control" - doit "chown root.root $TMP/DEBIAN/control" -done + doit("chmod","644","$TMP/DEBIAN/control"); + + doit("chown","root.root","$TMP/DEBIAN/control"); +} diff --git a/dh_gencontrol.1 b/dh_gencontrol.1 index 2bfade49..7ceb532a 100644 --- a/dh_gencontrol.1 +++ b/dh_gencontrol.1 @@ -18,7 +18,7 @@ See .BR debhelper (1) for a list of options common to all debhelper commands. .TP -.B \-uparams, \--update-rcd-params=params +.B \-uparams, \--dpkg-gencontrol-params=params Pass "params" to .BR dpkg-gencontrol (1) .SH ENVIRONMENT diff --git a/dh_installcron b/dh_installcron index 448e38a4..133ba743 100755 --- a/dh_installcron +++ b/dh_installcron @@ -1,20 +1,20 @@ -#!/bin/sh -e +#!/usr/bin/perl -w # # Install cron scripts into the appropriate places. -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` - - for type in daily weekly monthly d; do - cron=`pkgfile $PACKAGE cron.$type` - if [ "$cron" ]; then - if [ ! -d $TMP/etc/cron.$type ]; then - doit "install -o root -g root -d $TMP/etc/cron.$type" - fi - doit "install "$cron" $TMP/etc/cron.$type/$PACKAGE" - fi - done -done +foreach $PACKAGE (@{$dh{DOPACKAGES}}) { + $TMP=tmpdir($PACKAGE); + foreach $type (qw{daily weekly monthly d}) { + $cron=pkgfile($PACKAGE,"cron.$type"); + if ($cron) { + if (! -d "$TMP/etc/cron.$type") { + doit("install","-o","root","-g","root","-d","$TMP/etc/cron.$type"); + } + doit("install",$cron,"$TMP/etc/cron.$type/$PACKAGE"); + } + } +} diff --git a/doc/PROGRAMMING b/doc/PROGRAMMING index e514095d..1addc3b8 100644 --- a/doc/PROGRAMMING +++ b/doc/PROGRAMMING @@ -117,7 +117,7 @@ switch variable description package is being acted on) -u U_PARAMS will be set to a string, that is typically parameters your program passes on to some - other program. + other program. (In Dh_Lib.pm, this is an array) -m M_PARAMS will be set to a string, you decide what it means to your program -V V_FLAG will be set to a string, you decide what it -- cgit v1.2.3 From 0eaafbd7e25e0d2fad5869ee65b6080b88c49c80 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:03:41 +0000 Subject: r137: Initial Import --- Dh_Getopt.pm | 7 ++ debian/changelog | 12 ++ dh_debstd | 360 ++++++++++++++++++++++++++--------------------------- dh_du | 5 +- dh_fixperms | 66 +++++----- dh_installdeb | 74 +++++------ dh_installdebfiles | 15 ++- dh_installinit | 5 +- dh_movefiles | 100 +++++++-------- dh_suidregister | 86 +++++++------ doc/PROGRAMMING | 2 +- 11 files changed, 381 insertions(+), 351 deletions(-) (limited to 'doc/PROGRAMMING') diff --git a/Dh_Getopt.pm b/Dh_Getopt.pm index 1592d5d0..42ad7abf 100644 --- a/Dh_Getopt.pm +++ b/Dh_Getopt.pm @@ -145,6 +145,13 @@ sub parseopts { } @{$options{DOPACKAGES}}=@package_list; + # Generate EXCLUDE_FIND. + $options{EXCLUDE_FIND}=''; + foreach (@{$options{EXCLUDE}}) { + $options{EXCLUDE_FIND}.="-regex .*".quotemeta($_).".* -or "; + } + $options{EXCLUDE_FIND}=~s/ -or $//; + # If there are no packages to act on now, it's an error. if (! defined $options{DOPACKAGES} || ! @{$options{DOPACKAGES}}) { error("I have no package to build"); diff --git a/debian/changelog b/debian/changelog index 5f3eb367..51977f18 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,15 @@ +debhelper (1.2.3) unstable; urgency=low + + * dh_fixperms, dh_installdebfiles, dh_installdeb: perlized + * dh_suidregister: perlized, with help from Che_Fox (and Tom Christianson, + indirectly..). + * dh_suidregister: include leading 0 (or 1 for sticky, etc) in file + permissions. + * Only 3 more to go and it'll be 100% perl. + * Made $dh{EXCLUDE_FIND} available to perl scripts. + + -- Joey Hess Tue, 10 Nov 1998 15:47:43 -0800 + debhelper (1.2.2) unstable; urgency=low * dh_du, dh_shlibdeps, dh_undocumented: rewrite in perl. diff --git a/dh_debstd b/dh_debstd index 6187fd31..e9e7b3ca 100755 --- a/dh_debstd +++ b/dh_debstd @@ -1,4 +1,4 @@ -#!/bin/sh -e +#!/usr/bin/perl -w # # Script to be called from debian/rules to setup all the debian specifc # required files @@ -8,214 +8,212 @@ # (but doc files can also be listed in debian/docs) # # This has been gutted and extensively rewritten to function as a debhelper -# command by Joey Hess. +# command by Joey Hess. And then completly rewritten in perl. # Pre-parse command line before we load dh_lib, becuase we use a # different style of arguments. -for i;do - case "$i" in - -p) PERMS=1 - ;; - -u) UNDOC=1 - ;; - -s) SUMS=1 - ;; - -m) NOAUTOMAN=1 - ;; - -c) NOCOMPRESS=1 - ;; - *) collect="$collect$i " - ;; - esac -done -set -- $collect - -PATH=debian:$PATH:/usr/lib/debhelper -. dh_lib +@argv=(); +foreach (@ARGV) { + if ($_ eq '-p') { + $ds{PERMS}=1; + } + elsif ($_ eq '-u') { + $ds{UNDOC}=1; + } + elsif ($_ eq '-s') { + $ds{SUMS}=1; + } + elsif ($_ eq '-m') { + $ds{NOAUTOMAN}=1; + } + elsif ($_ eq '-c') { + $ds{NOCOMPRESS}=1; + } + else { + push @argv,$_; + } +} +@ARGV=@argv; -# Tolerate old style debstd invocations -if [ "$DH_FIRSTPACKAGE" = "$1" ]; then - shift -fi +BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +use Dh_Lib; +init(); -# Subroutines +# Tolerate old style debstd invocations +if ($ARGV[0] && $dh{FIRSTPACKAGE} eq $ARGV[0]) { + shift; +} # debinit handles the installation of an init.d script -# Parameters: -# $1= name in /etc/init.d -# $2 = scriptname -# $3 = package name -# $4 = extra params for debhelper -debinit() { - PPACKAGE=$3 - SCRIPT=$1 - - INITPARAMS=`grep "^FLAGS=" $2` || true - if [ "$INITPARAMS" != "" ]; then - INITPARAMS=`expr "$INITPARAMS" : 'FLAGS="\(.*\)"'` || true - if [ "$INITPARAMS" ]; then - INITPARAMS="--update-rcd-params='$INITPARAMS'" - fi - fi - - if grep -q NO_RESTART_ON_UPGRADE $2; then - doit "dh_installinit --no-restart-on-upgrade -p$PPACKAGE $INITPARAMS --init-script=$SCRIPT $4" - else - doit "dh_installinit -p$PPACKAGE $INITPARAMS --init-script=$SCRIPT $4" - fi +sub debinit { my ($script, $filename, $package, @params)=@_; + @initparams=(); + $norestart=''; + open (IN,$filename) || warn("$filename: $!"); + while () { + if (/^FLAGS=(.*)/) { + push @initparams, $1; + } + if (/NO_RESTART_ON_UPGRADE/) { + $norestart='--no-restart-on-upgrade'; + } + } + close IN; + $initparams=''; + if (@initparams) { + $initparams="--update-rcd-params='".join(" ",@initparams)."'"; + } + + doit("dh_installinit",$norestart,"-p$package",$initparams,"--init-script=$script",@params); } -# Package specific things -# -# The first parameter is the package name -# The second parameter is the directory name of the temp directory -# The third parameter is the prefix for all configuration files to be processed -package() -{ - local i - local X Y - CPACKAGE=$1 - CTEMP=$2 - +# Do package specific things for a package. +sub do_package { my ($package, $tmp, $prefix)=@_; # Deal with scripts in etc directories - if [ -f $3/rc.boot ]; then - warning "file $3/rc.boot was ignored." - fi + if (-d "$prefix/rc.boot") { + warning("file $prefix/rc.boot was ignored."); + } # etc files that could need some tweaking - for i in services inittab crontab protocols profile shells rpc shells \ - syslog.conf conf.modules modules aliases diversions inetd.conf \ - X11/Xresources X11/config X11/window-managers X11/xinit purge ; do - if [ -f $3$i ]; then - warning "file $3$i was ignored." - fi - done - - if [ -f $3init.d ]; then - debinit $1 $3init.d $1 "" - fi + foreach $f ('services','inittab','crontab','protocols','profile', + 'shells','rpc','syslog.conf','conf.modules','modules', + 'aliases','diversions','inetd.conf','X11/Xresources', + 'X11/config','X11/window-managers','X11/xinit','purge') { + if ( -f "$prefix$f") { + warning("file $prefix$f was ignored."); + } + } + + if (-f "${prefix}init.d") { + debinit($package,"${prefix}init.d",$package,""); + } # The case of a daemon without the final d - if [ -f $3init ]; then - X=`expr $1 : '\(.*\)d$'` || true - if [ "$X" ]; then - debinit $X $3init $1 "--remove-d" - fi - fi - - if [ -f $3info ]; then - warning "debhelper does not yet support info files, so $3info was ignored." - fi - - X=`find $2 -type f -perm +111 2>/dev/null | tr "\n" " "` - for i in $X; do - BINPATH="`expr "$i" : "$2/\(.*\)/.*"`" - BINNAME="`expr "$i" : "$2/.*/\(.*\)"`" - - # Check if manpages exist - case "$BINPATH" in - DEBIAN|etc/rc.boot|usr/lib/cgi-bin|etc/init.d|etc/cron.*|usr/lib/lib*|usr/lib/*) SECTION="" - ;; - sbin|usr/sbin) SECTION="8" - ;; - usr/X11R6/bin) SECTION="1x" - ;; - bin|usr/bin) SECTION="1" - ;; - usr/games) SECTION="6" - ;; - *) SECTION="" - ;; - esac - if [ "$SECTION" ]; then - Y=`find $2/usr/man $2/usr/X11R6/man -name "$BINNAME.*" 2>/dev/null` || true - if [ "$Y" = "" ]; then - if [ "$UNDOC" ]; then - doit "dh_undocumented -p$CPACKAGE $BINNAME.$SECTION" - fi - fi - fi - done + if (-f "${prefix}init") { + $p=$package; + if ($p=~s/d$//) { + debinit($p,"${prefix}init",$package,"--remove-d"); + } + } + + if (-f "${prefix}info") { + warning("debhelper does not yet support info files, so ${prefix}info was ignored."); + } + + # Set up undocumented man page symlinks. + if (defined($ds{UNDOC}) && $ds{UNDOC}) { + open (FIND,"find $tmp -type f -perm +111 2>/dev/null |") || warning("find: $!"); + while () { + chomp; + ($binpath, $binname)=m:$tmp/(.*)/(.*):; + + # Check if manpages exist + $section=''; + if ($binpath eq 'sbin' || $binpath eq 'usr/sbin') { + $section=8; + } + elsif ($binpath eq 'usr/X11R6/bin') { + $section='1x'; + } + elsif ($binpath eq 'bin' || $binpath eq 'usr/bin') { + $section=1; + } + elsif ($binpath eq 'usr/games') { + $section=6; + } + if ($section && `find $tmp/usr/man $tmp/usr/X11R6/man -name "$binname.*" 2>/dev/null` eq '') { + doit("dh_undocumented","-p$package","$binname.$section"); + } + } + close FIND; + } } -packages() { - local i - BASE=$1 - shift - for i in $*; do - package $i debian/$i "debian/$i." - if [ -x debian/$i.prebuild ]; then - warning "file debian/$i.prebuild ignored" - fi - done - - if [ -f debian/clean ]; then - warning "file debian/clean ignored" - fi - package $BASE debian/tmp "debian/" +# Special case of changelog +$changelogfile=''; +if ($ARGV[0] && $ARGV[0]=~m/change|news|history/) { + $changelogfile=shift; } -# Special case of changelog -if [ "$1" ]; then - if echo "$1" | egrep -qi "change|news|history" ; then - changelogfile=$1 - shift - fi -fi - -doit "dh_installdirs" # here just to make the debian/tmp, etc directories. -doit "dh_installdocs $*" -doit "dh_installexamples" -doit "dh_installchangelogs $changelogfile" -doit "dh_installmenu" -doit "dh_installcron" +doit("dh_installdirs"); # here just to make the debian/tmp, etc directories. +doit("dh_installdocs",@ARGV); +doit("dh_installexamples"); +if ($changelogfile) { + doit("dh_installchangelogs",$changelogfile); +} +else { + doit("dh_installchangelogs"); +} +doit("dh_installmenu"); +doit("dh_installcron"); # Manpage scan -if [ "$NOAUTOMAN" = "" ]; then - doit "dh_installmanpages -p$DH_FIRSTPACKAGE" -fi +if (! $ds{NOAUTOMAN}) { + doit("dh_installmanpages","-p$dh{FIRSTPACKAGE}"); +} -packages $DH_DOPACKAGES +# Per-package stuff: +foreach $PACKAGE (@{$dh{DOPACKAGES}}) { + if ($PACKAGE eq $dh{FIRSTPACKAGE}) { + if (-f "debian/clean") { + warning("file debian/clean ignored."); + } + do_package($PACKAGE,"debian/tmp","debian/"); + } + else { + do_package($PACKAGE,"debian/$PACKAGE","debian/$PACKAGE."); + if ( -x "debian/$PACKAGE.prebuild") { + warning("file debian/$PACKAGE.prebuild ignored."); + } + } +} -doit "dh_movefiles" -doit "dh_strip" +doit("dh_movefiles"); +doit("dh_strip"); -if [ ! "$nocompress" ]; then - doit "dh_compress" -fi +if (! $ds{NOCOMPRESS}) { + doit("dh_compress"); +} -doit "dh_fixperms" -doit "dh_suidregister" -doit "dh_shlibdeps" -doit "dh_gencontrol" -doit "dh_makeshlibs" +doit("dh_fixperms"); +doit("dh_suidregister"); +doit("dh_shlibdeps"); +doit("dh_gencontrol"); +doit("dh_makeshlibs"); # Check to see if the install scripts have #DEBHELPER# in them, if not, # warn. -for PACKAGE in $DH_DOPACKAGES; do - for file in postinst postrm preinst prerm; do - f="`pkgfile $PACKAGE $file`" - if [ "$f" ]; then - if ! grep -q "#DEBHELPER#" "$f"; then - filelist="$filelist$f " - - fi - fi - done -done -if [ "$filelist" ]; then - warning "The following scripts do not contain \"#DEBHELPER#\" in them," - warning "and so debhelper will not automatically add commands to them:" - warning "$filelist" -fi - -doit "dh_installdeb" - -if [ "$SUMS" = "" ]; then - doit "dh_md5sums" -fi +@filelist=(); +foreach $PACKAGE (@{$dh{DOPACKAGES}}) { + foreach $file (qw{postinst postrm preinst prerm}) { + $f=pkgfile($PACKAGE,$file); + if ($f) { + open (IN,$f); + $found=undef; + while () { + if (/#DEBHELPER#/) { + $found=1; + last; + } + } + if (! $found) { + push @filelist, $f; + } + } + } +} +if (@filelist) { + warning("The following scripts do not contain \"#DEBHELPER#\" in them,"); + warning("and so debhelper will not automatically add commands to them:"); + warning(join(" ",@filelist)); +} + +doit("dh_installdeb"); + +if (! $ds{SUMS}) { + doit("dh_md5sums"); +} # This causes the main binary package to be built, which # real debstd does not do. Shouldn't be a problem though, # if that package gets built twice. -doit "dh_builddeb" +doit("dh_builddeb"); diff --git a/dh_du b/dh_du index 78518f8e..f81b074d 100755 --- a/dh_du +++ b/dh_du @@ -5,4 +5,7 @@ # # No longer - it was decided these files are a bad idea. -print STDERR "dh_du: this program does nothing and is deprecated. Remove it from debian/rules.\n"; +BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +use Dh_Lib; + +warning("this program does nothing and is deprecated. Remove it from debian/rules."); diff --git a/dh_fixperms b/dh_fixperms index 58aa1484..e7e1ec6a 100755 --- a/dh_fixperms +++ b/dh_fixperms @@ -1,50 +1,52 @@ -#!/bin/sh -e +#!/usr/bin/perl -w # # Do some general file permission fixups. -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); # General permissions fixing. - if [ ! "$DH_EXCLUDE_FIND" ]; then + if (! defined($dh{EXCLUDE_FIND}) || $dh{EXCLUDE_FIND} eq '') { # It's much faster to do it this way, but we can only do # this if there is nothing to exclude. - if [ -d $TMP ]; then - doit "chown -R root.root $TMP" - doit "chmod -R go=rX $TMP" - doit "chmod -R u+rw $TMP" - fi - - FIND_OPTIONS="" - else + if (-d $TMP) { + doit("chown","-R","root.root",$TMP); + doit("chmod","-R","go=rX",$TMP); + doit("chmod","-R","u+rw",$TMP); + } + + $find_options=""; + } + else { # Do it the hard way. - complex_doit "find $TMP ! \( $DH_EXCLUDE_FIND \) -print0 \ - 2>/dev/null | xargs -0r chown root.root" - complex_doit "find $TMP ! \($DH_EXCLUDE_FIND \) -print0 \ - 2>/dev/null | xargs -0r chmod go=rX" - complex_doit "find $TMP ! \( $DH_EXCLUDE_FIND \) -print0 \ - 2>/dev/null | xargs -0r chmod u+rw" + complex_doit("find $TMP ! \\( $dh{EXCLUDE_FIND} \\) -print0 \ + 2>/dev/null | xargs -0r chown root.root"); + complex_doit("find $TMP ! \\( $dh{EXCLUDE_FIND} \\) -print0 \ + 2>/dev/null | xargs -0r chmod go=rX"); + complex_doit("find $TMP ! \\( $dh{EXCLUDE_FIND} \\) -print0 \ + 2>/dev/null | xargs -0r chmod u+rw"); - FIND_OPTIONS="! \( $DH_EXCLUDE_FIND \)" - fi + $find_options="! \\( $dh{EXCLUDE_FIND} \\)"; + } # Fix up premissions in usr/doc, setting everything to not exectable # by default, but leave examples directories alone. - complex_doit "find $TMP/usr/doc -type f $FIND_OPTIONS ! -regex .\*/examples/.\* -print0 \ - 2>/dev/null | xargs -0r chmod 644" - complex_doit "find $TMP/usr/doc -type d $FIND_OPTIONS -print0 \ - 2>/dev/null | xargs -0r chmod 755" + complex_doit("find $TMP/usr/doc -type f $find_options ! -regex .\*/examples/.\* -print0", + "2>/dev/null | xargs -0r chmod 644"); + complex_doit("find $TMP/usr/doc -type d $find_options -print0", + "2>/dev/null | xargs -0r chmod 755"); # Executable man pages are a bad thing.. - complex_doit "find $TMP/usr/man/ $TMP/usr/X11*/man/ -type f \ - $FIND_OPTIONS -print0 2>/dev/null | xargs -0r chmod 644" + complex_doit("find $TMP/usr/man/ $TMP/usr/X11*/man/ -type f", + "$find_options -print0 2>/dev/null | xargs -0r chmod 644"); # ..and so are executable shared and static libraries # (and .la files from libtool) - complex_doit "find $TMP -perm -5 -type f \ - \( -name '*.so*' -or -name '*.la' -or -name '*.a' \) $FIND_OPTIONS -print0 \ - 2>/dev/null | xargs -0r chmod a-X" -done + complex_doit("find $TMP -perm -5 -type f", + "\\( -name '*.so*' -or -name '*.la' -or -name '*.a' \\) $find_options -print0", + "2>/dev/null | xargs -0r chmod a-X"); +} diff --git a/dh_installdeb b/dh_installdeb index dd1a23fb..f5f3055a 100755 --- a/dh_installdeb +++ b/dh_installdeb @@ -1,51 +1,55 @@ -#!/bin/sh -e +#!/usr/bin/perl -w # # Install files from debian/ into the package's DEBIAN directory. -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` - EXT=`pkgext $PACKAGE` +foreach $PACKAGE (@{$dh{DOPACKAGES}}) { + $TMP=tmpdir($PACKAGE); + $EXT=pkgext($PACKAGE); - if [ ! -d $TMP/DEBIAN ]; then - doit "install -o root -g root -d $TMP/DEBIAN" - fi + if (! -d "$TMP/DEBIAN") { + doit("install","-o","root","-g","root","-d","$TMP/DEBIAN"); + } # Install debian install scripts. # If any .debhelper files exist, add them into the scripts. - for file in postinst preinst prerm postrm; do - f=`pkgfile $PACKAGE $file` - if [ "$f" ]; then - if [ -f debian/$EXT$file.debhelper ]; then + foreach $file (qw{postinst preinst prerm postrm}) { + $f=pkgfile($PACKAGE,$file); + if ($f) { + if (-f "debian/$EXT$file.debhelper") { # Add this into the script, where it has # #DEBHELPER# - complex_doit "perl -pe 's~#DEBHELPER#~qx{cat debian/$EXT$file.debhelper}~eg' < $f > $TMP/DEBIAN/$file" - else + # TODO: do internally, no perl fork? + complex_doit("perl -pe 's~#DEBHELPER#~qx{cat debian/$EXT$file.debhelper}~eg' < $f > $TMP/DEBIAN/$file"); + } + else { # Just get rid of any #DEBHELPER# in the # script. - complex_doit "sed s/#DEBHELPER#// < $f > $TMP/DEBIAN/$file" - fi - doit "chown root.root $TMP/DEBIAN/$file" - doit "chmod 755 $TMP/DEBIAN/$file" - else + complex_doit("sed s/#DEBHELPER#// < $f > $TMP/DEBIAN/$file"); + } + doit("chown","root.root","$TMP/DEBIAN/$file"); + doit("chmod",755,"$TMP/DEBIAN/$file"); + } + else { # Auto-generate script header and add .debhelper # content to it. - if [ -f debian/$EXT$file.debhelper ]; then - complex_doit "echo '#!/bin/sh -e' > $TMP/DEBIAN/$file" - complex_doit "cat debian/$EXT$file.debhelper >> $TMP/DEBIAN/$file" - doit "chown root.root $TMP/DEBIAN/$file" - doit "chmod 755 $TMP/DEBIAN/$file" - fi - fi - done + if (-f "debian/$EXT$file.debhelper") { + complex_doit("echo '#!/bin/sh -e' > $TMP/DEBIAN/$file"); + complex_doit("cat debian/$EXT$file.debhelper >> $TMP/DEBIAN/$file"); + doit("chown","root.root","$TMP/DEBIAN/$file"); + doit("chmod",755,"$TMP/DEBIAN/$file"); + } + } + } # Install non-executable files - for file in shlibs conffiles; do - f=`pkgfile $PACKAGE $file` - if [ "$f" ]; then - doit "install -o root -g root -m 644 -p $f $TMP/DEBIAN/$file" - fi - done -done + foreach $file (qw{shlibs conffiles}) { + $f=pkgfile($PACKAGE,$file); + if ($f) { + doit("install","-o","root","-g","root","-m",644,"-p",$f,"$TMP/DEBIAN/$file"); + } + } +} diff --git a/dh_installdebfiles b/dh_installdebfiles index d999c91b..cd4562ea 100755 --- a/dh_installdebfiles +++ b/dh_installdebfiles @@ -1,12 +1,15 @@ -#!/bin/sh -e +#!/usr/bin/perl -w # # This program is deprecated, but left in the package for backwards # compatability. It simply calls the 3 programs that replaced it. -PATH=debian:$PATH:/usr/lib/debhelper +BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +use Dh_Lib; -echo "dh_installdebfiles: use of this program is deprecated, see man page." >&2 +$ENV{PATH}="debian:$ENV{PATH}:/usr/lib/debhelper"; -dh_installdeb $* -dh_shlibdeps $* -dh_gencontrol $* +warning("use of this program is deprecated, see man page."); + +doit("dh_installdeb",@ARGV); +doit("dh_shlibdeps",@ARGV); +doit("dh_gencontrol",@ARGV); diff --git a/dh_installinit b/dh_installinit index d455de4a..d1de1807 100755 --- a/dh_installinit +++ b/dh_installinit @@ -42,7 +42,10 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { # This is set by the -u "foo" command line switch, it's # the parameters to pass to update-rc.d. If not set, # we have to say "defaults". - my $params=join(' ',@{$dh{U_PARAMS}}); + my $params=''; + if (defined($dh{U_PARAMS})) { + $params=join(' ',@{$dh{U_PARAMS}}); + } if ($params eq '') { $params="defaults"; } diff --git a/dh_movefiles b/dh_movefiles index 712ed887..5967ff54 100755 --- a/dh_movefiles +++ b/dh_movefiles @@ -1,70 +1,70 @@ -#!/bin/sh -e +#!/usr/bin/perl -w # # Move files out of debian/tmp, into subpackages. -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` - files=`pkgfile $PACKAGE files` +$ret=0; - if [ ! -d "debian/tmp" ]; then - error "debian/tmp does not exist" - fi +foreach $PACKAGE (@{$dh{DOPACKAGES}}) { + $TMP=tmpdir($PACKAGE); + $files=pkgfile($PACKAGE,"files"); - tomove="" + if (! -d "debian/tmp") { + error("debian/tmp does not exist."); + } + + @tomove=(); # debian/files has a different purpose, so ignore it. - if [ "$files" -a "$files" != "debian/files" ]; then - tomove=`cat $files` - fi + if ( $files && $files != "debian/files" ) { + @tomove=filearray($files); + } - if [ \( "$PACKAGE" = "$DH_FIRSTPACKAGE" -o "$DH_PARAMS_ALL" \) \ - -a "$*" ]; then - tomove="$* $tomove" - fi - - if [ "$tomove" -a "$TMP" = "debian/tmp" ]; then - error "I was asked to move files from debian/tmp to debian/tmp." - fi + if (($PACKAGE eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) { + push @tomove, @ARGV; + } - if [ "$tomove" ]; then - if [ ! -d "$TMP" ]; then - doit "install -d $TMP" - fi + if (@tomove && $TMP eq "debian/tmp") { + error("I was asked to move files from debian/tmp to debian/tmp."); + } + if (@tomove) { + if (! -d $TMP) { + doit("install","-d",$TMP); + } + # Now we need to expand wildcards in @tomove. + @filelist=(); + foreach (@tomove) { + push @filelist, glob("debian/tmp/$_"); + } + # Order the files. First all real files, then symlinks. # Putting symlinks last is a nice thing to do for library # packages and doesn't affect much of anything else. - # - # (The echo is in here to expand wildcards. Note that 'ls' - # won't work properly.) - # The file list is used, so even very weird filenames can be - # moved. - doit "rm -f movelist" - for i in `(cd debian/tmp; echo $tomove)`; do - if [ ! -e "debian/tmp/$i" -a ! -L "debian/tmp/$i" ]; then - fail=1 - fi - complex_doit "(cd debian/tmp ; find $i ! -type d -and ! -type l -print || true) >> movelist" - done - for i in `(cd debian/tmp; echo $tomove)`; do - if [ ! -e "debian/tmp/$i" -a ! -L "debian/tmp/$i" ]; then - fail=1 - fi - complex_doit "(cd debian/tmp ; find $i ! -type d -and -type l -print || true) >> movelist" - done - complex_doit "(cd debian/tmp;tar --create --remove-files --files-from=../../movelist --file -) | (cd $TMP;tar xpf -)" - doit "rm -f movelist" - fi -done + doit("rm","-f","movelist"); + foreach (@filelist) { + $ret=1 if (! -e $_ && ! -l $_); + s:^debian/tmp/*::; + complex_doit("(cd debian/tmp ; find $_ ! -type d -and ! -type l -print || true) >> movelist"); + } + foreach (@filelist) { + $ret=1 if (! -e $_ && ! -l $_); + s:^debian/tmp/*::; + complex_doit("(cd debian/tmp ; find $_ ! -type d -and -type l -print || true) >> movelist"); + } + complex_doit("(cd debian/tmp;tar --create --remove-files --files-from=../../movelist --file -) | (cd $TMP;tar xpf -)"); + doit("rm","-f","movelist"); + } +} -# If fail is set, we wern't actually able to find some +# If $ret is set, we wern't actually able to find some # files that were specified to be moved, and we should -# exit with the code in fail. This program puts off +# exit with the code in $ret. This program puts off # exiting with an error until all files have been tried # to be moved, because this makes it easier for some # packages that arn't always sure exactly which files need # to be moved. -exit $fail +exit $ret; diff --git a/dh_suidregister b/dh_suidregister index f6d02bc1..86188cd4 100755 --- a/dh_suidregister +++ b/dh_suidregister @@ -1,4 +1,4 @@ -#!/bin/sh -e +#!/usr/bin/perl -w # # If no parameters are given, and no debian/suid files exists, scan for # suid/sgid files and suidregister them. @@ -6,58 +6,56 @@ # If there are parameters, or there is a debian/suid, register the files # listed there. -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` - suid=`pkgfile $PACKAGE suid` +foreach $PACKAGE (@{$dh{DOPACKAGES}}) { + $TMP=tmpdir($PACKAGE); + $suid=pkgfile($PACKAGE,"suid"); - files="" + @files=(); + if ($suid) { + @files=filearray($suid); + } - if [ "$suid" ]; then - files=`tr "\n" " " < $suid` - fi + if (($PACKAGE eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) { + push @files, @ARGV; + } - if [ \( "$PACKAGE" = "$DH_FIRSTPACKAGE" -o "$DH_PARAMS_ALL" \) \ - -a "$*" ]; then - files="$* $files" - fi - - if [ ! "$files" -a ! "$suid" ]; then + if (! @files && ! $suid) { # No files specified (and no empty debian/suid file), so # guess what files to process. - files=`find $TMP -type f -perm +6000` + @files=split(/\n/,`find $TMP -type f -perm +6000`); # We will strip the debian working directory off of the # filenames. - tostrip="$TMP/" - else + $tostrip="$TMP/"; + } + else { # We will strip leading /'s, so the user can feed this # program either absolute filenames, or relative filenames, # and it will do the right thing either way. - tostrip="/" - fi - - if [ "$files" ]; then - for file in $files; do - # Strip leading $tostrip from $file. If not there, - # leave $file untouched. - if [ `expr "$file" : "$tostrip\\(.*\\)"` ]; then - file=`expr "$file" : "$tostrip\\(.*\\)"` - fi - - # Create the sed string that will be used to - # fill in the blanks in the autoscript files. - # Fill with the owner, group, and perms of the file. - sedstr=`find $TMP/$file -printf "s:#FILE#:$file:;s/#PACKAGE#/$PACKAGE/;s/#OWNER#/%u/;s/#GROUP#/%g/;s/#PERMS#/%m/"` - - autoscript "postinst" "postinst-suid" "$sedstr" - autoscript "postrm" "postrm-suid" "$sedstr" - - if [ -e "$TMP/$file" ]; then - doit "chmod a-s $TMP/$file" - fi - done - fi -done + $tostrip="/"; + } + + foreach $file (@files) { + # Strip leading $tostrip from $file. + $file=~s/^$tostrip//; + + # Create the sed string that will be used to + # fill in the blanks in the autoscript files. + # Fill with the owner, group, and perms of the file. + (undef,undef,$mode,undef,$uid,$gid,undef) = stat("$TMP/$file"); + # Note that I have to print mode in ocal, stripping file type. + $sedstr=sprintf("s:#FILE#:$file:;s/#PACKAGE#/$PACKAGE/;s/#OWNER#/$uid/;s/#GROUP#/$gid/;s/#PERMS#/%#o/", + $mode & 07777); + + autoscript($PACKAGE,"postinst","postinst-suid",$sedstr); + autoscript($PACKAGE,"postrm","postrm-suid","$sedstr"); + + if ( -e "$TMP/$file") { + doit("chmod","a-s","$TMP/$file"); + } + } +} diff --git a/doc/PROGRAMMING b/doc/PROGRAMMING index 1addc3b8..67d25d00 100644 --- a/doc/PROGRAMMING +++ b/doc/PROGRAMMING @@ -106,7 +106,7 @@ switch variable description EXCLUDE_FIND same as DH_EXCLUDE, except all items are put into a string in a way that they will make find find them. (Use ! in front to negate - that, of course) (only available to dh_lib) + that, of course) -x INCLUDE_CONFFILES include conffiles. It's -x for obscure historical reasons. -- cgit v1.2.3 From 86dad95164449b89ef4d97df2750c3e8b94cf47f Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:03:50 +0000 Subject: r139: Initial Import --- debian/changelog | 13 ++++++ debian/rules | 4 +- dh_compress | 130 ++++++++++++++++++++++++++----------------------------- dh_debstd | 2 +- doc/PROGRAMMING | 88 ++++++++++++++----------------------- doc/README | 2 +- doc/TODO | 5 --- 7 files changed, 111 insertions(+), 133 deletions(-) (limited to 'doc/PROGRAMMING') diff --git a/debian/changelog b/debian/changelog index 2c4e79a3..32baae86 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,16 @@ +debhelper (1.2.5) unstable; urgency=low + + * The perl conversion is complete. + . + * dh_compress: perlized (yay, perl has readlink, no more ls -l | awk + garbage!) + * dh_lib, dh_getopt.pl: deleted, nothing uses them anymore. + * debian/rules: don't install above 2 files. + * doc/PROGRAMMING: removed all documentation of the old shell library + interface. + + -- Joey Hess Fri, 13 Nov 1998 15:36:57 -0800 + debhelper (1.2.4) unstable; urgency=low * dh_debstd, dh_movefiles: perlized. diff --git a/debian/rules b/debian/rules index bb790cd3..48275979 100755 --- a/debian/rules +++ b/debian/rules @@ -1,7 +1,7 @@ #!/usr/bin/make -f # Note that I have to refer to debhelper programs with ./, to make sure # I run the most current ones. That's also why there is a symlink to the -# current dh_lib and the current dh_getopt.pl in this debian/ directory. +# current Dh_lib.pm and the current Dh_getopt.pm in this debian/ directory. # If any automatic script generation is done in building this package, # be sure to use the new templates from this package. @@ -34,7 +34,7 @@ binary-indep: build echo -e "package Dh_Version;\n\$$version='$(VERSION)';" > debian/tmp/usr/lib/debhelper/Dh_Version.pm find . -perm +111 -maxdepth 1 -type f -not -name "*.pl" \ -exec install -p {} debian/tmp/usr/bin \; - cp -a dh_lib dh_getopt.pl *.pm debian/tmp/usr/lib/debhelper + cp -a *.pm debian/tmp/usr/lib/debhelper cp -a autoscripts debian/tmp/usr/lib/debhelper ./dh_installdocs doc/TODO doc/README doc/PROGRAMMING doc/from-debstd diff --git a/dh_compress b/dh_compress index 76f7614d..0cc79c78 100755 --- a/dh_compress +++ b/dh_compress @@ -1,82 +1,74 @@ -#!/bin/sh -e +#!/usr/bin/perl -w # # Compresses files and makes sure that symlinks pointing to the # compressed files get fixed. -PATH=debian:$PATH:/usr/lib/debhelper -. dh_lib +use Cwd; +BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +use Dh_Lib; +init(); -# Returns a list of all the files that we want to compress, -# (ignoring any files we were asked to exclude on the command -# line). Assumes we are already in the temp directory. -filelist () { - # First of all, deal with any files specified right on the command line. - if [ \( "$PACKAGE" = "$DH_FIRSTPACKAGE" -o "$DH_PARAMS_ALL" \) \ - -a "$*" ]; then - # Convert to having each file on its own line - # so grep will work. - echo "$*" | tr " " "\n" - fi - - if [ "$compress" ]; then - # The config file is a sh script that outputs the files to be compressed - # (typically using find). - sh $olddir/$compress 2>/dev/null || true - else - # By default fall back on what the policy manual says to compress. - find usr/info usr/man usr/X11*/man -type f ! -name "*.gz" 2>/dev/null || true - find usr/doc -type f \( -size +4k -or -name "changelog*" \) \ - ! -name "*.htm*" ! -name "*.gif" ! -name "*.gz" \ - ! -name "copyright" 2>/dev/null || true - fi -} - -# Returns a list of all the files we want to compress, -# after taking command line exclusions into account. -# Call only if DH_EXCLUDE_GREP is non-empty. -filelist_excluded () { - # Use grep -F so we don't have to worry about regexp's. - (filelist "$*" | grep -v -F \ - "`echo "$DH_EXCLUDE_GREP" | tr "|" "\n"`") || true -} - -for PACKAGE in $DH_DOPACKAGES; do - TMP=`tmpdir $PACKAGE` - compress=`pkgfile $PACKAGE compress` +foreach $PACKAGE (@{$dh{DOPACKAGES}}) { + $TMP=tmpdir($PACKAGE); + $compress=pkgfile($PACKAGE,"compress"); # Run the file name gathering commands from within the directory # structure that will be effected. - olddir=`pwd` - # Can't use doit here, that breaks --no-act mode. - verbose_echo "cd $TMP" - cd "$TMP" + $olddir=getcwd(); + chdir($TMP) || error("Can't cd to $TMP: $!"); + + # Figure out what files to compress. + @files=(); + # First of all, deal with any files specified right on the command line. + if (($PACKAGE eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) { + push @files,#ARGV; + } + if ($compress) { + # The config file is a sh script that outputs the files to be compressed + # (typically using find). + push @files, split(/\n/,`sh $olddir/$compress 2>/dev/null`); + } + else { + # By default, fall back to what the policy manual says to compress. + push @files, split(/\n/,` + find usr/info usr/man usr/X11*/man -type f ! -name "*.gz" 2>/dev/null || true; + find usr/doc -type f \\( -size +4k -or -name "changelog*" \\) \\ + ! -name "*.htm*" ! -name "*.gif" ! -name "*.gz" \\ + ! -name "copyright" 2>/dev/null || true + `); + } - # Get the list of files to compress. - if [ "$DH_EXCLUDE_GREP" ]; then - files=`filelist_excluded $*` - else - files=`filelist $*` - fi + # Exclude files from compression. + if (@files && defined($dh{EXCLUDE}) && $dh{EXCLUDE}) { + @new=(); + foreach (@files) { + $ok=1; + foreach $x (@{$dh{EXCLUDE}}) { + if (/\Q$x\E/) { + $ok=''; + last; + } + } + push @new,$_ if $ok; + } + @files=@new; + } - if [ "$files" ]; then - # This is just a cosmetic fix. - files=`echo $files | tr "\n" " "` - - doit "gzip -f9 $files" || true - fi + if (@files) { + doit("gzip","-9f",@files); + } - # Change back to old pwd. - verbose_echo "cd $olddir" - cd "$olddir" + chdir($olddir); # Fix up symlinks that were pointing to the uncompressed files. - for file in `find $TMP -type l`; do - DIRECTORY=`expr $file : "\(.*\)/[^/]*"` - NAME=`expr $file : ".*/\([^/]*\)"` - LINKVAL=`ls -l $DIRECTORY/$NAME | awk '{ print $11;}'` - if [ ! -e $DIRECTORY/$LINKVAL -a -f $DIRECTORY/$LINKVAL.gz ]; then - doit "rm $DIRECTORY/$NAME" - doit "ln -s $LINKVAL.gz $DIRECTORY/$NAME.gz" - fi - done -done + open (FIND,"find $TMP -type l |"); + while () { + chomp; + ($directory)=m:(.*)/:; + $linkval=readlink($_); + if (! -e "$directory/$linkval" && -e "$directory/$linkval.gz") { + doit("rm","-f",$_); + doit("ln","-sf","$linkval.gz","$_.gz"); + } + } +} diff --git a/dh_debstd b/dh_debstd index e9e7b3ca..2a557ec9 100755 --- a/dh_debstd +++ b/dh_debstd @@ -10,7 +10,7 @@ # This has been gutted and extensively rewritten to function as a debhelper # command by Joey Hess. And then completly rewritten in perl. -# Pre-parse command line before we load dh_lib, becuase we use a +# Pre-parse command line before we load Dh_lib, becuase we use a # different style of arguments. @argv=(); foreach (@ARGV) { diff --git a/doc/PROGRAMMING b/doc/PROGRAMMING index 67d25d00..da21ea9d 100644 --- a/doc/PROGRAMMING +++ b/doc/PROGRAMMING @@ -36,27 +36,20 @@ merge these modifications into the actual postinst scripts. There are always exceptions. Just ask me. -Introducing dh_lib and Dh_Lib.pm: --------------------------------- +Introducing Dh_Lib.pm: +--------------------- -dh_lib/Dh_lib.pm is the library used by all debhelper programs to parse -their arguments and set some useful variables. It's not mandatory that your -program use dh_lib/Dh_lib.pm, but it will make it a lot easier to keep it in -sync with the rest of debhelper if it does, so this is highly encouraged. -There are two versions of this library - dh_lib is a shell library, while -Dh_Lib.pm is a perl module. +Dh_lib.pm is the library used by all debhelper programs to parse their +arguments and set some useful variables. It's not mandatory that your +program use Dh_lib.pm, but it will make it a lot easier to keep it in sync +with the rest of debhelper if it does, so this is highly encouraged. -Typically, you invoke dh_lib like this if your debhelper program is a shell -script: +(There used to be a version of Dh_lib.pm that was a library of functions for +shell scripts. If you want to write a debhelper command that is a shell +script, I can dig up that old library for you. Only the perl one is +supported now, though.) -PATH=debian:$PATH:/usr/lib/debhelper -. dh_lib - -The path statement is there to make your program look first in debian/ for -dh_lib (so users can install a modified version there if necessary), then the -rest of the path, then the canonical location of dh_lib, /usr/lib/debhelper. - -If you are writing a perl program instead, use Dh_lib.pm like this: +Use Dh_lib.pm like this: BEGIN { push @INC, "debian", "/usr/lib/debhelper" } use Dh_Lib; @@ -65,25 +58,19 @@ init(); The BEGIN block is there to make perl look for the module in all the right places. -Notice the init() function in the perl version. dh_lib automatically parses -the command line and does some other initialization tasks. Dh_Lib.pm -requires you to run init() to accomplish the same task. +The init() function in the perl version. This causes Dh_lib to +parse the command line and do some other initialization tasks. Argument processing: ------------------- All debhelper programs should respond to certain arguments, such as -v, -i, --a, and -p. To help you make this work right, dh_lib/Dh_Lib.pm handles -argument processing. - -As soon as dh_lib loads, it processes any arguments that have been passed to -your program. On the other hand, you need to call init() in Dh_Lib.pm before -it will parse arguments. +-a, and -p. To help you make this work right, Dh_Lib.pm handles argument +processing. Just call init(). After argument processing, some global variables are used to hold the -results; program can use them later. If using dh_lib, prefix DH_ to the name -of each of these variables to get the name of the environment variable that -is set. If using Dh_lib.pm, these variables are in the %dh hash. +results; programs can use them later. These variables are elements of the +%dh hash. switch variable description -v VERBOSE should the program verbosely output what it is @@ -99,10 +86,7 @@ switch variable description package's postinst, postrm, etc scripts. -X EXCLUDE exclude a something from processing (you decide what this means for your program) - (In Dh_Lib.pm, this is an array) - EXCLUDE_GREP same as DH_EXCLUDE, except all items are - separated by '|' characters, instead of spaces, - handy for egrep -v (only available to dh_lib) + (This is an array) EXCLUDE_FIND same as DH_EXCLUDE, except all items are put into a string in a way that they will make find find them. (Use ! in front to negate @@ -117,7 +101,7 @@ switch variable description package is being acted on) -u U_PARAMS will be set to a string, that is typically parameters your program passes on to some - other program. (In Dh_Lib.pm, this is an array) + other program. (This is an array) -m M_PARAMS will be set to a string, you decide what it means to your program -V V_FLAG will be set to a string, you decide what it @@ -141,38 +125,32 @@ If you need a new command line option, just ask me, and I will add it. Global variables: ---------------- -If using dh_lib, the following variables are also set as soon as you load -the library: +The following keys are also set in the %dh hash when you call init(): MAINPACKAGE the name of the first binary package listed in debian/control -DH_FIRSTPACKAGE the first package we were instructed to act on. This package +FIRSTPACKAGE the first package we were instructed to act on. This package typically gets special treatment, additional arguments specified on the command line may effect it. -If using Dh_Lib.pm, these are only set after init(), and they are named -$dh{MAINPACKAGE} and $dh{FIRSTPACKAGE}, instead. - Functions: --------- -dh_lib/Dh_Lib.pm also contains a number of functions you may find useful. -Note that the functions calling conventions are slightly different between -the two versions of the library. +Dh_Lib.pm also contains a number of functions you may find useful. doit() - Pass this function a string (dh_lib) or array (Dh_Lib.pm) that is a - shell command. It will run the command (unless DH_NO_ACT is set), and - if DH_VERBOSE is set, it will also output the command to stdout. You + Pass this function an array that is a + shell command. It will run the command (unless $dh{NO_ACT} is set), and + if $dh{VERBOSE} is set, it will also output the command to stdout. You should use this function for almost all commands your program performs that manipulate files in the package build directories. complex_doit() Pass this function a string that is a shell command, it will run it similarly to how doit() does. You can pass more complicated commands - to this (ie, commands involving piping redirection) -verbose_echo() (dh_lib) -verbose_print() (Dh_Lib.pm) - Pass this command a string, and it will echo it if DH_VERBOSE is set. + to this (ie, commands involving piping redirection), however, you + have to worry about things like escaping shell metacharacters. +verbose_print() + Pass this command a string, and it will echo it if $dh{VERBOSE} is set. error() Pass this command a string, it will output it to standard error and exit. @@ -191,20 +169,20 @@ pkgfile() debian/ directory, so there can be one config file per binary package. The convention is that the files are named debian/package.filename, and debian/filename is also allowable for - the MAINPACKAGE. If the file does not exist, nothing is returned. + the $dh{MAINPACKAGE}. If the file does not exist, nothing is returned. pkgext() Pass this command the name of a binary package, and it will return the name to prefix to files in debian/ for this package. For the - MAINPACKAGE, it returns nothing (there is no prefix), for the other + $dh{MAINPACKAGE}, it returns nothing (there is no prefix), for the other packages, it returns "package.". isnative() Pass this command the name of a package, it returns 1 if the package is a native debian package. - As a side effect, VERSION is set to the version number of the + As a side effect, $dh{VERSION} is set to the version number of the package. autoscript() Pass parameters: - - package to be affected (Dh_Lib.pm only) + - binary package to be affected - script to add to - filename of snippet - sed commands to run on the snippet. Ie, s/#PACKAGE#/$PACKAGE/ diff --git a/doc/README b/doc/README index 93b1687c..d8519667 100644 --- a/doc/README +++ b/doc/README @@ -1,7 +1,7 @@ Debhelper is a collection of programs that can be used in debian/rules files to automate common tasks related to building debian binary packages. For further documentation, see the man pages for dh_* commands. For an overview -of debhelper, see the debhelper man page. +of debhelper, see the debhelper(1) man page. To help you get started, I've included examples of debian/rules files that use debhelper commands extensively. See /usr/doc/debhelper/examples/ . diff --git a/doc/TODO b/doc/TODO index ac5c2127..9a103358 100644 --- a/doc/TODO +++ b/doc/TODO @@ -60,8 +60,3 @@ Depricated: on doing this after slink is released or one year after they were depricated, whichever comes first. Be sure to grep whole debian archive for alls to them before removing them, though! - -Long term goals: - -* Convert selected debhelper commands to be perl programs, for speed, ease - of maintainence, and 8-bit cleanness. -- cgit v1.2.3 From 180110c3cce8624deefc4fd8d7bd60ce05e11a4b Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:06:17 +0000 Subject: r153: Initial Import --- Dh_Getopt.pm | 2 ++ debian/changelog | 10 ++++++++++ dh_movefiles | 30 ++++++++++++++++++++---------- doc/PROGRAMMING | 2 ++ 4 files changed, 34 insertions(+), 10 deletions(-) (limited to 'doc/PROGRAMMING') diff --git a/Dh_Getopt.pm b/Dh_Getopt.pm index 42ad7abf..e0b3896d 100644 --- a/Dh_Getopt.pm +++ b/Dh_Getopt.pm @@ -111,6 +111,8 @@ sub parseopts { "no-act" => \$options{NO_ACT}, "init-script=s" => \$options{INIT_SCRIPT}, + + "sourcedir=s" => \$options{SOURCEDIR}, ); if (!$ret) { diff --git a/debian/changelog b/debian/changelog index 5c2d87a6..f0c1a5d7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +debhelper (1.2.17) unstable; urgency=low + + * dh_makeshlibs: relaxed regexp to find library name and number a little so + it will work on libraries with a major but no minor version in their + filename (examples of such: libtcl8.0.so.1, libBLT-unoff.so.1) + * dh_movefiles: added --sourcedir option to make it move files out of + some directory besides debian/tmp (#30221) + + -- Joey Hess Fri, 4 Dec 1998 13:56:57 -0800 + debhelper (1.2.16) unstable; urgency=low * dh_installchangelogs: now detects html changelogs and installs them as diff --git a/dh_movefiles b/dh_movefiles index 9819fd2d..2ed8e376 100755 --- a/dh_movefiles +++ b/dh_movefiles @@ -12,8 +12,18 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { $TMP=tmpdir($PACKAGE); $files=pkgfile($PACKAGE,"files"); - if (! -d "debian/tmp") { - error("debian/tmp does not exist."); + if ($dh{SOURCEDIR}) { + if ($dh{SOURCEDIR}=~m:^/:) { + error("The sourcedir must be a relative filename, not starting with `/'."); + } + $sourcedir=$dh{SOURCEDIR}; + } + else { + $sourcedir="debian/tmp"; + } + + if (! -d $sourcedir) { + error("$sourcedir does not exist."); } @tomove=(); @@ -27,8 +37,8 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { push @tomove, @ARGV; } - if (@tomove && $TMP eq "debian/tmp") { - error("I was asked to move files from debian/tmp to debian/tmp."); + if (@tomove && $TMP eq $sourcedir) { + error("I was asked to move files from $sourcedir to $sourcedir."); } if (@tomove) { @@ -38,7 +48,7 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { # Now we need to expand wildcards in @tomove. @filelist=(); foreach (@tomove) { - push @filelist, glob("debian/tmp/$_"); + push @filelist, glob("$sourcedir/$_"); } # Order the files. First all real files, then symlinks. @@ -48,16 +58,16 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { foreach (@filelist) { $file=$_; $ret=1 if (! -e $file && ! -l $file); - $file=~s:^debian/tmp/+::; - complex_doit("(cd debian/tmp ; find $file ! -type d -and ! -type l -print || true) >> movelist"); + $file=~s:^$sourcedir/+::; + complex_doit("(cd $sourcedir ; find $file ! -type d -and ! -type l -print || true) >> movelist"); } foreach (@filelist) { $file=$_; $ret=1 if (! -e $file && ! -l $file); - $file=~s:^debian/tmp/+::; - complex_doit("(cd debian/tmp ; find $file ! -type d -and -type l -print || true) >> movelist"); + $file=~s:^$sourcedir/+::; + complex_doit("(cd $sourcedir ; find $file ! -type d -and -type l -print || true) >> movelist"); } - complex_doit("(cd debian/tmp;tar --create --remove-files --files-from=../../movelist --file -) | (cd $TMP;tar xpf -)"); + complex_doit("(cd $sourcedir;tar --create --remove-files --files-from=../../movelist --file -) | (cd $TMP;tar xpf -)"); doit("rm","-f","movelist"); } } diff --git a/doc/PROGRAMMING b/doc/PROGRAMMING index da21ea9d..e40f0421 100644 --- a/doc/PROGRAMMING +++ b/doc/PROGRAMMING @@ -116,6 +116,8 @@ switch variable description --init-script INIT_SCRIPT will be set to a string, which specifies an init script name (probably only dh_installinit will ever use this) +--sourcedir SOURCEDIR will be set to a string (probably only + dh_movefiles will ever use this) Any additional command line parameters that do not start with "-" will be ignored, and you can access them later just as you normally would. -- cgit v1.2.3 From 4f78e58b4f803521d56c1b3c7e946128a14b7d6c Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:13:00 +0000 Subject: r198: Initial Import --- Dh_Getopt.pm | 2 ++ debian/changelog | 7 +++++++ dh_builddeb | 7 ++++++- dh_builddeb.1 | 6 +++++- dh_installexamples.1 | 2 +- doc/PROGRAMMING | 2 ++ 6 files changed, 23 insertions(+), 3 deletions(-) (limited to 'doc/PROGRAMMING') diff --git a/Dh_Getopt.pm b/Dh_Getopt.pm index 5f43496b..0c28500d 100644 --- a/Dh_Getopt.pm +++ b/Dh_Getopt.pm @@ -114,6 +114,8 @@ sub parseopts { "init-script=s" => \$options{INIT_SCRIPT}, "sourcedir=s" => \$options{SOURCEDIR}, + + "destdir=s" => \$options{DESTDIR}, ); if (!$ret) { diff --git a/debian/changelog b/debian/changelog index 8208825c..a9c6a0b7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +debhelper (1.2.59) unstable; urgency=low + + * dh_builddeb: added --destdir option, which lets you tell it where + to put the generated .deb's. Default is .. of course. + + -- Joey Hess Thu, 22 Apr 1999 22:02:01 -0700 + debhelper (1.2.58) unstable; urgency=low * autoscripts/postinst-suid: use /#FILE# in elif test (#36297). diff --git a/dh_builddeb b/dh_builddeb index 06cc1beb..9d760b5e 100755 --- a/dh_builddeb +++ b/dh_builddeb @@ -6,7 +6,12 @@ BEGIN { push @INC, "debian", "/usr/lib/debhelper" } use Dh_Lib; init(); +# Set the default destination directory. +if (! defined $dh{DESTDIR}) { + $dh{DESTDIR}='..'; +} + foreach $PACKAGE (@{$dh{DOPACKAGES}}) { $TMP=tmpdir($PACKAGE); - doit("dpkg","--build",$TMP,".."); + doit("dpkg","--build",$TMP,$dh{DESTDIR}); } diff --git a/dh_builddeb.1 b/dh_builddeb.1 index cf492b4c..134cd883 100644 --- a/dh_builddeb.1 +++ b/dh_builddeb.1 @@ -3,7 +3,7 @@ dh_builddeb \- build debian packages .SH SYNOPSIS .B dh_builddeb -.I "[debhelper options]" +.I "[debhelper options] [--destdir=directory]" .SH "DESCRIPTION" dh_builddeb simply calls .BR dpkg (8) @@ -14,6 +14,10 @@ to build a .deb package or packages. See .BR debhelper (1) for a list of options common to all debhelper commands. +.TP +.B --destdir=directory +Use this if you want the generated .deb files to be put in a directory other +than the default of ".." .SH ENVIRONMENT See .BR debhelper (1) diff --git a/dh_installexamples.1 b/dh_installexamples.1 index 61ec0ea0..87ccd1ff 100644 --- a/dh_installexamples.1 +++ b/dh_installexamples.1 @@ -9,7 +9,7 @@ dh_installexamples is a debhelper program that is responsible for installing examples into usr/doc/package/examples in package build directories. .P Any file names specified as parameters will be installed into the first -package dh_installdirs is told to act on. By default, this is the first +package dh_installexamples is told to act on. By default, this is the first binary package in debian/control, but if you use -p, -i, or -a flags, it will be the first package specified by those flags. .P diff --git a/doc/PROGRAMMING b/doc/PROGRAMMING index e40f0421..5a47fc25 100644 --- a/doc/PROGRAMMING +++ b/doc/PROGRAMMING @@ -118,6 +118,8 @@ switch variable description dh_installinit will ever use this) --sourcedir SOURCEDIR will be set to a string (probably only dh_movefiles will ever use this) +--destdir DESTDIR will be set to a string (probably only + dh_builddeb will ever use this) Any additional command line parameters that do not start with "-" will be ignored, and you can access them later just as you normally would. -- cgit v1.2.3 From b5ee70bd5ac3bf45e892612fa0b51e26ff05b688 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:13:28 +0000 Subject: r201: Initial Import --- debian/changelog | 7 +++++++ dh_installemacsen | 17 ++++++++++++++++- dh_installemacsen.1 | 15 ++++++++++++--- doc/PROGRAMMING | 3 +++ 4 files changed, 38 insertions(+), 4 deletions(-) (limited to 'doc/PROGRAMMING') diff --git a/debian/changelog b/debian/changelog index ede72bf3..61ce4b36 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +debhelper (1.2.62) unstable; urgency=low + + * dh_installemacsen: added support for site-start files. Added --flavor + and --number to control details of installation. (#36832) + + -- Joey Hess Sun, 2 May 1999 15:31:58 -0700 + debhelper (1.2.61) unstable; urgency=low * dh_md5sums.1: dh_md5sums is not deprecated, AFAIK, but the manpage has diff --git a/dh_installemacsen b/dh_installemacsen index 79c7dda9..0b2f6b80 100755 --- a/dh_installemacsen +++ b/dh_installemacsen @@ -6,11 +6,19 @@ BEGIN { push @INC, "debian", "/usr/lib/debhelper" } use Dh_Lib; init(); +if (! defined $dh{number}) { + $dh{number}=50; +} +if (! defined $dh{flavor}) { + $dh{flavor}='emacs'; +} + foreach $PACKAGE (@{$dh{DOPACKAGES}}) { $TMP=tmpdir($PACKAGE); $emacsen_install=pkgfile($PACKAGE,"emacsen-install"); $emacsen_remove=pkgfile($PACKAGE,"emacsen-remove"); + $emacsen_init=pkgfile($PACKAGE,"emacsen-init"); if ($emacsen_install ne '') { if (! -d "$TMP/usr/lib/emacsen-common/packages/install") { @@ -25,6 +33,13 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { } doit("install","$emacsen_remove","$TMP/usr/lib/emacsen-common/packages/remove/$PACKAGE"); } + + if ($emacsen_init ne '') { + if (! -d "$TMP/etc/$dh{flavor}/site-start.d/") { + doit("install","-d","$TMP/etc/$dh{flavor}/site-start.d/"); + } + doit("install",$emacsen_init,"$TMP/etc/$dh{flavor}/site-start.d/$dh{number}$PACKAGE.el"); + } if ($emacsen_install ne '' || $emacsen_remove ne '') { if (! $dh{NOSCRIPTS}) { @@ -34,4 +49,4 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { "s/#PACKAGE#/$PACKAGE/"); } } -} +} diff --git a/dh_installemacsen.1 b/dh_installemacsen.1 index 15ec575a..df1512f5 100644 --- a/dh_installemacsen.1 +++ b/dh_installemacsen.1 @@ -3,7 +3,7 @@ dh_installemacsen \- register an emacs add on package .SH SYNOPSIS .B dh_installemacsen -.I "[debhelper options] [-n]" +.I "[debhelper options] [-n] [--number=n] [--flavor=foo]" .SH "DESCRIPTION" dh_installemacsen is a debhelper program that is responsible for installing files used by the debian emacsen-common package into package build directories. @@ -16,10 +16,12 @@ for an explanation of how this works. If a file named debian/package.emacsen-install exists, then it is installed into usr/lib/emacsen-common/packages/install/package in the package build directory. Similarly, debian/package.emacsen-remove is installed into -usr/lib/emacsen-common/packages/remove/package +usr/lib/emacsen-common/packages/remove/package . And similarly, +debian/package.emacsen-startup is installed into +etc/emacs/site-start.d/50.el (by default). .P For the first first binary package listed in the control file, you may use -debian/emacsen-install and debian/emacsen-remove instead. +debian/emacsen-install, debian/emacsen-remove, and debian/emacsen-startup instead. .SH OPTIONS .TP .B debhelper options @@ -29,6 +31,13 @@ for a list of options common to all debhelper commands. .TP .B \-n, \--noscripts Do not modify postinst/prerm scripts. +.TP +.B \--number=n +Sets the priority number of a site-start.d file. Default is 50. +.TP +.B \--flavor=foo +Sets the flavor a site-start.d file will be installed in. Default is +"emacs", alternatives include "xemacs" and "emacs20". .SH ENVIRONMENT See .BR debhelper (1) diff --git a/doc/PROGRAMMING b/doc/PROGRAMMING index 5a47fc25..4f071496 100644 --- a/doc/PROGRAMMING +++ b/doc/PROGRAMMING @@ -120,6 +120,9 @@ switch variable description dh_movefiles will ever use this) --destdir DESTDIR will be set to a string (probably only dh_builddeb will ever use this) +--flavor FLAVOR will be set to a string (probably only + dh_installemacsen will ever use this) +--number NUMBER will be set to a number Any additional command line parameters that do not start with "-" will be ignored, and you can access them later just as you normally would. -- cgit v1.2.3 From 84c6650150baff1dddc4205443995d75e1c0ec08 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:16:26 +0000 Subject: r224: Initial Import --- Dh_Lib.pm | 17 +++++++++++++++-- debhelper.1 | 8 ++++++++ debian/changelog | 10 ++++++++++ doc/PROGRAMMING | 4 ++++ doc/README | 7 +++++++ examples/rules | 3 +++ examples/rules.multi | 3 +++ 7 files changed, 50 insertions(+), 2 deletions(-) (limited to 'doc/PROGRAMMING') diff --git a/Dh_Lib.pm b/Dh_Lib.pm index 25174312..b7f281ba 100644 --- a/Dh_Lib.pm +++ b/Dh_Lib.pm @@ -187,14 +187,27 @@ sub dirname { my $fn=shift; return $fn; } +# Pass in a number, will return true iff the current compatability level +# is equal to that number. +sub compat { + my $num=shift; + + my $c=1; + if (defined $ENV{DH_COMPAT}) { + $c=$ENV{DH_COMPAT}; + } + + return ($c == $num); +} + # Pass it a name of a binary package, it returns the name of the tmp dir to # use, for that package. -# This is for back-compatability with the debian/tmp tradition. sub tmpdir { my $package=shift; if ($dh{TMPDIR}) { return $dh{TMPDIR}; } - elsif ($package eq $dh{MAINPACKAGE}) { + elsif (compat(1) && $package eq $dh{MAINPACKAGE}) { + # This is for back-compatability with the debian/tmp tradition. return "debian/tmp"; } else { diff --git a/debhelper.1 b/debhelper.1 index 1562b2bf..6834594a 100644 --- a/debhelper.1 +++ b/debhelper.1 @@ -120,6 +120,14 @@ Here is the complete list of available debhelper commands. .I DH_VERBOSE Enables verbose mode. .TP +.I DH_COMPAT +Specifies what compatability level debhelper should run at. The default is 1, +which makes debhelper behave in a manner compatable with the 1.x series of +debhelper. If set to 2, debhelper's behavior will change to use the new +features of the 2.x series. Use this with caution, as the 2.x series makes +major changes that will break most packages. For documentation on these +changes, read /usr/doc/debhelper/v2 +.TP .I DH_NO_ACT Enables no-act mode. .TP diff --git a/debian/changelog b/debian/changelog index b4296a04..212c1ee5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +debhelper (1.9.00) unstable; urgency=low + + * This is a release of debhelper in preparation for debhelper v2. + * doc/v2: added, documented status of v2 changes. + * README: mention doc/v2 + * debhelper.1: docuimented DH_COMPAT + * examples/*: added DH_COMAPT=1 to top of rules files + + -- Joey Hess Thu, 1 Jul 1999 13:16:41 -0700 + debhelper (1.2.83) unstable; urgency=medium * dh_perl: fixed substvars typo. Urgency medium since a lot of people will diff --git a/doc/PROGRAMMING b/doc/PROGRAMMING index 4f071496..02b11a21 100644 --- a/doc/PROGRAMMING +++ b/doc/PROGRAMMING @@ -169,6 +169,10 @@ tmpdir() name of the tmp directory that will be used as this package's package build directory. Typically, this will be "debian/tmp" or "debian/package". +compat() + Pass this command a number, and if the current compatability level + equals that number, it will return true. Looks at DH_COMPAT to get + the compatability level. pkgfile() Pass this command the name of a binary package, and the base name of a file, and it will return the actual filename to use. This is used diff --git a/doc/README b/doc/README index 7ba69863..ff43553e 100644 --- a/doc/README +++ b/doc/README @@ -12,6 +12,13 @@ various debhelper scripts in (though other variations are possible). For a more gentle introduction, the maint-guide debian package contains a tutorial about making your first package using Debhelper. +Debhelper v2: +------------ + +Debhelper v2 is a major new version of Debhelper, still under development. +Debhelper will continue to work in v1 compatability mode for now, if you're +interested in trying the new versiln, read the file named "v2". + Starting a new package: ---------------------- diff --git a/examples/rules b/examples/rules index 806092ca..5e805edb 100755 --- a/examples/rules +++ b/examples/rules @@ -4,6 +4,9 @@ # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 +# This is the debhelper compatability version to use. +export DH_COMPAT=1 + build: build-stamp build-stamp: dh_testdir diff --git a/examples/rules.multi b/examples/rules.multi index 433c16fe..7a609e6c 100755 --- a/examples/rules.multi +++ b/examples/rules.multi @@ -7,6 +7,9 @@ # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 +# This is the debhelper compatability version to use. +export DH_COMPAT=1 + build: build-stamp build-stamp: dh_testdir -- cgit v1.2.3 From 6a4c47eea5a5601f351a1fa0afd5e13aed56238b Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 17 Aug 1999 05:18:11 +0000 Subject: r238: Initial Import --- Dh_Lib.pm | 6 +++--- debian/changelog | 6 ++++++ dh_builddeb | 2 +- dh_clean | 2 +- dh_compress | 2 +- dh_debstd | 2 +- dh_du | 2 +- dh_fixperms | 2 +- dh_gencontrol | 2 +- dh_installchangelogs | 2 +- dh_installcron | 2 +- dh_installdeb | 2 +- dh_installdebfiles | 4 ++-- dh_installdirs | 2 +- dh_installdocs | 2 +- dh_installemacsen | 2 +- dh_installexamples | 2 +- dh_installinfo | 2 +- dh_installinit | 2 +- dh_installmanpages | 2 +- dh_installmenu | 2 +- dh_installmime | 2 +- dh_installmodules | 2 +- dh_installpam | 2 +- dh_installwm | 2 +- dh_installxaw | 6 +++--- dh_link | 2 +- dh_listpackages | 2 +- dh_makeshlibs | 2 +- dh_md5sums | 2 +- dh_movefiles | 2 +- dh_perl | 2 +- dh_shlibdeps | 2 +- dh_strip | 2 +- dh_suidregister | 2 +- dh_testdir | 2 +- dh_testroot | 2 +- dh_testversion | 2 +- dh_undocumented | 2 +- doc/PROGRAMMING | 2 +- 40 files changed, 50 insertions(+), 44 deletions(-) (limited to 'doc/PROGRAMMING') diff --git a/Dh_Lib.pm b/Dh_Lib.pm index 73fd44ad..c5146b91 100644 --- a/Dh_Lib.pm +++ b/Dh_Lib.pm @@ -296,11 +296,11 @@ sub autoscript { my $package=shift; my $script=shift; my $filename=shift; my $se $infile="$ENV{DH_AUTOSCRIPTDIR}/$filename"; } else { - if (-e "/usr/lib/debhelper/autoscripts/$filename") { - $infile="/usr/lib/debhelper/autoscripts/$filename"; + if (-e "/usr/share/debhelper/autoscripts/$filename") { + $infile="/usr/share/debhelper/autoscripts/$filename"; } else { - error("/usr/lib/debhelper/autoscripts/$filename does not exist"); + error("/usr/share/debhelper/autoscripts/$filename does not exist"); } } diff --git a/debian/changelog b/debian/changelog index ec5c5058..d8ced366 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +debhelper (2.0.13) unstable; urgency=low + + * dh_fixperms: FHS fixes (#41058) + + -- Joey Hess Fri, 9 Jul 1999 13:07:49 -0700 + debhelper (2.0.12) unstable; urgency=low * dh_installinfo: fixed #SECTION# substitution. diff --git a/dh_builddeb b/dh_builddeb index 9d760b5e..04c3570a 100755 --- a/dh_builddeb +++ b/dh_builddeb @@ -2,7 +2,7 @@ # # Build the .deb package, assuming all the files are set up. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_clean b/dh_clean index a328d12e..e87688de 100755 --- a/dh_clean +++ b/dh_clean @@ -3,7 +3,7 @@ # Clean up $TMP and other tepmorary files generated by the # build process. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_compress b/dh_compress index 73b12ba6..040291fb 100755 --- a/dh_compress +++ b/dh_compress @@ -4,7 +4,7 @@ # compressed files get fixed. use Cwd; -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_debstd b/dh_debstd index 1c2f1f05..89cfc182 100755 --- a/dh_debstd +++ b/dh_debstd @@ -38,7 +38,7 @@ foreach (@ARGV) { } @ARGV=@argv; -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_du b/dh_du index f81b074d..d0358999 100755 --- a/dh_du +++ b/dh_du @@ -5,7 +5,7 @@ # # No longer - it was decided these files are a bad idea. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; warning("this program does nothing and is deprecated. Remove it from debian/rules."); diff --git a/dh_fixperms b/dh_fixperms index f74a269c..ba4e74d6 100755 --- a/dh_fixperms +++ b/dh_fixperms @@ -2,7 +2,7 @@ # # Do some general file permission fixups. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_gencontrol b/dh_gencontrol index cadfdc03..a2d152c4 100755 --- a/dh_gencontrol +++ b/dh_gencontrol @@ -2,7 +2,7 @@ # # Generate and install the control file. Simple dpkg-gencontrol wrapper. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_installchangelogs b/dh_installchangelogs index 4be52020..3ebb04ec 100755 --- a/dh_installchangelogs +++ b/dh_installchangelogs @@ -7,7 +7,7 @@ # if so, the debian changelog is just installed as "changelog", and it is an # error to specify an upstream changelog on the command line. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_installcron b/dh_installcron index 72872668..5b872aca 100755 --- a/dh_installcron +++ b/dh_installcron @@ -2,7 +2,7 @@ # # Install cron scripts into the appropriate places. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_installdeb b/dh_installdeb index f5f3055a..d3eebe76 100755 --- a/dh_installdeb +++ b/dh_installdeb @@ -2,7 +2,7 @@ # # Install files from debian/ into the package's DEBIAN directory. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_installdebfiles b/dh_installdebfiles index cd4562ea..72c17bcc 100755 --- a/dh_installdebfiles +++ b/dh_installdebfiles @@ -3,10 +3,10 @@ # This program is deprecated, but left in the package for backwards # compatability. It simply calls the 3 programs that replaced it. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; -$ENV{PATH}="debian:$ENV{PATH}:/usr/lib/debhelper"; +$ENV{PATH}="debian:$ENV{PATH}:/usr/share/debhelper"; warning("use of this program is deprecated, see man page."); diff --git a/dh_installdirs b/dh_installdirs index 2d12b76b..7d5e49c1 100755 --- a/dh_installdirs +++ b/dh_installdirs @@ -2,7 +2,7 @@ # # Reads debian/dirs, creates the directories listed there -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_installdocs b/dh_installdocs index 54e5b8e7..b82b21c2 100755 --- a/dh_installdocs +++ b/dh_installdocs @@ -4,7 +4,7 @@ # Also installs the debian/copyright and debian/README.debian and debian/TODO # and handles debian/doc-base. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_installemacsen b/dh_installemacsen index 462e3f38..3fbaf8ba 100755 --- a/dh_installemacsen +++ b/dh_installemacsen @@ -2,7 +2,7 @@ # # Registration with emacsen-common. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_installexamples b/dh_installexamples index 88e964ba..e8e5e3d6 100755 --- a/dh_installexamples +++ b/dh_installexamples @@ -3,7 +3,7 @@ # Reads debian/examples, installs all files listed there into # /usr/doc/$PACKAGE/examples -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_installinfo b/dh_installinfo index 20d5e003..8ef2bab3 100755 --- a/dh_installinfo +++ b/dh_installinfo @@ -3,7 +3,7 @@ # Reads debian/info, installs all files listed there into /usr/info # and puts appropriate commands into the postinst. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_installinit b/dh_installinit index 6432c513..c43d24d9 100755 --- a/dh_installinit +++ b/dh_installinit @@ -3,7 +3,7 @@ # Install debian/init[.d], and set up the postinst and postrm for init # scripts. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_installmanpages b/dh_installmanpages index f4dca9a3..6d615a16 100755 --- a/dh_installmanpages +++ b/dh_installmanpages @@ -7,7 +7,7 @@ # This is a little bit (hah!) DWIMish, but still very handy. use File::Find; -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_installmenu b/dh_installmenu index 2db16603..c077f215 100755 --- a/dh_installmenu +++ b/dh_installmenu @@ -8,7 +8,7 @@ # # Also, add to postinst and postrm. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_installmime b/dh_installmime index 232ddc19..7cada574 100755 --- a/dh_installmime +++ b/dh_installmime @@ -1,6 +1,6 @@ #!/usr/bin/perl -w -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_installmodules b/dh_installmodules index 1e111e5a..0ee00dce 100755 --- a/dh_installmodules +++ b/dh_installmodules @@ -2,7 +2,7 @@ # # Register modules with modutils. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_installpam b/dh_installpam index 2262d810..897fd7d8 100755 --- a/dh_installpam +++ b/dh_installpam @@ -4,7 +4,7 @@ # # If debian/pam file exists, save it to $TMP/etc/pam.d/$PACKAGE -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_installwm b/dh_installwm index 0cae9147..21ee6300 100755 --- a/dh_installwm +++ b/dh_installwm @@ -2,7 +2,7 @@ # # Add to postinst and postrm to register a window manager. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_installxaw b/dh_installxaw index 849fbf00..f9980a6e 100755 --- a/dh_installxaw +++ b/dh_installxaw @@ -7,7 +7,7 @@ # # Also, add calls to postinst and postrm. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); @@ -51,8 +51,8 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { close IN; if ($stanza) { - $install_opts.="'$data{program} $data{'link-name'} $data{wrapped}'"; - $remove_opts.="'$data{'link-name'} $data{wrapped}'"; + $install_opts.="'$data{program} $data{'link-name'} $data{wrapped}' "; + $remove_opts.="'$data{'link-name'} $data{wrapped}' "; } autoscript($PACKAGE,"postinst","postinst-xaw", diff --git a/dh_link b/dh_link index 919dc524..1f6299aa 100755 --- a/dh_link +++ b/dh_link @@ -3,7 +3,7 @@ # Generate symlinks in debian packages, reading debian/links. The # file contains pairs of files and symlinks. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_listpackages b/dh_listpackages index 7a764af5..3ce48e06 100755 --- a/dh_listpackages +++ b/dh_listpackages @@ -2,7 +2,7 @@ # # Output a list of all packages debhelper will act on. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); print join("\n",@{$dh{DOPACKAGES}})."\n"; diff --git a/dh_makeshlibs b/dh_makeshlibs index dbf6bfc9..41bf1614 100755 --- a/dh_makeshlibs +++ b/dh_makeshlibs @@ -2,7 +2,7 @@ # # Automatically generate shlibs files. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_md5sums b/dh_md5sums index 8015df79..80b5f479 100755 --- a/dh_md5sums +++ b/dh_md5sums @@ -4,7 +4,7 @@ # package. use Cwd; -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_movefiles b/dh_movefiles index 09159d3b..7978163e 100755 --- a/dh_movefiles +++ b/dh_movefiles @@ -2,7 +2,7 @@ # # Move files out of debian/tmp, into subpackages. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_perl b/dh_perl index 0614b9b8..735711c3 100755 --- a/dh_perl +++ b/dh_perl @@ -3,7 +3,7 @@ # Find dependencies on perl stuff # Remove .packlist files -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_shlibdeps b/dh_shlibdeps index f7ac6012..69047dc0 100755 --- a/dh_shlibdeps +++ b/dh_shlibdeps @@ -2,7 +2,7 @@ # # Find dependancies. Simple dpkg-shlibdeps wrapper. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_strip b/dh_strip index ad5d40a8..9d6ab050 100755 --- a/dh_strip +++ b/dh_strip @@ -3,7 +3,7 @@ # Strip files. use File::Find; -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_suidregister b/dh_suidregister index 15b1fe4d..dd01c2ce 100755 --- a/dh_suidregister +++ b/dh_suidregister @@ -6,7 +6,7 @@ # If there are parameters, or there is a debian/suid, register the files # listed there. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_testdir b/dh_testdir index 0cb95c1d..6d9258db 100755 --- a/dh_testdir +++ b/dh_testdir @@ -4,7 +4,7 @@ # Tests for the existance of debian/control, and for the existance # of any other files you specify on the command line. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_testroot b/dh_testroot index 629b8f84..6ce2a134 100755 --- a/dh_testroot +++ b/dh_testroot @@ -2,7 +2,7 @@ # # Checks to make sure you are root. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/dh_testversion b/dh_testversion index 57c0e588..096aa9e1 100755 --- a/dh_testversion +++ b/dh_testversion @@ -2,7 +2,7 @@ # # Debhelper version check. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; use Dh_Version; # contains the version number of debhelper. init(); diff --git a/dh_undocumented b/dh_undocumented index c4264d6b..77ee3f58 100755 --- a/dh_undocumented +++ b/dh_undocumented @@ -6,7 +6,7 @@ # Also, it looks for debian/undocumented files for more lists of # undocumented man pages. -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); diff --git a/doc/PROGRAMMING b/doc/PROGRAMMING index 02b11a21..891d31b0 100644 --- a/doc/PROGRAMMING +++ b/doc/PROGRAMMING @@ -51,7 +51,7 @@ supported now, though.) Use Dh_lib.pm like this: -BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); -- cgit v1.2.3