Merge trunk commits 49131 and 49202

------------------------------------------------------------------------
r49131 | pierre | 2021-04-06 16:43:21 -0600 (Tue, 06 Apr 2021) | 1 line
Changed paths:
   M /trunk/packages/fpmkunit/src/fpmkunit.pp

 Delete existing files before overwriting them for Darwin OS to avoid codesign issues
------------------------------------------------------------------------
------------------------------------------------------------------------
r49202 | pierre | 2021-04-14 02:06:54 -0600 (Wed, 14 Apr 2021) | 1 line

Also delete file before copying if destination is a directory on Darwin OS
------------------------------------------------------------------------

git-svn-id: branches/fixes_3_2@49204 -
This commit is contained in:
pierre 2021-04-14 16:01:11 +00:00
parent 946d9ec715
commit 0b5797e566

View File

@ -5831,6 +5831,18 @@ Var
FileStat: stat;
{$endif UNIX}
begin
{$ifdef DARWIN}
{ First delete file on Darwin OS to avoid codesign issues }
D:=IncludeTrailingPathDelimiter(Dest);
If DirectoryExists(D) then
begin
D:=D+ExtractFileName(Src);
if FileExists(D) then
SysDeleteFile(D);
end
else if FileExists(Dest) then
SysDeleteFile(Dest);
{$endif DARWIN}
Log(vlInfo,SInfoCopyingFile,[Src,Dest]);
FIn:=TFileStream.Create(Src,fmopenRead or fmShareDenyNone);
Try