From 2c979d9691e8d6d2e662c0e1534b6a4e25e2f8f1 Mon Sep 17 00:00:00 2001 From: Steven Noonan Date: Sun, 18 Oct 2009 17:19:56 -0700 Subject: gen_ver.pl: don't bother with MD5 checking Comparing MD5 hashes used to be important for this script, because in the project I developed it for, it was a globally included header (by something akin to AppHdr.h). Preventing it from changing was pretty important. But it doesn't matter now, since we only make it a dependency of version.cc, and the makefile regenerates it on every build (which is handy). Signed-off-by: Steven Noonan --- crawl-ref/source/util/gen_ver.pl | 33 ++------------------------------- 1 file changed, 2 insertions(+), 31 deletions(-) (limited to 'crawl-ref/source/util') diff --git a/crawl-ref/source/util/gen_ver.pl b/crawl-ref/source/util/gen_ver.pl index bccb73f5b2..27eb062617 100755 --- a/crawl-ref/source/util/gen_ver.pl +++ b/crawl-ref/source/util/gen_ver.pl @@ -114,12 +114,12 @@ chomp($OS); chomp($machine); chomp($processor); -unlink("$outfile.tmp"); +unlink("$outfile"); my $prefix = "CRAWL"; my $smprefix = "crawl"; -open OUT, ">", "$outfile.tmp" or die $!; +open OUT, ">", "$outfile" or die $!; print OUT <<__eof__; #ifndef __included_${smprefix}_build_number_h #define __included_${smprefix}_build_number_h @@ -144,32 +144,3 @@ print OUT <<__eof__; __eof__ close OUT or die $!; - -use Digest::MD5; - -my $ctx = Digest::MD5->new; - -my $md5old = ""; my $md5new = ""; - -if (-e $outfile) { - open OUT, "$outfile" or die $!; - $ctx->addfile(*OUT); - $md5old = $ctx->hexdigest; - close OUT -} - -open OUT, "$outfile.tmp" or die $!; -$ctx->addfile(*OUT); -$md5new = $ctx->hexdigest; -close OUT; - -use File::Copy; - -if ($md5old ne $md5new) { - if (-e $outfile) { - unlink($outfile) or die $!; - } - move "$outfile.tmp", $outfile or die $!; -} else { - unlink ("$outfile.tmp"); -} -- cgit v1.2.3-54-g00ecf