Explorar el Código

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 -
pierre hace 4 años
padre
commit
0b5797e566
Se han modificado 1 ficheros con 12 adiciones y 0 borrados
  1. 12 0
      packages/fpmkunit/src/fpmkunit.pp

+ 12 - 0
packages/fpmkunit/src/fpmkunit.pp

@@ -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