equal
deleted
inserted
replaced
188 function indent () { |
188 function indent () { |
189 local indent=$1; shift |
189 local indent=$1; shift |
190 |
190 |
191 log_cmd "$@" |
191 log_cmd "$@" |
192 |
192 |
193 "$@" | ( |
193 "$@" | sed "s/^/$indent/" |
194 while read line; do |
|
195 echo "$indent$line" |
|
196 done |
|
197 ) || return $? |
|
198 } |
194 } |
199 |
195 |
200 function abspath () { |
196 function abspath () { |
201 echo "$ROOT/$1" |
197 echo "$ROOT/$1" |
202 } |
198 } |
377 |
373 |
378 if check_update $dst $src; then |
374 if check_update $dst $src; then |
379 log_info "Generating $dst..." |
375 log_info "Generating $dst..." |
380 |
376 |
381 do_update $dst $PROCESS_ZONE $PROCESS_ARGS $src "$@" |
377 do_update $dst $PROCESS_ZONE $PROCESS_ARGS $src "$@" |
|
378 else |
|
379 log_info "Generating $dst: not changed" |
|
380 fi |
|
381 } |
|
382 |
|
383 # feed `hg annotate -qd`'d version of input to process-zone --input-line-date |
|
384 # only applies commit'd data |
|
385 function update_hosts_meta { |
|
386 local dst=$1; shift |
|
387 local src=$1; shift |
|
388 |
|
389 if check_update $dst $src; then |
|
390 log_info "Generating $dst..." |
|
391 |
|
392 # via stdin |
|
393 $HG -R $DATA annotate -qd $src | \ |
|
394 do_update $dst $PROCESS_ZONE $PROCESS_ARGS --input-line-date --meta-zone "$@" |
382 else |
395 else |
383 log_info "Generating $dst: not changed" |
396 log_info "Generating $dst: not changed" |
384 fi |
397 fi |
385 } |
398 } |
386 |
399 |
476 |
489 |
477 log "Testing hosts..." |
490 log "Testing hosts..." |
478 check_hosts $DATA/paivola.txt --check-exempt ufc |
491 check_hosts $DATA/paivola.txt --check-exempt ufc |
479 |
492 |
480 log "Generating host zones..." |
493 log "Generating host zones..." |
|
494 update_hosts $ZONES/internal/paivola.zone.hosts $DATA/paivola.txt --forward-zone --forward-txt --forward-mx $FORWARD_MX |
481 update_hosts $ZONES/external/paivola.zone.hosts $DATA/paivola.txt --forward-zone |
495 update_hosts $ZONES/external/paivola.zone.hosts $DATA/paivola.txt --forward-zone |
482 update_hosts $ZONES/internal/paivola.zone.hosts $DATA/paivola.txt --forward-zone --forward-txt --forward-mx $FORWARD_MX |
|
483 update_hosts $ZONES/paivola-reverse.zone.hosts $DATA/paivola.txt --reverse-zone $REVERSE_ZONE --reverse-domain $REVERSE_DOMAIN |
496 update_hosts $ZONES/paivola-reverse.zone.hosts $DATA/paivola.txt --reverse-zone $REVERSE_ZONE --reverse-domain $REVERSE_DOMAIN |
484 |
497 |
485 log "Copying zone parts..." |
498 log "Copying zone parts..." |
486 update_zone_part paivola auto |
499 update_zone_part paivola auto |
487 update_zone_part paivola services |
500 update_zone_part paivola services |