Control: tags 936992 + patch Control: tags 936992 + pending Dear maintainer,
I've prepared an NMU for maradns (versioned as 2.0.13-1.3) and uploaded it to DELAYED/15. Please feel free to tell me if I should cancel it. cu Adrian
diff -Nru maradns-2.0.13/debian/changelog maradns-2.0.13/debian/changelog --- maradns-2.0.13/debian/changelog 2016-08-09 22:39:43.000000000 +0300 +++ maradns-2.0.13/debian/changelog 2019-12-24 07:48:25.000000000 +0200 @@ -1,3 +1,11 @@ +maradns (2.0.13-1.3) unstable; urgency=medium + + * Non-maintainer upload. + * Add upstream fixes to make bind2csv2.py compatible with Python 3, + thanks to Sam Trenholme. (Closes: #936992) + + -- Adrian Bunk <[email protected]> Tue, 24 Dec 2019 07:48:25 +0200 + maradns (2.0.13-1.2) unstable; urgency=medium * Non-maintainer upload. diff -Nru maradns-2.0.13/debian/control maradns-2.0.13/debian/control --- maradns-2.0.13/debian/control 2015-10-03 10:37:13.000000000 +0300 +++ maradns-2.0.13/debian/control 2019-12-24 07:48:25.000000000 +0200 @@ -4,7 +4,7 @@ Maintainer: Dariusz Dwornikowski <[email protected]> Build-Depends: debhelper (>= 9), - python-dev (>= 2.6.6-3~) + python3-dev Standards-Version: 3.9.6 Homepage: http://maradns.org Vcs-Git: git://anonscm.debian.org/collab-maint/maradns.git @@ -17,10 +17,10 @@ duende (>= 1.4.12), lsb-base, ${misc:Depends}, - ${shlibs:Depends} + ${shlibs:Depends}, + ${python3:Depends} Recommends: - maradns-zoneserver, - ${python:Depends} + maradns-zoneserver Suggests: maradns-deadwood Description: simple security-focused authoritative Domain Name Service server diff -Nru maradns-2.0.13/debian/patches/bind2csv2-py3.patch maradns-2.0.13/debian/patches/bind2csv2-py3.patch --- maradns-2.0.13/debian/patches/bind2csv2-py3.patch 1970-01-01 02:00:00.000000000 +0200 +++ maradns-2.0.13/debian/patches/bind2csv2-py3.patch 2019-12-24 07:48:25.000000000 +0200 @@ -0,0 +1,437 @@ +Description: Upstream fixes to make bind2csv2.py compatible with Python 3 +Author: Adrian Bunk <[email protected]> +Bug-Debian: https://bugs.debian.org/936992 + +--- maradns-2.0.13.orig/tools/bind2csv2.py ++++ maradns-2.0.13/tools/bind2csv2.py +@@ -1,6 +1,8 @@ + #!/usr/bin/python + +-# Copyright (c) 2006-2007 Sam Trenholme ++# Note: As of 2019, this script will run both in python2 and python3 ++ ++# Copyright (c) 2006-2007,2019 Sam Trenholme + # + # TERMS + # +@@ -173,7 +175,7 @@ class buf: + elif self.l == "/origin": + return "preorigin" + else: +- print "Unknown directive " + self.l ++ print("Unknown directive " + self.l) + return "error" + + # Add a current RR to a stream (private method) +@@ -282,7 +284,7 @@ def process_comment(i,o): + z = 0 + op(o,"#") + while z < 1000: +- a = i.read(1) ++ a = i.read(1).decode('utf-8') + if is_newline.match(a): + return a + else: +@@ -294,7 +296,7 @@ def process_comment(i,o): + # in next + + def get_rr_type(rrname): +- rrname = string.lower(rrname) ++ rrname = rrname.lower() + if rrname == "in": + return "error" + elif rrname == "a": +@@ -357,7 +359,7 @@ def get_rr_type(rrname): + #return "rr_loc" # Complicated RR with variable # of fields + return "rr_variargs" # I'll just let the csv2 code parse this + else: +- print "Error: Unknown RR " + rrname ++ print("Error: Unknown RR " + rrname) + return "error" + + # Generic handler that handles parenthesis in a zone file +@@ -366,10 +368,10 @@ def handle_paren(a,o,state,buffer): + if is_pstate.search(state): + paren = "_paren" + if paren == "" and is_newline.match(a): +- print "Error: Premature termination of RR" ++ print("Error: Premature termination of RR") + return ("error", "", 1, paren) + if paren == "_paren" and a == "(": +- print "Error: Parens don't nest" ++ print("Error: Parens don't nest") + retrun ("error", "", 1, paren) + if paren == "" and a == "(": + op(o," ") +@@ -413,7 +415,7 @@ def postrr(a,o,state,buffer): + (state, buffer, paren, pstr) = handle_paren(a,o,state,buffer) + if paren == 1: + return (state, buffer) +- print "Error: Unexpected character after RR " + a ++ print("Error: Unexpected character after RR " + a) + return("error","") + + # After the first non-escaped newline at the end of a rr in the +@@ -433,7 +435,7 @@ def pre_rr(a,o,state,buffer): + o.label_reset() + o.label_add(a) + return("dlabel",buffer) +- print "Error: Unexpected character before RR " + a ++ print("Error: Unexpected character before RR " + a) + return("error","") + + # In the whitespace before a default TTL ("/ttl 12345") +@@ -445,7 +447,7 @@ def prettl(a,o,state,buffer): + op(o,a) + o.slash_ttl_set(a) + return ("sttl", buffer) +- print "Error: unexpected character before TTL " + a ++ print("Error: unexpected character before TTL " + a) + return("error","") + + # In a default TTL ("/ttl 12345") +@@ -457,7 +459,7 @@ def sttl(a,o,state,buffer): + op(o,a) + o.slash_ttl_append(a) + return ("sttl", buffer) +- print "Error: unexpected character in TTL " + a ++ print("Error: unexpected character in TTL " + a) + return("error","") + + # In the whitespace before an origin ("/origin foo") +@@ -469,7 +471,7 @@ def preorigin(a,o,state,buffer): + op(o,a) + o.origin_set(a) + return ("origin", buffer) +- print "Error: unexpected character before origin " + a ++ print("Error: unexpected character before origin " + a) + return("error","") + + # In an origin ("/origin foo") +@@ -481,7 +483,7 @@ def origin(a,o,state,buffer): + op(o,a) + o.origin_append(a) + return ("origin", buffer) +- print "Error: unexpected character in origin " + a ++ print("Error: unexpected character in origin " + a) + return("error","") + + # After a space at the beginning of an RR and before a newline +@@ -517,7 +519,7 @@ def ttl(a,o,state,buffer): + op(o,a) + o.normal_ttl_append(a) + return ("ttl" + pstr,buffer) +- print "Unexpected character in TTL " + a ++ print("Unexpected character in TTL " + a) + return("error","") + + # Various handlers for the rr types that we may see +@@ -535,7 +537,7 @@ def rr_a(a,o,state,buffer): + if is_numdot.match(a): + op(o,a) + return (state,buffer) +- print "Error: Unexpected character in A RR " + a ++ print("Error: Unexpected character in A RR " + a) + return("error","") + + # AAAA: Ipv6 Internet IP address +@@ -551,7 +553,7 @@ def rr_aaaa(a,o,state,buffer): + if is_hexcolon.match(a): + op(o,a) + return (state,buffer) +- print "Error: Unexpected character in A RR " + a ++ print("Error: Unexpected character in A RR " + a) + return("error","") + + # Generic handler for NS records or anything else that has a single dlabel +@@ -573,7 +575,7 @@ def rr_1dlabel(a,o,state,buffer): + if a == ".": + op(o,a) + return ("rr_1dlabel_dot" + pstr, buffer) +- print "Error: Unexpected character in RR " + a ++ print("Error: Unexpected character in RR " + a) + return("error","") + + # In the dot (".") of a dlabel +@@ -590,7 +592,7 @@ def rr_1dlabel_dot(a,o,state,buffer): + if is_dlabel.match(a): + op(o,a) + return ("rr_1dlabel" + pstr,buffer) +- print "Error: Unexpected character in RR " + a ++ print("Error: Unexpected character in RR " + a) + return("error","") + + # Generic handlers for dlabels and numbers +@@ -608,7 +610,7 @@ def rr_generic_dlabel_dot(a,o,state,buff + if pstr == "_paren": + return(state[:-10] + pstr, buffer) + return (state[:-4], buffer) +- print "Error: unexpected character in RR dlabel dot " + a ++ print("Error: unexpected character in RR dlabel dot " + a) + return("error","") + + # In the whitespace before a dlabel +@@ -622,7 +624,7 @@ def rr_generic_dlabel_pre(a,o,state,buff + if is_dlabel.match(a): + op(o,a) + return (next + pstr, buffer) +- print "Error: unexpected character before RR dlabel " + a ++ print("Error: unexpected character before RR dlabel " + a) + return("error","") + + # In a dlabel +@@ -641,7 +643,7 @@ def rr_generic_dlabel(a,o,state,buffer,n + if pstr == "_paren": + return(state[:-10] + "_dot" + pstr, buffer) + return (state + "_dot", buffer) +- print "Error: unexpected character in RR dlabel " + a ++ print("Error: unexpected character in RR dlabel " + a) + return("error","") + + # In the whitespace before a number +@@ -655,7 +657,7 @@ def rr_generic_number_pre(a,o,state,buff + if is_number.match(a): + op(o,a) + return (next + pstr, buffer) +- print "Error: unexpected character before RR number field " + a ++ print("Error: unexpected character before RR number field " + a) + return("error","") + + # In a number +@@ -669,7 +671,7 @@ def rr_generic_number(a,o,state,buffer,n + if is_number.match(a): + op(o,a) + return (state, buffer) +- print "Error: unexpected character in numer field of RR " + a ++ print("Error: unexpected character in numer field of RR " + a) + return("error","") + + # In the whitespace before the SOA minimum field +@@ -684,7 +686,7 @@ def rr_soa_minimum_pre(a,o,state,buffer, + op(o,a) + o.minttl_set(a) + return (next + pstr, buffer) +- print "Error: unexpected character before RR number field " + a ++ print("Error: unexpected character before RR number field " + a) + return("error","") + + # In SOA minimum field +@@ -699,7 +701,7 @@ def rr_soa_minimum(a,o,state,buffer,next + op(o,a) + o.minttl_append(a) + return (state, buffer) +- print "Error: unexpected character in numer field of RR " + a ++ print("Error: unexpected character in numer field of RR " + a) + return("error","") + + # SOA: Start of authority record (2 dlabels, 5 numbers) +@@ -810,7 +812,7 @@ def rr_txt(a,o,state,buffer): + return(state, buffer) + if a == "\"": + return("rr_txt_4" + pstr,buffer) +- print "Error: unexpected character ouside of quotes in TXT RR " + a ++ print("Error: unexpected character ouside of quotes in TXT RR " + a) + return("error","") + + # rr_txt_2: In TXT record between quotes +@@ -822,7 +824,7 @@ def rr_txt_2(a,o,state,buffer): + if(len(a) == 1): + q = unpack("B",a)[0]; + else: +- print "Error: Unexpected char length in TXT RR " + a ++ print("Error: Unexpected char length in TXT RR " + a) + return("error","") + # If q is printable ASCII and q isn't ["#'|~\] + if q >= 32 and q <= 125 and q != 34 and q != 35 \ +@@ -848,7 +850,7 @@ def rr_txt_3(a,o,state,buffer): + if(len(a) == 1): + q = unpack("B",a)[0]; + else: +- print "Error: Unexpected char length in TXT RR " + a ++ print("Error: Unexpected char length in TXT RR " + a) + return("error","") + # If q is printable ASCII and q isn't ["#'|~] + if q >= 32 and q <= 125 and q != 34 and q != 35 \ +@@ -877,7 +879,7 @@ def rr_txt_4(a,o,state,buffer): + if(len(a) == 1): + q = unpack("B",a)[0]; + else: +- print "Error: Unexpected char length in TXT RR " + a ++ print("Error: Unexpected char length in TXT RR " + a) + return("error","") + # If q is printable ASCII and q isn't ["#'|~\] + if q >= 32 and q <= 125 and q != 34 and q != 35 \ +@@ -895,7 +897,7 @@ def rr_txt_4(a,o,state,buffer): + else: + op(o,"\\x%02x" % q) + return("rr_txt_3" + pstr,buffer) +- print "Unexpected error in rr_txt_4" ++ print("Unexpected error in rr_txt_4") + return("error","") + + # rr_txt_backslash: Right after a backslash in a TXT record +@@ -910,7 +912,7 @@ def rr_txt_backslash(a,o,state,buffer): + if(len(a) == 1): + q = unpack("B",a)[0]; + else: +- print "Error: Unexpected char length in TXT RR " + a ++ print("Error: Unexpected char length in TXT RR " + a) + return("error","") + # If q is printable ASCII and q isn't [#'|~] + if q >= 32 and q <= 125 and q != 35 \ +@@ -933,13 +935,13 @@ def rr_txt_numeric(a,o,state,buffer): + if int(x) < 256: + op(o,"\'\\x%02x\'" % int(x)) + else: +- print "Error: Value of backslashed number " + x + " too high" ++ print("Error: Value of backslashed number " + x + " too high") + return("error","") + # Otherwise + if(len(a) == 1): + q = unpack("B",a)[0]; + else: +- print "Error: Unexpected char length in TXT RR " + a ++ print("Error: Unexpected char length in TXT RR " + a) + return("error","") + # If q is printable ASCII and q isn't [#'|~\] + if q >= 32 and q <= 125 and q != 35 and q != 34 \ +@@ -965,14 +967,14 @@ def rrtype(a,o,state,buffer): + # In the case of "IN", we go back to the state of being + # after the dlabel, where we look for either a TTL or a + # RRTYPE +- if string.lower(buffer) != "in": ++ if buffer.lower() != "in": + op(o,buffer) + else: + op(o,a) + return("pdlabel" + pstr, "") + op(o,a) + return ("prrtype" + pstr, buffer) +- print "Invalid character in RR type " + a ++ print("Invalid character in RR type " + a) + return ("error","") + + # After dlabel (name of record we have info for) and before TTL/rrtype +@@ -990,7 +992,7 @@ def pdlabel(a,o,state,buffer): + return ("ttl" + pstr,buffer) + if is_letter.match(a): + return ("rrtype" + pstr,a) +- print "Unexpected character after dlabel " + a ++ print("Unexpected character after dlabel " + a) + return("error","") + + # In a "." character in the dlabel (name of machine we have record for) +@@ -1002,19 +1004,19 @@ def dlabel_dot(a,o,state,buffer): + op(o,a) + return ("pdlabel",buffer) + else: +- print "Unexpected chatacter near dlabel " + a ++ print("Unexpected chatacter near dlabel " + a) + return ("error","") + + # In DCommand (a "slash" command like "/ttl" or "/origin") + def dcommand(a,o,state,buffer): + if is_letter.match(a): +- o.label_add(string.lower(a)) ++ o.label_add(a.lower()) + return ("dcommand",buffer) + elif is_space.match(a): + op(o,a) + return (o.dcommand_process(),buffer) + else: +- print "Unexpected chatacter in slash command " + a ++ print("Unexpected chatacter in slash command " + a) + return ("error","") + + # In the dlabel (name of machine we are looking at record for) +@@ -1030,7 +1032,7 @@ def dlabel_s(a,o,state,buffer): + o.label_add(a) + return ("dlabel_dot",buffer) + else: +- print "Unexpected character in dlabel " + a ++ print("Unexpected character in dlabel " + a) + return ("error","") + + # Initial state at beginning of file +@@ -1047,7 +1049,7 @@ def init_s(a,o,state,buffer): + o.label_add(a) + return("dlabel",buffer) + else: +- print "Error: Unexpected character at new file start " + a ++ print("Error: Unexpected character at new file start " + a) + return("error","") + + # END machine states +@@ -1192,20 +1194,20 @@ def process_char(a,o,state,buffer): + # BIND zone files at the same time + def process_file(filename): + if os.access(filename,os.R_OK) != 1: +- print "Can not read " + filename ++ print("Can not read " + filename) + return ERROR + + outf = filename + ".csv2" + + if os.path.isfile(outf) == 1: +- print "Warning: " + outf + " already exists, overwriting" ++ print("Warning: " + outf + " already exists, overwriting") + + if os.path.isdir(filename) == 1: +- print "Error: " + outf + " is a directory, skipping" ++ print("Error: " + outf + " is a directory, skipping") + return ERROR + +- i = file(filename,"rb") +- o = file(outf,"wb") ++ i = open(filename,"rb") ++ o = open(outf,"w") + oz = buf() + + state = "init_state" +@@ -1214,7 +1216,7 @@ def process_file(filename): + x = 0 + linenum = 1 + while x < 100000: +- a = i.read(1) ++ a = i.read(1).decode('utf-8') + if a == "": + break + if a == ";": +@@ -1223,9 +1225,9 @@ def process_file(filename): + linenum += 1 + (state, buffer) = process_char(a,oz,state,buffer) + if state == "error" or state == "error_paren": +- print "Error found, no longer processing this file" +- print "Error is on line " + str(linenum) , +- print "of file " + filename ++ print("Error found, no longer processing this file") ++ print("Error is on line " + str(linenum) + ++ " of file " + filename) + return ERROR + x += 1 + +@@ -1238,19 +1240,19 @@ def process_file(filename): + oz.flush_rr() # Make sure to flush out the last RR we read + o.write(oz.read()) + +- print outf + " written" ++ print(outf + " written") + + + # MAIN + + if len(sys.argv) < 3 or sys.argv[1] != "-c": +- print "Usage: bind2csv2.py -c {file list}" +- print "Where {file list} is a list of files you want to make", +- print "csv2 zone files of." ++ print("Usage: bind2csv2.py -c {file list}") ++ print("Where {file list} is a list of files you want to make " + ++ "csv2 zone files of.") + sys.exit() + + list = sys.argv[2:] + for item in list: +- print "Processing zone file " + item ++ print("Processing zone file " + item) + process_file(item) + diff -Nru maradns-2.0.13/debian/patches/bind2csv2-use-py3.patch maradns-2.0.13/debian/patches/bind2csv2-use-py3.patch --- maradns-2.0.13/debian/patches/bind2csv2-use-py3.patch 1970-01-01 02:00:00.000000000 +0200 +++ maradns-2.0.13/debian/patches/bind2csv2-use-py3.patch 2019-12-24 07:48:25.000000000 +0200 @@ -0,0 +1,12 @@ +Description: bind2csv2.py: Use Python 3 +Author: Adrian Bunk <[email protected]> +Bug-Debian: https://bugs.debian.org/936992 + +--- maradns-2.0.13.orig/tools/bind2csv2.py ++++ maradns-2.0.13/tools/bind2csv2.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/python ++#!/usr/bin/python3 + + # Note: As of 2019, this script will run both in python2 and python3 + diff -Nru maradns-2.0.13/debian/patches/series maradns-2.0.13/debian/patches/series --- maradns-2.0.13/debian/patches/series 2015-10-03 10:37:13.000000000 +0300 +++ maradns-2.0.13/debian/patches/series 2019-12-24 07:48:25.000000000 +0200 @@ -13,3 +13,5 @@ hurd.patch randprime_prng.patch maradns_user_config.patch +bind2csv2-py3.patch +bind2csv2-use-py3.patch diff -Nru maradns-2.0.13/debian/rules maradns-2.0.13/debian/rules --- maradns-2.0.13/debian/rules 2016-08-09 22:39:40.000000000 +0300 +++ maradns-2.0.13/debian/rules 2019-12-24 07:48:25.000000000 +0200 @@ -16,7 +16,7 @@ INSTALLDOCS_ARGS:="-XMakefile -X00index.html -Xmake.index -Xjs-manpages -Xvim.cheatsheet" %: - dh $@ --with python2 + dh $@ --with python3 override_dh_auto_configure: @echo "System: ${UNAME}"

