Bug#811708: [PKG-OpenRC-Debian] Bug#811708: pong on update-rc.d

2016-02-22 Thread Svante Signell
On Mon, 2016-02-22 at 14:56 +0900, Benda Xu wrote:
> Hi Svante,
> 
> Svante Signell  writes:
> 
> > openrc 0.18.3-1 is marked for autoremoval from testing on 2016-02-26,
> > so there seems to more time left to fix #811708, than the previous date
> > given
> > 2016-02-18.
> 
> It turns out https://packages.qa.debian.org/o/openrc.html was lying.
> OpenRC has already been removed from testing.
> 
> Maintainers of init-system-helpers gave me no ack to update their
> package.  I think we should take the divert approach first and update a
> new version of OpenRC ASAP.

Attached is an updated debdiff patch. Please modify the changelog accordingly.
This would be a temporary solution to the bug. Please push the init-system-
helpers maintainers to consider your patch. Adam/Benda, can/will you make an NMU
of init-system-helpers if they don't want to cooperate?

Thanks!diff -Nru openrc-0.18.3/debian/changelog openrc-0.18.3/debian/changelog
--- openrc-0.18.3/debian/changelog	2015-11-09 15:11:35.0 +0100
+++ openrc-0.18.3/debian/changelog	2016-02-11 17:22:14.0 +0100
@@ -1,3 +1,14 @@
+openrc (0.18.3-2) unstable; urgency=medium
+  * Update debian/openrc.postrm script to divert
+update-rc.d + invoke-rc.d files to cooperate with
+init-system-helpers >=1.25
+  * Create debian/openrc.preinst script to divert
+update-rc.d + invoke-rc.d files to cooperate with
+init-system-helpers >=1.25
+(Closes: #811708)
+
+ -- Svante Signell   Tue, 09 Feb 2016 16:53:58 +0100
+
 openrc (0.18.3-1) unstable; urgency=medium
 
   [ Dmitry Yu Okunev ]
diff -Nru openrc-0.18.3/debian/openrc.postrm openrc-0.18.3/debian/openrc.postrm
--- openrc-0.18.3/debian/openrc.postrm	2015-11-09 15:11:35.0 +0100
+++ openrc-0.18.3/debian/openrc.postrm	2016-02-22 10:30:11.0 +0100
@@ -1,11 +1,73 @@
 #!/bin/sh
+# postrm script for openrc
 
 set -e
 
-if [ "${1}" = "purge" ] ; then
+# summary of how this script can be called:
+#*  `remove'
+#*  `purge'
+#*  `upgrade' 
+#*  `failed-upgrade' 
+#*  `abort-install'
+#*  `abort-install' 
+#*  `abort-upgrade' 
+#*  `disappear' overwrit>r> 
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+# see #811708, #805487
+undivert() {
+  dpkg-divert --package openrc --remove --rename \
+--divert /usr/sbin/update-rc.d.init-system-helpers /usr/sbin/update-rc.d
+
+  dpkg-divert --package openrc --remove --rename \
+--divert /usr/sbin/invoke-rc.d.init-system-helpers /usr/sbin/invoke-rc.d
+
+  dpkg-divert --package openrc --remove --rename \
+--divert /usr/share/man/man8/update-rc.d.8.gz.init-system-helpers /usr/share/man/man8/update-rc.d.8.gz
+
+  dpkg-divert --package openrc --remove --rename \
+--divert /usr/share/man/man8/invoke-rc.d.8.gz.init-system-helpers /usr/share/man/man8/invoke-rc.d.8.gz
+}
+
+case "$1" in
+upgrade|failed-upgrade)
+;;
+
+abort-upgrade)
+  if dpkg --compare-versions "$2" lt 0.18.3-2 ; then
+undivert
+  fi
+;;
+
+abort-install|disappear)
+undivert
+;;
+
+remove)
+undivert
+
+	if [ ! -e /usr/sbin/update-rc.d ] ; then
+		ln -sf /usr/share/sysvinit/update-rc.d /usr/sbin/update-rc.d
+	fi
+	if [ ! -e /usr/sbin/invoke-rc.d ] ; then
+		ln -sf /usr/share/sysvinit/update-rc.d /usr/sbin/invoke-rc.d
+	fi
+;;
+
+purge)
 	rm -rf /lib/rc /etc/runlevels
 	rm -f /etc/init.d/transit
-fi
+;;
+
+*)
+echo "postrm called with unknown argument \`$1'" >&2
+exit 1
+;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
 
 #DEBHELPER#
 
diff -Nru openrc-0.18.3/debian/openrc.preinst openrc-0.18.3/debian/openrc.preinst
--- openrc-0.18.3/debian/openrc.preinst	1970-01-01 01:00:00.0 +0100
+++ openrc-0.18.3/debian/openrc.preinst	2016-02-11 17:19:48.0 +0100
@@ -0,0 +1,58 @@
+#! /bin/sh
+# preinst script for openrc
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+#*  `install'
+#*  `install' 
+#*  `upgrade' 
+#*  `abort-upgrade' 
+#
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+# see #811708, #805487
+divert() {
+
+  dpkg-divert --package openrc --add --rename \
+  --divert /usr/sbin/update-rc.d.init-system-helpers /usr/sbin/update-rc.d
+
+  dpkg-divert --package openrc --add --rename \
+  --divert /usr/sbin/invoke-rc.d.init-system-helpers /usr/sbin/invoke-rc.d
+
+  dpkg-divert --package openrc --add --rename \
+  --divert /usr/share/man/man8/update-rc.d.8.gz.init-system-helpers /usr/share/man/man8/update-rc.d.8.gz
+
+  dpkg-divert --package openrc --add --rename \
+  --divert /usr/share/man/man8/invoke-rc.d.8.gz.init-system-helpers /usr/share/man/man8/invoke-rc.d.8.gz
+}
+
+case "$1" in
+

Bug#811708: [PKG-OpenRC-Debian] Bug#811708: pong on update-rc.d

2016-02-16 Thread Svante Signell
Hi Benda,
Cc: Adam

On Fri, 2016-02-12 at 00:47 +0900, Benda Xu wrote:
> Hey guys,
> 
> Thanks for the report.  update-rc.d in OpenRC is a hack based on that
> from sysv-rc.  I think the right way forward is to extend
> init-system-helpers to support OpenRC.
> 
> I will try to figure it out.  If I couldn't make it in time, Svante's
> patch will be upload to close this bug.

How are things progressing? Today's message says:
openrc 0.18.3-1 is marked for autoremoval from testing on 2016-02-26,
so there seems to more time left to fix #811708, than the previous date given
2016-02-18.



Bug#811708: pong on update-rc.d

2016-02-11 Thread Adam Borowski
On Fri, Feb 12, 2016 at 12:47:09AM +0900, Benda Xu wrote:
> Thanks for the report.  update-rc.d in OpenRC is a hack based on that
> from sysv-rc.  I think the right way forward is to extend
> init-system-helpers to support OpenRC.

Great, that answers the question about which way to fix the bug.  This
wasn't a decision that should be done in a NMU without your input.

> I will try to figure it out.  If I couldn't make it in time, Svante's
> patch will be upload to close this bug.

The patch would require some fixing.  Note that the two versions do differ:
the first one overwritten existing postrm.  The second one still does some
stuff specific to file-rc.

But as you decided to go the other way, this matters only if we'd need to
use it as a fallback.

-- 
A tit a day keeps the vet away.



Bug#811708: pong on update-rc.d

2016-02-11 Thread Benda Xu
Hey guys,

Thanks for the report.  update-rc.d in OpenRC is a hack based on that
from sysv-rc.  I think the right way forward is to extend
init-system-helpers to support OpenRC.

I will try to figure it out.  If I couldn't make it in time, Svante's
patch will be upload to close this bug.

Cheers,
Benda



Bug#811708: [Fwd: Re: [PKG-OpenRC-Debian] Bug#811708: pong on update-rc.d]

2016-02-11 Thread Svante Signell
--- Begin Message ---
On Fri, 2016-02-12 at 00:47 +0900, Benda Xu wrote:
> Hey guys,
> 
> Thanks for the report.  update-rc.d in OpenRC is a hack based on that
> from sysv-rc.  I think the right way forward is to extend
> init-system-helpers to support OpenRC.
> 
> I will try to figure it out.  If I couldn't make it in time, Svante's
> patch will be upload to close this bug.

Hello,

I took a look at the diff between openrc's and init-system-helper's invoke-rc.d
and update-rc.d scripts. They don't seem to differ to much to make them merge-
able.

However, in case i divert is needed, attached is a debdiff of openrc-0.18.3-1
and openrc-0.18.3-2.

Maybe even the following ar not needed from the purge) target of openrc.postrm
+   rm -f /var/backups/rc-links.tar.gz \
+   /etc/runlevel.conf /etc/runlevel.fallback

+   echo Please purge /var/backups/rc.* manually.
diff -Nru openrc-0.18.3/debian/changelog openrc-0.18.3/debian/changelog
--- openrc-0.18.3/debian/changelog	2015-11-09 15:11:35.0 +0100
+++ openrc-0.18.3/debian/changelog	2016-02-11 17:22:14.0 +0100
@@ -1,3 +1,14 @@
+openrc (0.18.3-2) unstable; urgency=medium
+  * Update debian/openrc.postrm script to divert
+update-rc.d + invoke-rc.d files to cooperate with
+init-system-helpers >=1.25
+  * Create debian/openrc.preinst script to divert
+update-rc.d + invoke-rc.d files to cooperate with
+init-system-helpers >=1.25
+(Closes: #811708)
+
+ -- Svante Signell   Tue, 09 Feb 2016 16:53:58 +0100
+
 openrc (0.18.3-1) unstable; urgency=medium
 
   [ Dmitry Yu Okunev ]
diff -Nru openrc-0.18.3/debian/openrc.postrm openrc-0.18.3/debian/openrc.postrm
--- openrc-0.18.3/debian/openrc.postrm	2015-11-09 15:11:35.0 +0100
+++ openrc-0.18.3/debian/openrc.postrm	2016-02-11 17:19:38.0 +0100
@@ -1,11 +1,76 @@
 #!/bin/sh
+# postrm script for openrc
 
 set -e
 
-if [ "${1}" = "purge" ] ; then
+# summary of how this script can be called:
+#*  `remove'
+#*  `purge'
+#*  `upgrade' 
+#*  `failed-upgrade' 
+#*  `abort-install'
+#*  `abort-install' 
+#*  `abort-upgrade' 
+#*  `disappear' overwrit>r> 
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+# see #811708, #805487
+undivert() {
+  dpkg-divert --package openrc --remove --rename \
+--divert /usr/sbin/update-rc.d.init-system-helpers /usr/sbin/update-rc.d
+
+  dpkg-divert --package openrc --remove --rename \
+--divert /usr/sbin/invoke-rc.d.init-system-helpers /usr/sbin/invoke-rc.d
+
+  dpkg-divert --package openrc --remove --rename \
+--divert /usr/share/man/man8/update-rc.d.8.gz.init-system-helpers /usr/share/man/man8/update-rc.d.8.gz
+
+  dpkg-divert --package openrc --remove --rename \
+--divert /usr/share/man/man8/invoke-rc.d.8.gz.init-system-helpers /usr/share/man/man8/invoke-rc.d.8.gz
+}
+
+case "$1" in
+upgrade|failed-upgrade)
+;;
+
+abort-upgrade)
+  if dpkg --compare-versions "$2" lt 0.18.3-2 ; then
+undivert
+  fi
+;;
+
+abort-install|disappear)
+undivert
+;;
+
+remove)
+undivert
+
+	if [ ! -e /usr/sbin/update-rc.d ] ; then
+		ln -sf /usr/share/sysvinit/update-rc.d /usr/sbin/update-rc.d
+	fi
+	if [ ! -e /usr/sbin/invoke-rc.d ] ; then
+		ln -sf /usr/share/sysvinit/update-rc.d /usr/sbin/invoke-rc.d
+	fi
+;;
+
+purge)
+	rm -f /var/backups/rc-links.tar.gz \
+	/etc/runlevel.conf /etc/runlevel.fallback
 	rm -rf /lib/rc /etc/runlevels
 	rm -f /etc/init.d/transit
-fi
+	echo Please purge /var/backups/rc.* manually.
+;;
+
+*)
+echo "postrm called with unknown argument \`$1'" >&2
+exit 1
+;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
 
 #DEBHELPER#
 
diff -Nru openrc-0.18.3/debian/openrc.preinst openrc-0.18.3/debian/openrc.preinst
--- openrc-0.18.3/debian/openrc.preinst	1970-01-01 01:00:00.0 +0100
+++ openrc-0.18.3/debian/openrc.preinst	2016-02-11 17:19:48.0 +0100
@@ -0,0 +1,58 @@
+#! /bin/sh
+# preinst script for openrc
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+#*  `install'
+#*  `install' 
+#*  `upgrade' 
+#*  `abort-upgrade' 
+#
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+# see #811708, #805487
+divert() {
+
+  dpkg-divert --package openrc --add --rename \
+  --divert /usr/sbin/update-rc.d.init-system-helpers /usr/sbin/update-rc.d
+
+  dpkg-divert --package openrc --add --rename \
+  --divert /usr/sbin/invoke-rc.d.init-system-helpers /usr/sbin/invoke-rc.d
+
+  dpkg-divert --package openrc --add --rename \
+  --divert /usr/share/man/man8/update-rc.d.8.gz.init-system-helpers /usr/share/man/man8/update-rc.d.8.gz
+
+  dpkg-divert --package openrc --add --rename \
+