Pārlūkot izejas kodu

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

git-svn-id: trunk@49202 -
pierre 4 gadi atpakaļ
vecāks
revīzija
1e527e7a1e
1 mainītis faili ar 12 papildinājumiem un 2 dzēšanām
  1. 12 2
      packages/fpmkunit/src/fpmkunit.pp

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

@@ -6199,8 +6199,18 @@ Var
 {$endif UNIX}
 {$endif UNIX}
 begin
 begin
   { First delete file on Darwin OS to avoid codesign issues }
   { First delete file on Darwin OS to avoid codesign issues }
-  if (Defaults.SourceOS=Darwin) and FileExists(Dest) then
-    SysDeleteFile(Dest);
+  if (Defaults.SourceOS=Darwin) then
+    begin
+      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);
+    end;
   Log(vlInfo,SInfoCopyingFile,[Src,Dest]);
   Log(vlInfo,SInfoCopyingFile,[Src,Dest]);
   FIn:=TFileStream.Create(Src,fmopenRead or fmShareDenyNone);
   FIn:=TFileStream.Create(Src,fmopenRead or fmShareDenyNone);
   Try
   Try