mirror of https://github.com/perkeep/perkeep.git
Fix build.pl optimization error when Makefile doesn't exist.
This commit is contained in:
parent
0714e7ca1c
commit
acd6227b31
8
build.pl
8
build.pl
|
@ -372,9 +372,11 @@ sub gen_target_makefile {
|
||||||
|
|
||||||
sub set_file_contents {
|
sub set_file_contents {
|
||||||
my ($fn, $new) = @_;
|
my ($fn, $new) = @_;
|
||||||
open(my $fh, $fn) or die;
|
if (-e $fn) {
|
||||||
my $cur = do { local $/; <$fh> };
|
open(my $fh, $fn) or die "Failed to write to $fn: $!";
|
||||||
return if $new eq $cur;
|
my $cur = do { local $/; <$fh> };
|
||||||
|
return if $new eq $cur;
|
||||||
|
}
|
||||||
open(my $fh, ">$fn") or die;
|
open(my $fh, ">$fn") or die;
|
||||||
print $fh $new;
|
print $fh $new;
|
||||||
close($fh) or die;
|
close($fh) or die;
|
||||||
|
|
Loading…
Reference in New Issue