# HG changeset patch # User Heiko Schlittermann # Date 1288942853 -3600 # Node ID df3ab24a3069b17a32871f50925cf9db6e5bdd50 # Parent 0cbb41e340e0f2b004140f6c8d88050f617e00ee version info diff -r 0cbb41e340e0 -r df3ab24a3069 Makefile --- a/Makefile Fri Nov 05 07:10:18 2010 +0100 +++ b/Makefile Fri Nov 05 08:40:53 2010 +0100 @@ -23,5 +23,9 @@ done ;\ test $$rc = 0 @perl -c $< - @cp -f $< $@ + @test -f .hg_archival.txt \ + && version=`grep ^node: | cut -f2 -d ' ' .hg_archival.txt` ;\ + version=`hg id | cut -f1 -d' '` ;\ + perl -pe 's/__VERSION__/'$$version'/' $< >$<.tmp + @mv -f $<.tmp $@ @chmod +x-w $@ diff -r 0cbb41e340e0 -r df3ab24a3069 update-serial.pl --- a/update-serial.pl Fri Nov 05 07:10:18 2010 +0100 +++ b/update-serial.pl Fri Nov 05 08:40:53 2010 +0100 @@ -24,6 +24,7 @@ #my $dnssec_sign = "../dnstools/dnssec-sign"; my $ME = basename $0; +my $VERSION = '__VERSION__'; my $master_dir = "/etc/bind/master"; my $opt_verbose = 0; @@ -31,6 +32,7 @@ my $opt_dnssec = 0; { + # remove temporary files my @cleanup; sub cleanup(@) { @@ -39,16 +41,20 @@ } } -END { cleanup(); } +sub next_serial($); -sub next_serial($); +END { cleanup(); } +$SIG{INT} = sub { exit 1 }; MAIN: { GetOptions( - "verbose!" => \$opt_verbose, - "yes|reload!" => \$opt_reload, + "v|verbose!" => \$opt_verbose, + "y|r|yes|reload!" => \$opt_reload, "dnssec!" => \$opt_dnssec, + "h|help" => sub { pod2usage(-exit => 0, -verbose => 1) }, + "m|man" => sub { pod2usage(-exit => 0, -verbose => 2) }, + "version" => sub { print "$0 $VERSION\n"; exit 0; }, ) or pod2usage(); warn "DNSSEC support is currently disabled!\n" @@ -107,7 +113,9 @@ seek($in, 0, 0) or die "Can't seek in $file: $!\n"; truncate($in, 0) or die "Can't truncate $file: $!\n"; print $in $_; + close($in); + # touch the stamp open(my $out, ">$stamp_file"); close($out);