diff options
author | Steven Noonan <steven@uplinklabs.net> | 2009-10-18 17:19:56 -0700 |
---|---|---|
committer | Steven Noonan <steven@uplinklabs.net> | 2009-10-18 17:22:45 -0700 |
commit | 2c979d9691e8d6d2e662c0e1534b6a4e25e2f8f1 (patch) | |
tree | b17aa335e5078e4693c595f949e5df3f26159b5e /crawl-ref/source/util | |
parent | 58d3a0522e03c1f0e486dc1d0fa8dec06a1ce5b5 (diff) | |
download | crawl-ref-2c979d9691e8d6d2e662c0e1534b6a4e25e2f8f1.tar.gz crawl-ref-2c979d9691e8d6d2e662c0e1534b6a4e25e2f8f1.zip |
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 <steven@uplinklabs.net>
Diffstat (limited to 'crawl-ref/source/util')
-rwxr-xr-x | crawl-ref/source/util/gen_ver.pl | 33 |
1 files changed, 2 insertions, 31 deletions
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"); -} |