From 75a67e84b01e45b3a86b38547699ea6938860e12 Mon Sep 17 00:00:00 2001 From: ljf Date: Tue, 26 Jun 2018 01:59:59 +0200 Subject: [PATCH 1/4] [fix] Patch dnsmasq to read correctly dns-root-data --- debian/changelog | 6 ++++++ debian/dnsmasq.patch | 12 ++++++++++++ debian/postinst | 3 +++ 3 files changed, 21 insertions(+) create mode 100644 debian/dnsmasq.patch diff --git a/debian/changelog b/debian/changelog index 1c03e339e..f5b0a7eba 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +yunohost (2.7.14.3) stable; urgency=low + + * [fix] Patch dnsmasq to read correctly dns-root-data + + -- ljf Tue, 26 Jun 2018 00:49:00 +0000 + yunohost (2.7.14.2) stable; urgency=low * [fix] Indicate YunoHost conflict with a specific version of dns-root-data diff --git a/debian/dnsmasq.patch b/debian/dnsmasq.patch new file mode 100644 index 000000000..dbe5bc125 --- /dev/null +++ b/debian/dnsmasq.patch @@ -0,0 +1,12 @@ +index 46abdc4..49556ad 100644 (file) +--- a/debian/init ++++ b/debian/init +@@ -111,7 +111,7 @@ DNSMASQ_OPTS="$DNSMASQ_OPTS --local-service" + ROOT_DS="/usr/share/dns/root.ds" + + if [ -f $ROOT_DS ]; then +- DNSMASQ_OPTS="$DNSMASQ_OPTS `sed -e s/". IN DS "/--trust-anchor=.,/ -e s/" "/,/g $ROOT_DS | tr '\n' ' '`" ++ DNSMASQ_OPTS="$DNSMASQ_OPTS `sed -e s/"^.*DS[\t ]"/--trust-anchor=.,/ -e s/" "/,/g $ROOT_DS | tr '\n' ' '`" + fi + + start() diff --git a/debian/postinst b/debian/postinst index df7112b9d..d6383eca9 100644 --- a/debian/postinst +++ b/debian/postinst @@ -14,6 +14,9 @@ do_configure() { echo "Regenerating configuration, this might take a while..." yunohost service regen-conf --output-as none + echo "Patch Dnsmasq service" + patch /etc/init.d/dnsmasq dnsmasq.patch + echo "Launching migrations.." yunohost tools migrations migrate --auto From 8c714b44cac34e4612a18a92aa9226c343a8f1c8 Mon Sep 17 00:00:00 2001 From: ljf Date: Tue, 26 Jun 2018 02:05:32 +0200 Subject: [PATCH 2/4] [fix] Remove non working conflicts instruction --- debian/control | 1 - 1 file changed, 1 deletion(-) diff --git a/debian/control b/debian/control index ed44f9c46..17961b83d 100644 --- a/debian/control +++ b/debian/control @@ -40,7 +40,6 @@ Conflicts: iptables-persistent , yunohost-config-dovecot, yunohost-config-slapd , yunohost-config-nginx, yunohost-config-amavis , yunohost-config-mysql, yunohost-predepends - , dns-root-data (>= 2017072601~deb8u2) Replaces: moulinette-yunohost, yunohost-config , yunohost-config-others, yunohost-config-postfix , yunohost-config-dovecot, yunohost-config-slapd From e708599452f4d2bf205641d318f7e719fdc4e51b Mon Sep 17 00:00:00 2001 From: "ljf (zamentur)" Date: Tue, 26 Jun 2018 02:12:50 +0200 Subject: [PATCH 3/4] [fix] Prevent blocking situation if we reapplyed the patch --- debian/postinst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/postinst b/debian/postinst index d6383eca9..589eb6f95 100644 --- a/debian/postinst +++ b/debian/postinst @@ -15,7 +15,7 @@ do_configure() { yunohost service regen-conf --output-as none echo "Patch Dnsmasq service" - patch /etc/init.d/dnsmasq dnsmasq.patch + patch -N /etc/init.d/dnsmasq dnsmasq.patch | true echo "Launching migrations.." yunohost tools migrations migrate --auto From 3ac33552183bd147dafde00e6ef814eac4833200 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Tue, 26 Jun 2018 03:05:38 +0200 Subject: [PATCH 4/4] Include patch directly in postinst to be sure we can access it ... --- debian/dnsmasq.patch | 12 ------------ debian/postinst | 18 +++++++++++++++++- 2 files changed, 17 insertions(+), 13 deletions(-) delete mode 100644 debian/dnsmasq.patch diff --git a/debian/dnsmasq.patch b/debian/dnsmasq.patch deleted file mode 100644 index dbe5bc125..000000000 --- a/debian/dnsmasq.patch +++ /dev/null @@ -1,12 +0,0 @@ -index 46abdc4..49556ad 100644 (file) ---- a/debian/init -+++ b/debian/init -@@ -111,7 +111,7 @@ DNSMASQ_OPTS="$DNSMASQ_OPTS --local-service" - ROOT_DS="/usr/share/dns/root.ds" - - if [ -f $ROOT_DS ]; then -- DNSMASQ_OPTS="$DNSMASQ_OPTS `sed -e s/". IN DS "/--trust-anchor=.,/ -e s/" "/,/g $ROOT_DS | tr '\n' ' '`" -+ DNSMASQ_OPTS="$DNSMASQ_OPTS `sed -e s/"^.*DS[\t ]"/--trust-anchor=.,/ -e s/" "/,/g $ROOT_DS | tr '\n' ' '`" - fi - - start() diff --git a/debian/postinst b/debian/postinst index 589eb6f95..cd67059bf 100644 --- a/debian/postinst +++ b/debian/postinst @@ -15,7 +15,23 @@ do_configure() { yunohost service regen-conf --output-as none echo "Patch Dnsmasq service" - patch -N /etc/init.d/dnsmasq dnsmasq.patch | true + DNSMASQ_PATCH=$(cat << 'EOF' +index 46abdc4..49556ad 100644 (file) +--- a/debian/init ++++ b/debian/init +@@ -111,7 +111,7 @@ DNSMASQ_OPTS="$DNSMASQ_OPTS --local-service" + ROOT_DS="/usr/share/dns/root.ds" + + if [ -f $ROOT_DS ]; then +- DNSMASQ_OPTS="$DNSMASQ_OPTS `sed -e s/". IN DS "/--trust-anchor=.,/ -e s/" "/,/g $ROOT_DS | tr '\n' ' '`" ++ DNSMASQ_OPTS="$DNSMASQ_OPTS `sed -e s/"^.*DS[\t ]"/--trust-anchor=.,/ -e s/" "/,/g $ROOT_DS | tr '\n' ' '`" + fi + + start() +EOF +) + + patch -N /etc/init.d/dnsmasq <<< "$DNSMASQ_PATCH" | true echo "Launching migrations.." yunohost tools migrations migrate --auto