From: Ian Jackson Date: Sat, 26 Sep 2020 18:36:09 +0000 (+0100) Subject: do not update LICENCE if not needed (saves on rebuilding) X-Git-Tag: otter-0.2.0~891 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=bda6686e28a0c8508764a51cd65025a118a94efb;p=otter.git do not update LICENCE if not needed (saves on rebuilding) Signed-off-by: Ian Jackson --- diff --git a/media-scraper b/media-scraper index 2d8fcfe3..da73cbc7 100755 --- a/media-scraper +++ b/media-scraper @@ -12,6 +12,7 @@ use TOML::Parser; use Data::Dumper; use Time::HiRes; use Digest::MD5 qw(md5_hex); +use File::Compare; our $max_rate = 2; # per second @@ -200,5 +201,12 @@ END } close $makefile or die $!; -rename "$licpath.tmp", $licpath or die $!; + +my $cmp = compare("$licpath.tmp", $licpath); +die if $cmp < 0; +if ($cmp) { + rename "$licpath.tmp", $licpath or die $!; +} else { + remove "$licpath.tmp"; +} rename "$makepath.tmp", $makepath or die $!;