--- a/lib/update.operations Tue Mar 20 15:07:03 2012 +0200
+++ b/lib/update.operations Wed Mar 21 16:45:59 2012 +0200
@@ -42,6 +42,27 @@
fi
}
+## Update .serial number:
+#
+# do_update_serial $serial
+#
+# Shows old/new serial on debug.
+function do_update_serial {
+ local serial=$1
+
+ # read
+ local old=$(test -e $ROOT/$serial && cat $ROOT/$serial || echo '')
+
+
+ cmd $BIN/update-serial $ROOT/$serial
+
+ # read
+ local new=$(cat $ROOT/$serial)
+
+ debug " $old -> $new"
+}
+
+
## Generate new serial for zone using $BIN/update-serial, if the zone data has changed:
#
# update_serial $zone $deps...
@@ -227,18 +248,18 @@
## Load update zonefiles into bind:
#
-# deploy_zones
+# reload_zones
#
# Invokes `rndc reload`, showing its output.
-function deploy_zones {
+function reload_zones {
local msg="Reload zones"
- if [ $DEPLOY_FORCE ]; then
+ if [ $RELOAD_FORCE ]; then
log_force "$msg..."
do_reload
- elif [ $DEPLOY_NOOP ]; then
+ elif [ $RELOAD_NOOP ]; then
log_noop "$msg: skipped"
elif [ ! -r $RNDC_KEY ]; then
@@ -253,6 +274,17 @@
do_reload
fi
}
+
+## Perform `hg commit` for $DATA
+function do_commit {
+ local msg=$1
+
+ [ $LOG_DIFF ] && indent " " hg_diff
+
+ hg_commit "$msg"
+}
+
+
## Commit changes in $DATA to version control:
#
# commit_data