Bug#932087: knot-host: Add to update-alternatives

2021-04-30 Thread Jakub Ružička
Hello,

thanks for handling the bind9 side of things!

I'm happy to update the knot source package with update-alternatives
functionality as soon as it's implemented in bind9 package which is a
necessary prerequisite to avoid package file conflicts if I understand
correctly.


Cheers,
Jakub

On Wed, 28 Apr 2021 00:15:39 +0200 Daniel Baumann wrote:
> tag 932087 patch
> thanks
>
> Hi,
>
> I've attached patches that we're using in our Debian derrivate for this.
> I've also send the required patches to a bugreport against src:bind9
> (will add a "block by" to this bug after having recieved the bugnumber).
>
> Regards,
> Daniel
>



OpenPGP_signature
Description: OpenPGP digital signature


Bug#932087: knot-host: Add to update-alternatives

2021-04-27 Thread Daniel Baumann
tag 932087 patch
thanks

Hi,

I've attached patches that we're using in our Debian derrivate for this.
I've also send the required patches to a bugreport against src:bind9
(will add a "block by" to this bug after having recieved the bugnumber).

Regards,
Daniel

>From 89bc67e87478cd3256431a28396fe04d2279c403 Mon Sep 17 00:00:00 2001
From: Daniel Baumann 
Date: Tue, 27 Apr 2021 23:44:42 +0200
Subject: [PATCH 05/15] Adding update-alternatives to use kdig for
 /usr/bin/dig.

Signed-off-by: Daniel Baumann 
---
 debian/knot-dnsutils.postinst | 25 +
 debian/knot-dnsutils.prerm| 23 +++
 2 files changed, 48 insertions(+)
 create mode 100644 debian/knot-dnsutils.postinst
 create mode 100644 debian/knot-dnsutils.prerm

diff --git a/debian/knot-dnsutils.postinst b/debian/knot-dnsutils.postinst
new file mode 100644
index 000..f31f650
--- /dev/null
+++ b/debian/knot-dnsutils.postinst
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+set -e
+
+case "${1}" in
+	configure)
+		# update-alternatives: dig
+		update-alternatives --quiet \
+			--install /usr/bin/dig dig /usr/bin/kdig 20 \
+			--slave /usr/share/man/man1/dig.1.gz dig.1.gz /usr/share/man/man1/kdig.1.gz
+		;;
+
+	abort-upgrade|abort-remove|abort-deconfigure)
+
+		;;
+
+	*)
+		echo "postinst called with unknown argument \`${1}'" >&2
+		exit 1
+		;;
+esac
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/knot-dnsutils.prerm b/debian/knot-dnsutils.prerm
new file mode 100644
index 000..178b8a1
--- /dev/null
+++ b/debian/knot-dnsutils.prerm
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+set -e
+
+case "${1}" in
+	remove|upgrade|deconfigure)
+		# update-alternatives: dig
+		update-alternatives --quiet --remove dig /usr/bin/kdig
+		;;
+
+	failed-upgrade)
+
+		;;
+
+	*)
+		echo "prerm called with unknown argument \`${1}'" >&2
+		exit 1
+		;;
+esac
+
+#DEBHELPER#
+
+exit 0
-- 
2.30.2

>From 37ed9c5f94bd81dc72a90f6a08f877adfe9f4da9 Mon Sep 17 00:00:00 2001
From: Daniel Baumann 
Date: Tue, 27 Apr 2021 23:44:44 +0200
Subject: [PATCH 06/15] Adding update-alternatives to use khost for
 /usr/bin/host (Closes: #932087).

Signed-off-by: Daniel Baumann 
---
 debian/knot-host.postinst | 25 +
 debian/knot-host.prerm| 23 +++
 2 files changed, 48 insertions(+)
 create mode 100644 debian/knot-host.postinst
 create mode 100644 debian/knot-host.prerm

diff --git a/debian/knot-host.postinst b/debian/knot-host.postinst
new file mode 100644
index 000..7bc0ee9
--- /dev/null
+++ b/debian/knot-host.postinst
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+set -e
+
+case "${1}" in
+	configure)
+		# update-alternatives: host
+		update-alternatives --quiet \
+			--install /usr/bin/host host /usr/bin/khost 20 \
+			--slave /usr/share/man/man1/host.1.gz host.1.gz /usr/share/man/man1/khost.1.gz
+		;;
+
+	abort-upgrade|abort-remove|abort-deconfigure)
+
+		;;
+
+	*)
+		echo "postinst called with unknown argument \`${1}'" >&2
+		exit 1
+		;;
+esac
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/knot-host.prerm b/debian/knot-host.prerm
new file mode 100644
index 000..d2e70f3
--- /dev/null
+++ b/debian/knot-host.prerm
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+set -e
+
+case "${1}" in
+	remove|upgrade|deconfigure)
+		# update-alternatives: host
+		update-alternatives --quiet --remove host /usr/bin/khost
+		;;
+
+	failed-upgrade)
+
+		;;
+
+	*)
+		echo "prerm called with unknown argument \`${1}'" >&2
+		exit 1
+		;;
+esac
+
+#DEBHELPER#
+
+exit 0
-- 
2.30.2



Bug#932087: knot-host: Add to update-alternatives

2019-07-14 Thread Puck Mousit
Package: knot-host
Version: 2.7.6-2
Severity: normal

I am on Buster 10.0.

The knot-host package provides the 'host' command, or at least so
says the package's own description. However, bug #741645 for
knot-dnsutils (which was also applied to knot-host) was submitted
a couple years ago about conflicts with the 'host', 'dig' and 'nsupdate'
commands that are provided by the dnsutils and bind9-host packages.

That bug concluded with removing the conflicting commands from
the knot packages with the mention that update-alternatives seems
the better option, which I agree is a reasonable solution.  Problem
is the knot-host and knot-dnsutils packages never actually had any
update-alternatives configuration added to them.  They therefore no
longer provide the 'host', 'dig', or 'nsupdate' commands that their
package descriptions claim they do, at least not under those
specific command names.

I'm using these packages to provide those commands.  The change
didn't impact me until Debian Buster (Stretch's version didn't have
this change applied), so once I upgraded dists I noticed, otherwise
I would've commented on the earlier bug report and change
considerably sooner.

Basically, the knot-host and knot-dnsutils packages should provide
update-alternatives functionality, and that is the purpose of this bug
report, which should be applied to both packages.  Through this
method they would provide the 'host', 'dig' and 'nsupdate' commands
they previously did.  Yes I can set that up manually, but I shouldn't
have to.  These packages should have the alternatives functionality
included.

Thank you.