1
0
mirror of https://github.com/postgres/postgres.git synced 2025-04-27 22:56:53 +03:00

Use the AddFile function consistently in MSVC build scripts

We seem to be using a mix of manually adding to the 'files' hash and
calling the Addfile() method.  Let's just consistently use AddFile().

Reviewed-by: Dagfinn Ilmari Mannsåker
Discussion: https://postgr.es/m/CAApHDvpo6g5csCTjc_0C7DMvgFPomVb0Rh-AcW5afd=Ya=LRuw@mail.gmail.com
This commit is contained in:
David Rowley 2021-07-28 23:43:40 +12:00
parent 8709228775
commit ed1884a2fe

View File

@ -58,7 +58,7 @@ sub AddFiles
while (my $f = shift) while (my $f = shift)
{ {
$self->{files}->{ $dir . "/" . $f } = 1; $self->AddFile($dir . "/" . $f, 1);
} }
return; return;
} }
@ -77,14 +77,14 @@ sub ReplaceFile
if ($file eq $filename) if ($file eq $filename)
{ {
delete $self->{files}{$file}; delete $self->{files}{$file};
$self->{files}{$newname} = 1; $self->AddFile($newname);
return; return;
} }
} }
elsif ($file =~ m/($re)/) elsif ($file =~ m/($re)/)
{ {
delete $self->{files}{$file}; delete $self->{files}{$file};
$self->{files}{"$newname/$filename"} = 1; $self->AddFile("$newname/$filename");
return; return;
} }
} }
@ -259,11 +259,11 @@ sub AddDir
if ($f =~ /^\$\(top_builddir\)\/(.*)/) if ($f =~ /^\$\(top_builddir\)\/(.*)/)
{ {
$f = $1; $f = $1;
$self->{files}->{$f} = 1; $self->AddFile($f);
} }
else else
{ {
$self->{files}->{"$reldir/$f"} = 1; $self->AddFile("$reldir/$f");
} }
} }
$mf =~ s{OBJS[^=]*=\s*(.*)$}{}m; $mf =~ s{OBJS[^=]*=\s*(.*)$}{}m;