lazbuild: nicer error message on lpi file not found

git-svn-id: trunk@55541 -
This commit is contained in:
mattias 2017-07-19 11:34:52 +00:00
parent 37cd692b1f
commit 7da30e1cf2

View File

@ -313,7 +313,7 @@ end;
procedure TLazBuildApplication.PackageGraphAddPackage(Pkg: TLazPackage); procedure TLazBuildApplication.PackageGraphAddPackage(Pkg: TLazPackage);
begin begin
if FileExists(Pkg.FileName) then LazPackageLinks.AddUserLink(Pkg); if FileExistsUTF8(Pkg.FileName) then LazPackageLinks.AddUserLink(Pkg);
end; end;
function TLazBuildApplication.PackageGraphCheckInterPkgFiles( function TLazBuildApplication.PackageGraphCheckInterPkgFiles(
@ -381,11 +381,14 @@ begin
// Initialize package graph with base packages etc: // Initialize package graph with base packages etc:
if not Init then exit; if not Init then exit;
// Apparently not found, could be a known but not installed package // Could be a known but not installed package
// so try and get package filename from all other known packages // so try and get package filename from all other known packages
Package:=TLazPackageLink(LazPackageLinks.FindLinkWithPkgName(OriginalFileName)); Package:=TLazPackageLink(LazPackageLinks.FindLinkWithPkgName(OriginalFileName));
if Package=nil then begin if Package=nil then begin
// Not found after everything we tried // Not found after everything we tried
if CompareFileExt(Filename,'.lpi')=0 then
Error(ErrorFileNotFound,'file not found: '+OriginalFilename)
else
Error(ErrorFileNotFound,'package not found: '+OriginalFilename); Error(ErrorFileNotFound,'package not found: '+OriginalFilename);
end end
else begin else begin