]> git.donarmstrong.com Git - debhelper.git/commitdiff
r86: Initial Import
authorjoey <joey>
Tue, 17 Aug 1999 04:51:17 +0000 (04:51 +0000)
committerjoey <joey>
Tue, 17 Aug 1999 04:51:17 +0000 (04:51 +0000)
12 files changed:
PROGRAMMING
README
TODO
debian/changelog
debian/rules
dh_compress
dh_fixperms
dh_installdebfiles
dh_installinit
dh_lib
dh_movefiles
dh_testroot

index a6078c1ab1796731463d6a0bda837e27bd139ed0..7dc0c638e944e85cfb42e7099fbd827bea12963f 100644 (file)
@@ -143,6 +143,9 @@ verbose_echo()
 error()
        Pass this command a string, it will output it to standard error and
        exit.
+warning()
+       Pass this command a string, and it will output it to standard error
+       as a warning message.
 tmpdir()
        Pass this command the name of a binary package, it will return the
        name of the tmp directory that will be used as this package's
diff --git a/README b/README
index f821e8c0ff200c1461d81d7feaf449e80dc3c6f4..986eb02cb1955f3c77d6128386bd1668756347da 100644 (file)
--- a/README
+++ b/README
@@ -18,57 +18,7 @@ process.
 Converting from debstd to debhelper:
 -----------------------------------
 
-Debhelper is designed to be mostly backwards compatible to debstd. I say
-mostly because I haven't made debhelper handle everything that debstd does
-yet, and in a few cases, it does things differently (and I hope, better).
-
-In general, you can switch over to using debhelper as follows. In your
-debian/rules, where you used to have some lines that read something like:
-
-       debstd CHANGES TODO README
-       dpkg-gencontrol
-       dpkg --build debian/tmp ..
-
-Remove that and replace it with something like:
-
-       dh_installdocs TODO README
-       dh_installexamples
-       dh_installmenu
-       dh_installcron
-       dh_installmanpages
-       dh_installchangelogs CHANGES
-       dh_movefiles
-       dh_strip
-       dh_compress
-       dh_fixperms
-       dh_suidregister
-       dh_installdeb
-       dh_shlibdeps
-       dh_gencontrol
-       dh_makeshlibs
-       dh_md5sums
-       dh_builddeb
-
-Notice that the parameters sent to debstd get split up among the dh_*
-programs. The upstream changelog is passed to dh_installchangelogs, and the
-docs are passed to dh_installdocs.
-
-Debstd has many switches, that turn off different parts of it. So if you 
-were using debstd -m to tell it not to automatically install manpages,
-for example, you can just comment out the dh_installmanpages line.
-
-Finally, debstd automatically modified postinst, postrm, etc scripts. Some
-of the debhelper apps do that too, but they do it differently. Debstd just
-appends its commands to the end of the script. Debhelper requires that you
-insert a tag into your scripts, that will tell debhelper where to insert
-commands. So if you have postinst, postrm, etc scripts, add a line reading
-"#DEBHELPER#" to the end of them.
-
-Once you think it's all set up properly, do a test build of your package. If 
-it works ok, I recommend that you compare the new package and the old 
-debstd-generated package very closely. Pay special attention to the postinst, 
-postrm, etc scripts.
-
+See the file "from-debstd" for documentation on how to do this.
 
 Automatic generation of debian install scripts:
 ----------------------------------------------
@@ -116,7 +66,6 @@ affecting all packages.
 
 See examples/rules.multi for an example of how to use this.
 
-
 Package build directories -- debian/tmp, etc:
 --------------------------------------------
 
diff --git a/TODO b/TODO
index 542e9887a04d4eb14b9796762859ea22bca6fe6a..188e3c6c7bb9a0b4f502018c7e9058d049f8b678 100644 (file)
--- a/TODO
+++ b/TODO
@@ -3,12 +3,11 @@
     debmake (wishlist bug #17043). I just never saw the point of that file..
   - Make dh_movefiles remove emptied directories after it's moved all the
     files out of them (wishlist bug #17111).
-* dh_fixperms: allow listing of files not to be touched (difficult).
-* add a dh_debstd, which mimics debstd, but uses debhelper tools internally.
-  Note that the idea here is not just another debstd. This program will have
-  a -v switch, that lists all the other debhelper commands it needs to run to
-  do what debstd had to do. The intent is to make it easy to switch from
-  debstd to debhelper.
+* something should add ldconfig calls properly to the postinst of packages
+  that contain shared libraries. maybe dh_makeshlibs? But it wasn't designed
+  to do that originally, and even worse, it is often run after
+  dh_installdeb, so the fragements wouldn't go into the postinst. So maybe a
+  new script is called for.
 * info support for debhelper (currently implemented, but I hate how I did it,
   so it's not in the package.) (wishlist bug #15717)
 * enhance dh_installmanpages so it associates binaries and man pages and
index 9d007f0fb5006ab4cfdbdfc40c13a3db5cd7c1d8..0b443a168286b873bf86138f405e7b73940bd403 100644 (file)
@@ -1,3 +1,15 @@
+debhelper (0.88) unstable; urgency=low
+
+  * I had many hours on a train to hack on debhelper... enjoy!
+  * dh_compress: always pass -f to gzip, to force compression.
+  * dh_compress: added -X switch, to make it easy to specify files to
+    exclude, without all the bother of a debian/compress script. You can
+    use -X multiple times, too.
+  * PROGRAMMING, dh_getopt.pl: DH_EXCLUDE is now a variable set by the
+    --exclude (-X) switch. -x now sets DH_INCLUDE_CONFFILES.
+
+ -- Joey Hess <joeyh@master.debian.org>  Sun, 17 May 1998 11:26:09 -0700
+
 debhelper (0.87) unstable; urgency=low
 
   * dh_strip: strip .comment and .note, not comment and note, when stripping
index c1009b7f063ca6563c6dd7e4c7be2179bec8603c..44c77e076818b515a70d65187f92441dffc767e0 100755 (executable)
@@ -47,7 +47,7 @@ binary-indep: build
        cp -a dh_lib dh_getopt.pl debian/tmp/usr/lib/debhelper
        cp -a autoscripts debian/tmp/usr/lib/debhelper
 
-       ./dh_installdocs TODO README PROGRAMMING
+       ./dh_installdocs TODO README PROGRAMMING from-debstd
        ./dh_installexamples examples/*
        ./dh_installmenu
        ./dh_installmanpages
index 1d30c65d5dabbd9c141bba3e489aaf06e8509f31..d24a561aec7b7a97c15e704995743908c673c57f 100755 (executable)
@@ -16,10 +16,10 @@ filelist () {
                sh $olddir/$compress 2>/dev/null
        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
+               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
+                       ! -name "copyright" 2>/dev/null || true
        fi
 }
 
@@ -39,7 +39,9 @@ for PACKAGE in $DH_DOPACKAGES; do
        # Run the file name gathering commands from within the directory
        # structure that will be effected.
        olddir=`pwd`
-       doit "cd $TMP"
+       # Can't use doit here, that breaks --no-act mode.
+       verbose_echo "cd $TMP"
+       cd "$TMP"
 
        # Get the list of files to compress.
        if [ "$DH_EXCLUDE_GREP" ]; then
@@ -56,7 +58,8 @@ for PACKAGE in $DH_DOPACKAGES; do
        fi
 
        # Change back to old pwd.
-       doit "cd $olddir"
+       verbose_echo "cd $olddir"
+       cd "$olddir"
 
        # Fix up symlinks that were pointing to the uncompressed files.
        for file in `find $TMP -type l`; do
index d34ffd232fde67e40cc50ac840214b92f9709333..b30332a1e507483cae394410b95a5033aa4060f3 100755 (executable)
@@ -5,35 +5,62 @@
 PATH=debian:$PATH:/usr/lib/debhelper
 . dh_lib
 
+# Pass this a list of files, one per line, it will return the list, with 
+# any files that need to be excluded removed.
+filelist_excluded () {
+       IFS="
+"
+       if [ "$DH_EXCLUDE_GREP" ]; then
+               # Use grep -F so we don't have to worry about regexp's.
+               echo -n "$*" | grep -v -F \
+                       "`echo "$DH_EXCLUDE_GREP" | tr "|" "\n"`"
+       else
+               echo -n "$*"
+       fi
+       unset IFS
+}
+
 for PACKAGE in $DH_DOPACKAGES; do
        TMP=`tmpdir $PACKAGE`
 
-       # General things..
-       if [ -d $TMP ]; then
-               doit "chown -R root.root $TMP"
-               doit "chmod -R go=rX $TMP"
-               doit "chmod -R u+rw $TMP"
+       # General permissions fixing.
+       if [ ! "$DH_EXCLUDE_GREP" ]; then
+               # 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
+       else
+               # Do it the hard way.
+               files=`filelist_excluded \`find $TMP 2>/dev/null\` | tr "\n" " "`
+               if [ "$files" ]; then
+                       doit "chown root.root $files"
+                       doit "chmod go=rX $files"
+                       doit "chmod u+rw $files"
+               fi
        fi
 
        # Fix up premissions in usr/doc, setting everything to not exectable
        # by default, but leave examples directories alone.
-       files=`find $TMP/usr/doc -type f 2>/dev/null | grep -v /examples/ | tr "\n" " "` || true
+       files=`filelist_excluded \`find $TMP/usr/doc -type f 2>/dev/null | grep -v /examples/\` | tr "\n" " "`
        if [ "$files" ]; then
                doit "chmod 644 $files"
        fi
-       files=`find $TMP/usr/doc -type d 2>/dev/null | tr "\n" " "` || true
+       files=`filelist_excluded \`find $TMP/usr/doc -type d 2>/dev/null\` | tr "\n" " "`
        if [ "$files" ]; then
                doit "chmod 755 $files"
        fi
 
        # Executable man pages are a bad thing..
-       files=`find $TMP/usr/man/ $TMP/usr/X11*/man/ -type f 2>/dev/null | tr "\n" " "` || true
+       files=`filelist_excluded \`find $TMP/usr/man/ $TMP/usr/X11*/man/ -type f 2>/dev/null\` | tr "\n" " "`
        if [ "$files" ]; then
                doit "chmod 644 $files"
        fi
 
        # ..and so are executable shared libraries (and .la files from libtool)
-       files=`find $TMP -perm -5 -type f \( -name "*.so*" -or -name "*.la" \) | tr "\n" " "` || true
+       files=`filelist_excluded \`find $TMP -perm -5 -type f \( -name "*.so*" -or -name "*.la" \)\` | tr "\n" " "`
        if [ "$files" ]; then
                doit "chmod a-X $files"
        fi
index 6afdf54886996011c28895ff43748dbefc961e86..0fba35a5473b22fa70b24b727f49d1dfada7bee1 100755 (executable)
@@ -5,7 +5,7 @@
 
 PATH=debian:$PATH:/usr/lib/debhelper
 
-echo "* Note: dh_installdebfiles is deprecated." >&2
+warn "Note: use of this program is deprecated."
 
 dh_installdeb $*
 dh_shlibdeps $*
index 66ebfc574182017ae153f9e5e54d8761d27bd91b..21526e2bbd6dab3dbb3309eb7ec94f50d502894b 100755 (executable)
@@ -10,6 +10,12 @@ for PACKAGE in $DH_DOPACKAGES; do
        TMP=`tmpdir $PACKAGE`
        init=`pkgfile $PACKAGE init`
 
+       # This is for backwards compatability with debstd, which used either
+       # name.
+       if [ ! "$init" ]; then
+               init=`pkgfile $PACKAGE init.d`
+       fi
+
        if [ "$init" ]; then
                if [ ! -d $TMP/etc/init.d ]; then
                        doit "install -d $TMP/etc/init.d"
diff --git a/dh_lib b/dh_lib
index 38f6734c7121e8bfe5d233d944f011e2fb36b111..9e826499db052a65d562a3ec07c6a71b8f415044 100644 (file)
--- a/dh_lib
+++ b/dh_lib
@@ -37,6 +37,11 @@ error() {
        exit 1
 }
 
+# Output a warning.
+warning() {
+       echo `basename $0`": $1" >&2
+}
+
 # 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.
index ab7dcd013e8fddf202ff3f991e3309049ed8d8e3..964d4068dff27a5d842a04f8eaf4500de15fe237 100755 (executable)
@@ -29,7 +29,7 @@ for PACKAGE in $DH_DOPACKAGES; do
                # 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
+               # (The echo is in here to expand wildcards. Note that 'ls'
                # won't work properly.)
                tomove=""
                for i in `(cd debian/tmp ; echo \`cat $files\`)`; do
index 36577b29e019441190a182978ce166cc90a5e203..c704109411d54ffb16c11d1ee9a91fb6ad78ca19 100755 (executable)
@@ -5,6 +5,8 @@
 PATH=debian:$PATH:/usr/lib/debhelper
 . dh_lib
 
-if  [ "`whoami`" != root ]; then
+# Test for uid = 0, not username of root, becuase
+# some people rename root.
+if  [ "`id -u`" != 0 ]; then
        error "You must run this as root."
 fi