Skip to content

Commit

Permalink
Follow both $INCLUDE and ;INCLUDED_BY.
Browse files Browse the repository at this point in the history
With this change, we will attempt to follow changes in both directions,
instead of just looking at INCLUDED_BY.

This means that it is now practical to have your AUTO_INCREMENT serial
number in a file that you $INCLUDE, and it will get updated when you
update any file that includes it.

This can lead to additional unnecessary zone updates, but it may make it
easier to manage a zone which is largely common, but with minor
differences for different views.

If you don't have AUTO_INCREMENT in a file that you $INCLUDE, there
should be no real impact.
  • Loading branch information
Zephaniah E. Loss-Cutler-Hull committed Nov 9, 2017
1 parent 9031e62 commit 967ae1f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion bin/gitzone
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,15 @@ sub process_file {
die "Error in $file:$n: invalid included file name, it should start with: $repo/\n";
}
}

# Try and feed INCLUDE files with relative path names into the list.
# This should allow having a common header with an AUTO_INCREMENTed serial number.
if ($inc_file =~ m|^$repo/(.*)|) {
push (@inc_by, $1);
}
} else {
if ($n == 1 && /^;INCLUDED_BY\s+(.*)$/) {
@inc_by = split /\s+/, $1;
push(@inc_by, split /\s+/, $1);
}
}
push @newfile, $line;
Expand Down

0 comments on commit 967ae1f

Please sign in to comment.