update_zone: handle noop'd serial dns-new
authorTero Marttila <terom@paivola.fi>
Thu, 19 Dec 2013 02:30:00 +0200
branchdns-new
changeset 611 52d058780506
parent 610 cb4607af8663
child 612 51270237a6ff
update_zone: handle noop'd serial
lib/update.operations
--- a/lib/update.operations	Thu Dec 19 01:17:48 2013 +0200
+++ b/lib/update.operations	Thu Dec 19 02:30:00 2013 +0200
@@ -163,12 +163,22 @@
     local out="$1"
     local src="$2"
     local serial="$3"
+    local serial_opt=
+
+    if [ -n "$serial" -a -f "$serial" ]; then
+        serial_opt="--serial=$(cat "$serial")"
+
+    elif [ $SERIAL_NOOP ]; then
+        warn "$out: noop'd serial, omitting"
+    else
+        fail "$out: missing serial: $serial"
+    fi
 
     if check_update "$out" "$src" "$serial"; then
         log_update "Generating $out <- $src..." 
 
         do_update "$out" $OPT/bin/pvl.dns-zone "$src" \
-                --serial $(cat "$serial")
+                $serial_opt
     else
         log_skip "Generating $out <- $src: not changed" 
     fi