Control: tags 767933 + patch

Dear maintainer,

the patch below fixes the build failure by checking for existence
of /etc/inittab before grepping.

Regards,
Simon

diff -u daemontools-0.76/debian/daemontools-run.postinst 
daemontools-0.76/debian/daemontools-run.postinst
--- daemontools-0.76/debian/daemontools-run.postinst
+++ daemontools-0.76/debian/daemontools-run.postinst
@@ -17,7 +17,7 @@
       break
     done
   # upgrade from unofficial daemontools-run
-  if grep -q '#-- daemontools-run begin' /etc/inittab; then
+  if test -f /etc/inittab && grep -q '#-- daemontools-run begin' /etc/inittab; 
then
     echo 'Removing SV inittab entry...'
     rm -f /etc/inittab'{new}'
     sed -e '/#-- daemontools-run begin/,/#-- daemontools-run end/d' \
@@ -27,7 +27,7 @@
     sleep 1
   fi
   # update from daemontools-installer
-  if grep -q 'SV:123456:respawn:/command/svscanboot' /etc/inittab; then
+  if test -f /etc/inittab && grep -q 'SV:123456:respawn:/command/svscanboot' 
/etc/inittab; then
     echo 'Removing SV inittab entry...'
     rm -f /etc/inittab'{new}'
     sed -e '/SV:123456:respawn:\/command\/svscanboot/d' \
@@ -37,7 +37,7 @@
     sleep 1
   fi
   # update from daemontools-installer (fhs version)
-  if grep -q 'SV:123456:respawn:/usr/bin/svscanboot' /etc/inittab; then
+  if test -f /etc/inittab && grep -q 'SV:123456:respawn:/usr/bin/svscanboot' 
/etc/inittab; then
     echo 'Removing SV inittab entry...'
     rm -f /etc/inittab'{new}'
     sed -e '/SV:123456:respawn:\/usr\/bin\/svscanboot/d' \
@@ -49,7 +49,7 @@
 fi
 if test -z "$2"; then
   # not upgrading
-  if grep '^SV:' /etc/inittab >/dev/null; then
+  if test -f /etc/inittab && grep '^SV:' /etc/inittab >/dev/null; then
     cat <<-\EOT >&2
        
        There already is an SV entry in /etc/inittab.  In order to have this
@@ -63,7 +63,7 @@
     exit 1
   fi
 fi
-if ! grep '^SV:' /etc/inittab >/dev/null; then
+if test -f /etc/inittab && ! grep '^SV:' /etc/inittab >/dev/null; then
   echo 'Adding SV inittab entry...'
   cp /etc/inittab /etc/inittab'{new}'
   cat >>/etc/inittab'{new}' <<-\EOT
diff -u daemontools-0.76/debian/daemontools-run.postrm 
daemontools-0.76/debian/daemontools-run.postrm
--- daemontools-0.76/debian/daemontools-run.postrm
+++ daemontools-0.76/debian/daemontools-run.postrm
@@ -3,7 +3,7 @@
 
 test "$1" = 'remove' || exit 0
 
-if grep -q "#-- daemontools-run begin" /etc/inittab; then
+if test -f /etc/inittab && grep -q "#-- daemontools-run begin" /etc/inittab; 
then
   echo 'Removing SV inittab entry...'
   rm -f /etc/inittab'{new}'
   sed -e '/#-- daemontools-run begin/,/#-- daemontools-run end/d' \


-- 
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to