there should be no need for manual changes in the .keycounter
authorMatthias Förste <foerste@schlittermann.de>
Wed, 01 Jun 2011 15:46:55 +0200
changeset 129 642a27894c86
parent 128 ce219be2c383
child 130 5578cb7933c1
there should be no need for manual changes in the .keycounter
lib/DNStools/UpdateSerial.pm
--- a/lib/DNStools/UpdateSerial.pm	Tue May 31 17:02:16 2011 +0200
+++ b/lib/DNStools/UpdateSerial.pm	Wed Jun 01 15:46:55 2011 +0200
@@ -113,11 +113,12 @@
 
         my $stamp_mtime = (stat _)[9];
         my $zone_file_mtime  = (stat "$_/$zone")[9] or die "Can't stat '$_/$zone': $!";
-        # TODO: do this here?
-        my $kc_file_mtime = 0;
-        $kc_file_mtime = (stat "$_/.keycounter")[9] or die "Can't stat '$_/.keycounter': $!" if -f "$_/.keycounter";
 
-        next unless $stamp_mtime < $zone_file_mtime or $stamp_mtime < $kc_file_mtime;
+        # stamp age 'wins' if mtimes are equal because update_serial will both
+        # modify the zonefile and update the stamp which both is likely to
+        # happen at the 'same' time unless you have very very high precision
+        # mtimes
+        next unless $stamp_mtime < $zone_file_mtime;
 
         push @r, $zone;
         say " * $zone: zone file modified";