]> git.donarmstrong.com Git - debhelper.git/blobdiff - dh_suidregister
r108: Initial Import
[debhelper.git] / dh_suidregister
index 4ca72a1cf0ab97491720ec8bad1c048cc3fa7936..bc8aa5f26a92294991f088cb293d8427f459aadd 100755 (executable)
@@ -11,26 +11,27 @@ PATH=debian:$PATH:/usr/lib/debhelper
 
 for PACKAGE in $DH_DOPACKAGES; do
        TMP=`tmpdir $PACKAGE`
-       EXT=`pkgext $PACKAGE`
+       suid=`pkgfile $PACKAGE suid`
 
        files=""
 
-       if [ -e debian/${EXT}suid ]; then
-               files=`tr "\n" " " < debian/${EXT}suid`
+       if [ "$suid" ]; then
+               files=`tr "\n" " " < $suid`
        fi
 
-       if [ "$PACKAGE" = "$MAINPACKAGE" -a "$*" ]; then
+       if [ \( "$PACKAGE" = "$DH_FIRSTPACKAGE" -o "$DH_PARAMS_ALL" \) \
+            -a "$*" ]; then
                files="$* $files"
        fi
 
-       if [ ! "$files" -a ! -e debian/${EXT}suid ]; then
+       if [ ! "$files" -a ! "$suid" ]; then
                # No files specified (and no empty debian/suid file), so
                # guess what files to process.
-               files=`find debian/$TMP -type f -perm +6000`
+               files=`find $TMP -type f -perm +6000`
 
                # We will strip the debian working directory off of the
                # filenames.
-               tostrip="debian/$TMP/"
+               tostrip="$TMP/"
        else
                # We will strip leading /'s, so the user can feed this
                # program either absolute filenames, or relative filenames,
@@ -49,7 +50,7 @@ for PACKAGE in $DH_DOPACKAGES; do
                        # 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 debian/$TMP/$file -printf "s:#FILE#:$file:;s/#PACKAGE#/$PACKAGE/;s/#OWNER#/%u/;s/#GROUP#/%g/;s/#PERMS#/%m/"`
+                       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"