X-Git-Url: https://git.distorted.org.uk/~mdw/zones/blobdiff_plain/3a772cfb9bb9d53599a47de39714ddcddcdbbe1a..40832d8058e6f13747cb8abac5f64263827bde8a:/Makefile diff --git a/Makefile b/Makefile index 882b08d..f6a075f 100644 --- a/Makefile +++ b/Makefile @@ -63,21 +63,22 @@ ZONESETS += distorted distorted_VIEWS = inside outside distorted_outside_NETS = dmz jump -distorted_inside_NETS = any unsafe colo vpn +distorted_inside_NETS = any unsafe colo vpn upn distorted_all_ZONES += distorted.org.uk -distorted_all_ZONES += 144-159.204.49.62.in-addr.arpa +distorted_all_ZONES += 195.113.2.81.in-addr.arpa +distorted_all_ZONES += 128-143.238.187.81.in-addr.arpa distorted_all_ZONES += 64-79.198.13.212.in-addr.arpa distorted_all_ZONES += 199.29.172.in-addr.arpa -distorted_all_ZONES += 8.9.b.1.9.0.f.1.0.7.4.0.1.0.0.2.ip6.arpa -distorted_all_ZONES += 0.4.7.9.0.7.4.0.1.0.0.2.ip6.arpa - distorted_all_ZONES += 9.d.1.0.0.0.0.0.8.a.b.0.1.0.0.2.ip6.arpa +distorted_all_ZONES += 2.9.c.0.0.b.8.0.1.0.0.2.ip6.arpa distorted_all_ZONES += 9.d.1.0.8.a.b.0.1.0.0.2.ip6.arpa +distorted_outside_NSDIFF = -sradius.dmz.distorted.org.uk + ###-------------------------------------------------------------------------- ### Other zones. @@ -131,6 +132,12 @@ $(foreach s,$(ZONESETS), \ $(foreach z,$($s_all_ZONES) $($s_$v_ZONES), \ $(eval $v/$z.zone: $v/$s.zonestamp)))) +## Prepare a mapping from zone names back to their owning zonesets. +$(foreach s,$(ZONESETS), \ + $(foreach z,$(sort $(foreach v,$($s_VIEWS), \ + $($s_all_ZONES) $($s_$v_ZONES))), \ + $(eval $z_ZONESET = $s))) + ## Now we have to check the individual zone files. ALL_ZONECHECKS = $(foreach s,$(ZONESETS), \ $(foreach v,$($s_VIEWS), \ @@ -143,6 +150,21 @@ $(ALL_ZONECHECKS) : %.check : %.zone check: $(ALL_ZONECHECKS) .PHONY: check $(ALL_ZONECHECKS) +## If nsdiff(1) is available then we can show what changes we will make if +## we install the new zone files. +ALL_ZONEDIFFS = $(foreach s,$(ZONESETS), \ + $(foreach v,$($s_VIEWS), \ + $(foreach z,$($s_all_ZONES) $($s_$v_ZONES), \ + $v/$z.zonediff))) +run-nsdiff = nsdiff -v "" $2 \ + $($($(call notdir,$1)_ZONESET)_$(call dir-nosl,$1)_NSDIFF) \ + $(call notdir,$1) $1.zone +$(ALL_ZONEDIFFS) : %.zonediff : %.zone + $(call v_tag,NSDIFF)$(call run-nsdiff,$*,-q); \ + rc=$$?; case $$rc in 1) $(call run-nsdiff,$*); rc=$$? ;; esac; \ + case $$rc in 0 | 1) : ;; *) exit $$rc ;; esac +diff: $(ALL_ZONEDIFFS) + ## Finally we have to install the zone files. ALL_INSTALLS = $(foreach s,$(ZONESETS), \ $(foreach v,$($s_VIEWS), \