mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-09 18:08:35 +02:00
IDE: ignore write errors for .po and Makefiles if directory is readonly
git-svn-id: trunk@12718 -
This commit is contained in:
parent
ee3d4895ef
commit
c1df9e4739
@ -2703,7 +2703,12 @@ begin
|
||||
RSTOutputDirectory:=AppendPathDelim(APackage.GetPOOutDirectory);
|
||||
|
||||
// find all .rst files in package output directory
|
||||
PkgOutputDirectory:=AppendPathDelim(APackage.GetOutputDirectory);
|
||||
if not DirectoryIsWritableCached(RSTOutputDirectory) then begin
|
||||
// this package is read only
|
||||
DebugLn(['TLazPackageGraph.ConvertPackageRSTFiles skipping read only directory '+RSTOutputDirectory]);
|
||||
exit(mrOK);
|
||||
end;
|
||||
|
||||
if not ConvertRSTFiles(PkgOutputDirectory,RSTOutputDirectory) then begin
|
||||
DebugLn(['TLazPackageGraph.ConvertPackageRSTFiles FAILED: PkgOutputDirectory=',PkgOutputDirectory,' RSTOutputDirectory=',RSTOutputDirectory]);
|
||||
exit(mrCancel);
|
||||
|
@ -1336,8 +1336,16 @@ begin
|
||||
CodeBuffer:=CodeToolBoss.LoadFile(MakefileFPCFilename,true,true);
|
||||
if CodeBuffer=nil then begin
|
||||
CodeBuffer:=CodeToolBoss.CreateFile(MakefileFPCFilename);
|
||||
if CodeBuffer=nil then begin
|
||||
if not DirectoryIsWritableCached(ExtractFilePath(MakefileFPCFilename))
|
||||
then begin
|
||||
// the package source is read only => no problem
|
||||
exit(mrOk);
|
||||
end;
|
||||
exit(mrCancel);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
if CompareTextIgnoringSpace(CodeBuffer.Source,s,false)=0 then begin
|
||||
// Makefile.fpc not changed
|
||||
Result:=mrOk;
|
||||
@ -1347,7 +1355,14 @@ begin
|
||||
|
||||
//debugln('TPkgManager.DoWriteMakefile MakefileFPCFilename="',MakefileFPCFilename,'"');
|
||||
Result:=SaveCodeBufferToFile(CodeBuffer,MakefileFPCFilename);
|
||||
if Result<>mrOk then exit;
|
||||
if Result<>mrOk then begin
|
||||
if not DirectoryIsWritableCached(ExtractFilePath(MakefileFPCFilename)) then
|
||||
begin
|
||||
// the package source is read only => no problem
|
||||
Result:=mrOk;
|
||||
end;
|
||||
exit;
|
||||
end;
|
||||
|
||||
// call fpcmake to create the Makefile
|
||||
FPCMakeTool:=TIDEExternalToolOptions.Create;
|
||||
|
Loading…
Reference in New Issue
Block a user