diff -r 2fb003b8ac4c -r cb4607af8663 lib/update.updates --- a/lib/update.updates Thu Dec 19 00:55:22 2013 +0200 +++ b/lib/update.updates Thu Dec 19 01:17:48 2013 +0200 @@ -123,13 +123,26 @@ function zone_includes { local cache="$1" local src="$2" - local dir="$3" + local prefix="${3:-}" if [ ! -e "$cache" -o "$cache" -ot "$src" ]; then read_zone_includes "$src" > "$cache" fi while read include; do - echo -n "$dir/$include " + echo -n "$prefix$include " done < "$cache" } + +## Search for prefix-matching includes in zone file +function zone_includes_grep { + local cache="$1" + local src="$2" + local prefix="$3" + + for include in $(zone_includes $cache $src); do + if [ "${include#$prefix}" != "$include" ]; then + echo -n " ${include#$prefix}" + fi + done +}