From: bert hubert Date: Thu, 24 Apr 2014 07:34:53 +0000 (+0200) Subject: I think this will finally give us working zone2sql merge X-Git-Tag: rec-3.6.0-rc1~42 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a5a1f447c1cfd1a44c9fe3e8d1dbd3f60bf61381;p=thirdparty%2Fpdns.git I think this will finally give us working zone2sql merge --- diff --git a/pdns/Makefile.am b/pdns/Makefile.am index 5acc3b6f29..0bf2fd040c 100644 --- a/pdns/Makefile.am +++ b/pdns/Makefile.am @@ -113,7 +113,7 @@ zone2sql_SOURCES=bindparser.yy bindlexer.l bind-dnssec.schema.sqlite3.sql.h \ zoneparser-tng.cc dnsrecords.cc sillyrecords.cc \ dnswriter.cc dnslabeltext.cc rcpgenerator.cc dnsparser.cc base64.cc \ nsecrecords.cc dnssecinfra.cc base32.cc bindparserclasses.hh \ - dns_random.cc + dns_random.cc json.cc json.hh zone2sql_LDFLAGS=@THREADFLAGS@ zone2sql_LDADD= $(POLARSSL_LIBS) diff --git a/pdns/zone2sql.cc b/pdns/zone2sql.cc index 3b50ecaec1..02cd8e07fa 100644 --- a/pdns/zone2sql.cc +++ b/pdns/zone2sql.cc @@ -28,7 +28,7 @@ #include #include #include "namespaces.hh" - +#include "json.hh" #include "dns.hh" #include "arguments.hh" #include "bindparserclasses.hh" @@ -141,11 +141,7 @@ static void emitDomain(const string& domain, const vector *masters = 0) } } } -<<<<<<< HEAD -static void emitRecord(const string& zoneName, const string &qname, const string &qtype, const string &ocontent, int ttl, int prio) -{ -======= bool g_doJSONComments; static void emitRecord(const string& zoneName, const string &qname, const string &qtype, const string &ocontent, int ttl, int prio, const string& comment="") { @@ -164,7 +160,7 @@ static void emitRecord(const string& zoneName, const string &qname, const string recordcomment=stringFromJson(document, "comment", ""); } } ->>>>>>> jsonzone2sql + g_numRecords++; string content(ocontent); @@ -423,10 +419,6 @@ try DNSResourceRecord rr; startNewTransaction(); emitDomain(zonename); -<<<<<<< HEAD - while(zpt.get(rr)) - emitRecord(zonename, rr.qname, rr.qtype.getName(), rr.content, rr.ttl, rr.priority); -======= string comment; bool seenSOA=false; while(zpt.get(rr, &comment)) { @@ -437,7 +429,6 @@ try emitRecord(zonename, rr.qname, rr.qtype.getName(), rr.content, rr.ttl, rr.priority, comment); } ->>>>>>> jsonzone2sql num_domainsdone=1; } cerr<clear(); + if(comment && d_line.find(';') != string::npos) + *comment = d_line.substr(d_line.find(';')); parts_t parts; vstringtok(parts, d_line); @@ -314,8 +317,9 @@ bool ZoneParserTNG::get(DNSResourceRecord& rr) if(nextpart.empty()) break; - if(nextpart.find(';')!=string::npos) + if(nextpart.find(';')!=string::npos) { break; + } // cout<<"Next part: '"<