tserial date inc fix - gitzone - git-based zone management tool for static and dynamic domains HTML git clone https://git.parazyd.org/gitzone DIR Log DIR Files DIR Refs --- DIR commit b56caabfec9f397dcad431713445a6fec9340b20 DIR parent a10ec80780ca93f9d41212b0c2037b93ed83a2a8 HTML Author: tg(x) <*@tg-x.net> Date: Fri, 4 Feb 2011 12:13:40 +0100 serial date inc fix Diffstat: M bin/gitzone | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- DIR diff --git a/bin/gitzone b/bin/gitzone t@@ -79,10 +79,10 @@ sub process_file { my $line = $_; if (/^(.*)(\b\d+\b)(.*?;AUTO_INCREMENT\b.*)$/) { # increment serial where marked with ;AUTO_INCREMENT - # if length of serial is 8 and starts with 20 treat it as a date + # if length of serial is 10 and starts with 20 treat it as a date my ($a,$s,$z) = ($1,int $2,$3); $date ||= strftime '%Y%m%d', localtime; - $s = ($s =~ /^$date/ || $s < 20000000 || $s >= 21000000) ? $s + 1 : $date.'00'; + $s = ($s =~ /^$date/ || $s < 2000000000 || $s >= 2100000000) ? $s + 1 : $date.'00'; $line = "$a$s$z\n"; $changed = 1; } elsif (/^(\W*\$INCLUDE\W+)(\S+)(.*)$/) {