diff --git a/components/codetools/definetemplates.pas b/components/codetools/definetemplates.pas index d526745ad5..7aadd43690 100644 --- a/components/codetools/definetemplates.pas +++ b/components/codetools/definetemplates.pas @@ -231,6 +231,7 @@ type public Path: string; Values: TExpressionEvaluator; + UnitLinksTree: TAVLTree; constructor Create; destructor Destroy; override; end; @@ -269,6 +270,9 @@ type procedure IncreaseChangeStep; protected function FindDirectoryInCache(const Path: string): TDirectoryDefines; + function GetDirDefinesForDirectory(const Path: string; + WithVirtualDir: boolean): TDirectoryDefines; + function GetDirDefinesForVirtualDirectory: TDirectoryDefines; function MacroFuncExtractFileExt(Data: Pointer): boolean; function MacroFuncExtractFilePath(Data: Pointer): boolean; function MacroFuncExtractFileName(Data: Pointer): boolean; @@ -307,6 +311,8 @@ type function GetPPWSrcPathForDirectory(const Directory: string): string; function GetSrcPathForDirectory(const Directory: string): string; function GetUnitPathForDirectory(const Directory: string): string; + function FindUnitInUnitLinks(const AnUnitName, Directory: string; + WithVirtualDir: boolean): string; function IsEqual(SrcDefineTree: TDefineTree): boolean; procedure Add(ADefineTemplate: TDefineTemplate); procedure AddChild(ParentTemplate, NewDefineTemplate: TDefineTemplate); @@ -409,6 +415,7 @@ function DefineActionNameToAction(const s: string): TDefineAction; function DefineTemplateFlagsToString(Flags: TDefineTemplateFlags): string; function SearchUnitInUnitLinks(const UnitLinks, TheUnitName: string; var UnitLinkStart, UnitLinkEnd: integer; var Filename: string): boolean; +function CreateUnitLinksTree(const UnitLinks: string): TAVLTree; function GetDefaultSrcOSForTargetOS(const TargetOS: string): string; @@ -452,6 +459,12 @@ begin Result:=AnsiCompareText(Link1.UnitName,Link2.UnitName); end; +function CompareUnitNameWithUnitLinkNode(UnitName: Pointer; + NodeData: pointer): integer; +begin + Result:=AnsiCompareText(String(UnitName),TUnitNameLink(NodeData).UnitName); +end; + function CompareDirectoryDefines(NodeData1, NodeData2: pointer): integer; var DirDef1, DirDef2: TDirectoryDefines; begin @@ -513,6 +526,7 @@ begin exit; end; end; + UnitLinkStart:=UnitLinkEnd; end else begin UnitLinkStart:=UnitLinkEnd+1; while (UnitLinkStart<=length(UnitLinks)) @@ -524,6 +538,55 @@ begin end; end; +function CreateUnitLinksTree(const UnitLinks: string): TAVLTree; +var + UnitLinksTree: TAVLTree; + UnitLinkLen: integer; + UnitLinkStart: Integer; + UnitLinkEnd: Integer; + TheUnitName: String; + Filename: String; + NewNode: TUnitNameLink; +begin + UnitLinksTree:=TAVLTree.Create(@CompareUnitLinkNodes); + UnitLinkStart:=1; + while UnitLinkStart<=length(UnitLinks) do begin + while (UnitLinkStart<=length(UnitLinks)) + and (UnitLinks[UnitLinkStart] in [#10,#13]) do + inc(UnitLinkStart); + UnitLinkEnd:=UnitLinkStart; + while (UnitLinkEnd<=length(UnitLinks)) and (UnitLinks[UnitLinkEnd]<>' ') + do + inc(UnitLinkEnd); + UnitLinkLen:=UnitLinkEnd-UnitLinkStart; + if UnitLinkLen>0 then begin + TheUnitName:=copy(UnitLinks,UnitLinkStart,UnitLinkLen); + if IsValidIdent(TheUnitName) then begin + UnitLinkStart:=UnitLinkEnd+1; + UnitLinkEnd:=UnitLinkStart; + while (UnitLinkEnd<=length(UnitLinks)) + and (not (UnitLinks[UnitLinkEnd] in [#10,#13])) do + inc(UnitLinkEnd); + if UnitLinkEnd>UnitLinkStart then begin + Filename:=copy(UnitLinks,UnitLinkStart,UnitLinkEnd-UnitLinkStart); + NewNode:=TUnitNameLink.Create; + NewNode.UnitName:=TheUnitName; + NewNode.Filename:=Filename; + UnitLinksTree.Add(NewNode); + end; + UnitLinkStart:=UnitLinkEnd; + end else begin + UnitLinkStart:=UnitLinkEnd+1; + while (UnitLinkStart<=length(UnitLinks)) + and (not (UnitLinks[UnitLinkStart] in [#10,#13])) do + inc(UnitLinkStart); + end; + end else + break; + end; + Result:=UnitLinksTree; +end; + function GetDefaultSrcOSForTargetOS(const TargetOS: string): string; begin Result:=''; @@ -1496,6 +1559,7 @@ end; destructor TDirectoryDefines.Destroy; begin Values.Free; + UnitLinksTree.Free; inherited Destroy; end; @@ -1610,6 +1674,51 @@ begin Result:=nil; end; +function TDefineTree.GetDirDefinesForDirectory(const Path: string; + WithVirtualDir: boolean): TDirectoryDefines; +var + ExpPath: String; +begin + //writeln('[TDefineTree.GetDirDefinesForDirectory] "',Path,'"'); + if (Path<>'') or (not WithVirtualDir) then begin + ExpPath:=TrimFilename(Path); + if (ExpPath<>'') and (ExpPath[length(ExpPath)]<>PathDelim) then + ExpPath:=ExpPath+PathDelim; + Result:=FindDirectoryInCache(ExpPath); + if Result=nil then begin + Result:=TDirectoryDefines.Create; + Result.Path:=ExpPath; + //writeln('[TDefineTree.GetDirDefinesForDirectory] B ',ExpPath,' '); + if Calculate(Result) then begin + //writeln('[TDefineTree.GetDirDefinesForDirectory] C success'); + FCache.Add(Result); + end else begin + //writeln('[TDefineTree.GetDirDefinesForDirectory] D failed'); + Result.Free; + Result:=nil; + end; + end; + end else begin + Result:=GetDirDefinesForVirtualDirectory; + end; +end; + +function TDefineTree.GetDirDefinesForVirtualDirectory: TDirectoryDefines; +begin + if FVirtualDirCache=nil then begin + //writeln('################ TDefineTree.GetDirDefinesForVirtualDirectory'); + FVirtualDirCache:=TDirectoryDefines.Create; + FVirtualDirCache.Path:=VirtualDirectory; + if Calculate(FVirtualDirCache) then begin + //writeln('TDefineTree.GetDirDefinesForVirtualDirectory '); + end else begin + FVirtualDirCache.Free; + FVirtualDirCache:=nil; + end; + end; + Result:=FVirtualDirCache; +end; + function TDefineTree.MacroFuncExtractFileExt(Data: Pointer): boolean; var FuncData: PReadFunctionData; @@ -1690,6 +1799,32 @@ begin end; end; +function TDefineTree.FindUnitInUnitLinks(const AnUnitName, Directory: string; + WithVirtualDir: boolean): string; +var + DirDef: TDirectoryDefines; + UnitLinks: string; + AVLNode: TAVLTreeNode; +begin + Result:=''; + if AnUnitName='' then exit; + DirDef:=GetDirDefinesForDirectory(Directory,WithVirtualDir); + if (DirDef=nil) or (DirDef.Values=nil) then exit; + if DirDef.UnitLinksTree=nil then begin + // create tree + UnitLinks:=DirDef.Values[ExternalMacroStart+'UnitLinks']; + // cache tree + DirDef.UnitLinksTree:=CreateUnitLinksTree(UnitLinks); + end; + // search in tree + if DirDef.UnitLinksTree<>nil then begin + AVLNode:=DirDef.UnitLinksTree.FindKey(PChar(AnUnitName), + @CompareUnitNameWithUnitLinkNode); + if AVLNode<>nil then + Result:=TUnitNameLink(AVLNode.Data).Filename; + end; +end; + function TDefineTree.GetIncludePathForDirectory(const Directory: string ): string; var Evaluator: TExpressionEvaluator; @@ -1764,53 +1899,25 @@ end; function TDefineTree.GetDefinesForDirectory( const Path: string; WithVirtualDir: boolean): TExpressionEvaluator; -var ExpPath: string; +var DirDef: TDirectoryDefines; begin - //writeln('[TDefineTree.GetDefinesForDirectory] "',Path,'"'); - if (Path<>'') or (not WithVirtualDir) then begin - ExpPath:=TrimFilename(Path); - if (ExpPath<>'') and (ExpPath[length(ExpPath)]<>PathDelim) then - ExpPath:=ExpPath+PathDelim; - DirDef:=FindDirectoryInCache(ExpPath); - if DirDef<>nil then begin - Result:=DirDef.Values; - end else begin - DirDef:=TDirectoryDefines.Create; - DirDef.Path:=ExpPath; - //writeln('[TDefineTree.GetDefinesForDirectory] B ',ExpPath,' '); - if Calculate(DirDef) then begin - //writeln('[TDefineTree.GetDefinesForDirectory] C success'); - FCache.Add(DirDef); - Result:=DirDef.Values; - end else begin - //writeln('[TDefineTree.GetDefinesForDirectory] D failed'); - DirDef.Free; - Result:=nil; - end; - end; - end else begin - Result:=GetDefinesForVirtualDirectory; - end; + DirDef:=GetDirDefinesForDirectory(Path,WithVirtualDir); + if DirDef<>nil then + Result:=DirDef.Values + else + Result:=nil; end; function TDefineTree.GetDefinesForVirtualDirectory: TExpressionEvaluator; +var + DirDef: TDirectoryDefines; begin - if FVirtualDirCache<>nil then - Result:=FVirtualDirCache.Values - else begin - //writeln('################ TDefineTree.GetDefinesForVirtualDirectory'); - FVirtualDirCache:=TDirectoryDefines.Create; - FVirtualDirCache.Path:=VirtualDirectory; - if Calculate(FVirtualDirCache) then begin - Result:=FVirtualDirCache.Values; - //writeln('TDefineTree.GetDefinesForVirtualDirectory ',Result.AsString); - end else begin - FVirtualDirCache.Free; - FVirtualDirCache:=nil; - Result:=nil; - end; - end; + DirDef:=GetDirDefinesForVirtualDirectory; + if DirDef<>nil then + Result:=DirDef.Values + else + Result:=nil; end; procedure TDefineTree.ReadValue(const DirDef: TDirectoryDefines; diff --git a/ide/lazarusidestrconsts.pas b/ide/lazarusidestrconsts.pas index 1372fdd21b..04ae310d71 100644 --- a/ide/lazarusidestrconsts.pas +++ b/ide/lazarusidestrconsts.pas @@ -1827,6 +1827,18 @@ resourcestring lisPkgMangCircleInPackageDependencies = 'Circle in package dependencies'; lisPkgMangThereIsACircleInTheRequiredPackages = 'There is a circle in the ' +'required packages. See package graph.'; + lisPkgMangThereAreTwoUnitsWithTheSameName1From2From = 'There are two units ' + +'with the same name:%s%s1. %s%s%s from %s%s2. %s%s%s from %s%s%s'; + lisPkgMangThereIsAUnitWithTheSameNameAsAPackage1From2 = 'There is a unit ' + +'with the same name as a package:%s%s1. %s%s%s from %s%s2. %s%s%s%s'; + lisPkgMangAmbigiousUnitsFound = 'Ambigious units found'; + lisPkgMangBothPackagesAreConnectedThisMeansEitherOnePackageU = '%sBoth ' + +'packages are connected. This means, either one package uses the other, ' + +'or they are both used by a third package.'; + lisPkgMangThereIsAFPCUnitWithTheSameNameFrom = 'There is a FPC unit with ' + +'the same name:%s%s%s%s%s from %s%s%s'; + lisPkgMangThereIsAFPCUnitWithTheSameNameAsAPackage = 'There is a FPC unit ' + +'with the same name as a package:%s%s%s%s%s%s'; lisPkgMangErrorWritingFile = 'Error writing file'; lisPkgMangUnableToWriteStateFileOfPackageError = 'Unable to write state ' +'file %s%s%s%sof package %s.%sError: %s'; diff --git a/languages/lazaruside.ca.po b/languages/lazaruside.ca.po index f5df16bc4c..7aa12b1279 100644 --- a/languages/lazaruside.ca.po +++ b/languages/lazaruside.ca.po @@ -94,6 +94,10 @@ msgstr "%s, espec msgid "%s/ReadOnly" msgstr "%s/Només de lectura" +#: lazarusidestrconsts:lispkgmangbothpackagesareconnectedthismeanseitheronepackageu +msgid "%sBoth packages are connected. This means, either one package uses the other, or they are both used by a third package." +msgstr "" + #: lazarusidestrconsts:lisoipdescriptiondescription msgid "%sDescription: %s" msgstr "" @@ -414,6 +418,10 @@ msgstr "" msgid "Ambigious Unit Name" msgstr "" +#: lazarusidestrconsts:lispkgmangambigiousunitsfound +msgid "Ambigious units found" +msgstr "" + #: lazarusidestrconsts:lisa2pancestortype msgid "Ancestor Type" msgstr "" @@ -5610,6 +5618,10 @@ msgstr "" msgid "There are other files in the directory with the same name,%swhich only differ in case:%s%s%sDelete them?" msgstr "" +#: lazarusidestrconsts:lispkgmangtherearetwounitswiththesamename1from2from +msgid "There are two units with the same name:%s%s1. %s%s%s from %s%s2. %s%s%s from %s%s%s" +msgstr "" + #: lazarusidestrconsts:lispkgmangthereisacircleintherequiredpackages msgid "There is a circle in the required packages. See package graph." msgstr "" @@ -5618,6 +5630,14 @@ msgstr "" msgid "There is a file with the same name and a similar extension ond disk%sFile: %s%sAmbigious File: %s%s%sDelete ambigious file?" msgstr "" +#: lazarusidestrconsts:lispkgmangthereisafpcunitwiththesamenameasapackage +msgid "There is a FPC unit with the same name as a package:%s%s%s%s%s%s" +msgstr "" + +#: lazarusidestrconsts:lispkgmangthereisafpcunitwiththesamenamefrom +msgid "There is a FPC unit with the same name:%s%s%s%s%s from %s%s%s" +msgstr "" + #: lazarusidestrconsts:lisexttoolthereisamaximumoftools msgid "There is a maximum of %s tools." msgstr "" @@ -5626,6 +5646,10 @@ msgstr "" msgid "There is a unit with the name %s%s%s in the project.%sPlz choose a different name" msgstr "" +#: lazarusidestrconsts:lispkgmangthereisaunitwiththesamenameasapackage1from2 +msgid "There is a unit with the same name as a package:%s%s1. %s%s%s from %s%s2. %s%s%s%s" +msgstr "" + #: lazarusidestrconsts:listhereisalreadyaformwiththename msgid "There is already a form with the name %s%s%s" msgstr "" diff --git a/languages/lazaruside.de.po b/languages/lazaruside.de.po index 9040042b18..128dc1d2fc 100644 --- a/languages/lazaruside.de.po +++ b/languages/lazaruside.de.po @@ -104,6 +104,10 @@ msgstr "%s, Projekt spezifisch" msgid "%s/ReadOnly" msgstr "%s/Nur Lesbar" +#: lazarusidestrconsts:lispkgmangbothpackagesareconnectedthismeanseitheronepackageu +msgid "%sBoth packages are connected. This means, either one package uses the other, or they are both used by a third package." +msgstr "" + #: lazarusidestrconsts:lisoipdescriptiondescription msgid "%sDescription: %s" msgstr "%sBeschreibung: %s" @@ -424,6 +428,10 @@ msgstr "" msgid "Ambigious Unit Name" msgstr "" +#: lazarusidestrconsts:lispkgmangambigiousunitsfound +msgid "Ambigious units found" +msgstr "" + #: lazarusidestrconsts:lisa2pancestortype msgid "Ancestor Type" msgstr "" @@ -5620,6 +5628,10 @@ msgstr "" msgid "There are other files in the directory with the same name,%swhich only differ in case:%s%s%sDelete them?" msgstr "" +#: lazarusidestrconsts:lispkgmangtherearetwounitswiththesamename1from2from +msgid "There are two units with the same name:%s%s1. %s%s%s from %s%s2. %s%s%s from %s%s%s" +msgstr "" + #: lazarusidestrconsts:lispkgmangthereisacircleintherequiredpackages msgid "There is a circle in the required packages. See package graph." msgstr "" @@ -5628,6 +5640,14 @@ msgstr "" msgid "There is a file with the same name and a similar extension ond disk%sFile: %s%sAmbigious File: %s%s%sDelete ambigious file?" msgstr "" +#: lazarusidestrconsts:lispkgmangthereisafpcunitwiththesamenameasapackage +msgid "There is a FPC unit with the same name as a package:%s%s%s%s%s%s" +msgstr "" + +#: lazarusidestrconsts:lispkgmangthereisafpcunitwiththesamenamefrom +msgid "There is a FPC unit with the same name:%s%s%s%s%s from %s%s%s" +msgstr "" + #: lazarusidestrconsts:lisexttoolthereisamaximumoftools msgid "There is a maximum of %s tools." msgstr "" @@ -5636,6 +5656,10 @@ msgstr "" msgid "There is a unit with the name %s%s%s in the project.%sPlz choose a different name" msgstr "" +#: lazarusidestrconsts:lispkgmangthereisaunitwiththesamenameasapackage1from2 +msgid "There is a unit with the same name as a package:%s%s1. %s%s%s from %s%s2. %s%s%s%s" +msgstr "" + #: lazarusidestrconsts:listhereisalreadyaformwiththename msgid "There is already a form with the name %s%s%s" msgstr "" diff --git a/languages/lazaruside.es.po b/languages/lazaruside.es.po index 296772703e..82e39e09b8 100644 --- a/languages/lazaruside.es.po +++ b/languages/lazaruside.es.po @@ -105,6 +105,10 @@ msgstr "%s, específico de proyecto" msgid "%s/ReadOnly" msgstr "%s/Sólo de lectura" +#: lazarusidestrconsts:lispkgmangbothpackagesareconnectedthismeanseitheronepackageu +msgid "%sBoth packages are connected. This means, either one package uses the other, or they are both used by a third package." +msgstr "" + #: lazarusidestrconsts:lisoipdescriptiondescription msgid "%sDescription: %s" msgstr "%s Descripción: %s" @@ -425,6 +429,10 @@ msgstr "Encontrados archivos ambiguos" msgid "Ambigious Unit Name" msgstr "Nombre de Unidad ambiguo" +#: lazarusidestrconsts:lispkgmangambigiousunitsfound +msgid "Ambigious units found" +msgstr "" + #: lazarusidestrconsts:lisa2pancestortype msgid "Ancestor Type" msgstr "Tipo del ancestro" @@ -5621,6 +5629,10 @@ msgstr "Hay másfunciones en el menú contextual" msgid "There are other files in the directory with the same name,%swhich only differ in case:%s%s%sDelete them?" msgstr "Hay otros archivos en el directorio con el mismo nombre,%s difieren sólo en may/min:%s%s%s¿Borrarlos?" +#: lazarusidestrconsts:lispkgmangtherearetwounitswiththesamename1from2from +msgid "There are two units with the same name:%s%s1. %s%s%s from %s%s2. %s%s%s from %s%s%s" +msgstr "" + #: lazarusidestrconsts:lispkgmangthereisacircleintherequiredpackages msgid "There is a circle in the required packages. See package graph." msgstr "Hay un círculo en los paquetes requeridos. Mire el gráfico de paquete" @@ -5629,6 +5641,14 @@ msgstr "Hay un círculo en los paquetes requeridos. Mire el gráfico de paquete" msgid "There is a file with the same name and a similar extension ond disk%sFile: %s%sAmbigious File: %s%s%sDelete ambigious file?" msgstr "Hay un archivo con el mismo nombre y extensión similar en disco%sArchivo: %s%sArchivo Ambiguo: %s%s%s¿Borrar archivo ambiguo?" +#: lazarusidestrconsts:lispkgmangthereisafpcunitwiththesamenameasapackage +msgid "There is a FPC unit with the same name as a package:%s%s%s%s%s%s" +msgstr "" + +#: lazarusidestrconsts:lispkgmangthereisafpcunitwiththesamenamefrom +msgid "There is a FPC unit with the same name:%s%s%s%s%s from %s%s%s" +msgstr "" + #: lazarusidestrconsts:lisexttoolthereisamaximumoftools msgid "There is a maximum of %s tools." msgstr "Hay un máximo de %s herramientas" @@ -5637,6 +5657,10 @@ msgstr "Hay un máximo de %s herramientas" msgid "There is a unit with the name %s%s%s in the project.%sPlz choose a different name" msgstr "Hay una unidad con el nombre %s%s%s en el proyecto.%sPor favor escoja un nombre diferente" +#: lazarusidestrconsts:lispkgmangthereisaunitwiththesamenameasapackage1from2 +msgid "There is a unit with the same name as a package:%s%s1. %s%s%s from %s%s2. %s%s%s%s" +msgstr "" + #: lazarusidestrconsts:listhereisalreadyaformwiththename msgid "There is already a form with the name %s%s%s" msgstr "Ya hay un formulario con el nombre %s%s%s" diff --git a/languages/lazaruside.fr.po b/languages/lazaruside.fr.po index 7762e7ea7f..c75ec5d5be 100644 --- a/languages/lazaruside.fr.po +++ b/languages/lazaruside.fr.po @@ -103,6 +103,10 @@ msgstr "%s, projet sp msgid "%s/ReadOnly" msgstr "%s/Lecture seule" +#: lazarusidestrconsts:lispkgmangbothpackagesareconnectedthismeanseitheronepackageu +msgid "%sBoth packages are connected. This means, either one package uses the other, or they are both used by a third package." +msgstr "" + #: lazarusidestrconsts:lisoipdescriptiondescription msgid "%sDescription: %s" msgstr "%sDescription: %s" @@ -423,6 +427,10 @@ msgstr "Ambigu msgid "Ambigious Unit Name" msgstr "Ambiguïté de nom d'unité" +#: lazarusidestrconsts:lispkgmangambigiousunitsfound +msgid "Ambigious units found" +msgstr "" + #: lazarusidestrconsts:lisa2pancestortype msgid "Ancestor Type" msgstr "Type d'ancètre" @@ -5619,6 +5627,10 @@ msgstr "" msgid "There are other files in the directory with the same name,%swhich only differ in case:%s%s%sDelete them?" msgstr "" +#: lazarusidestrconsts:lispkgmangtherearetwounitswiththesamename1from2from +msgid "There are two units with the same name:%s%s1. %s%s%s from %s%s2. %s%s%s from %s%s%s" +msgstr "" + #: lazarusidestrconsts:lispkgmangthereisacircleintherequiredpackages msgid "There is a circle in the required packages. See package graph." msgstr "" @@ -5627,6 +5639,14 @@ msgstr "" msgid "There is a file with the same name and a similar extension ond disk%sFile: %s%sAmbigious File: %s%s%sDelete ambigious file?" msgstr "" +#: lazarusidestrconsts:lispkgmangthereisafpcunitwiththesamenameasapackage +msgid "There is a FPC unit with the same name as a package:%s%s%s%s%s%s" +msgstr "" + +#: lazarusidestrconsts:lispkgmangthereisafpcunitwiththesamenamefrom +msgid "There is a FPC unit with the same name:%s%s%s%s%s from %s%s%s" +msgstr "" + #: lazarusidestrconsts:lisexttoolthereisamaximumoftools msgid "There is a maximum of %s tools." msgstr "" @@ -5635,6 +5655,10 @@ msgstr "" msgid "There is a unit with the name %s%s%s in the project.%sPlz choose a different name" msgstr "" +#: lazarusidestrconsts:lispkgmangthereisaunitwiththesamenameasapackage1from2 +msgid "There is a unit with the same name as a package:%s%s1. %s%s%s from %s%s2. %s%s%s%s" +msgstr "" + #: lazarusidestrconsts:listhereisalreadyaformwiththename msgid "There is already a form with the name %s%s%s" msgstr "" diff --git a/languages/lazaruside.it.po b/languages/lazaruside.it.po index d7186529cd..c7ac828517 100644 --- a/languages/lazaruside.it.po +++ b/languages/lazaruside.it.po @@ -103,6 +103,10 @@ msgstr "%s, specifica del progetto" msgid "%s/ReadOnly" msgstr "%s/SolaLettura" +#: lazarusidestrconsts:lispkgmangbothpackagesareconnectedthismeanseitheronepackageu +msgid "%sBoth packages are connected. This means, either one package uses the other, or they are both used by a third package." +msgstr "" + #: lazarusidestrconsts:lisoipdescriptiondescription msgid "%sDescription: %s" msgstr "%sDescrizione: %s" @@ -423,6 +427,10 @@ msgstr "Trovati file ambigui" msgid "Ambigious Unit Name" msgstr "Nome unit ambiguo" +#: lazarusidestrconsts:lispkgmangambigiousunitsfound +msgid "Ambigious units found" +msgstr "" + #: lazarusidestrconsts:lisa2pancestortype msgid "Ancestor Type" msgstr "Tipo antenato" @@ -5619,6 +5627,10 @@ msgstr "Ci sono più funzioni nel menu a scomparsa" msgid "There are other files in the directory with the same name,%swhich only differ in case:%s%s%sDelete them?" msgstr "Ci sono altri file nella directory con lo stesso nome,%sche differiscono solamente per le maiuscole:%s%s%sVuoi cancellarli?" +#: lazarusidestrconsts:lispkgmangtherearetwounitswiththesamename1from2from +msgid "There are two units with the same name:%s%s1. %s%s%s from %s%s2. %s%s%s from %s%s%s" +msgstr "" + #: lazarusidestrconsts:lispkgmangthereisacircleintherequiredpackages msgid "There is a circle in the required packages. See package graph." msgstr "C'è un riferimento circolare nel pacchetto richiesto. Vedere il grafico pacchetto." @@ -5627,6 +5639,14 @@ msgstr "C'è un riferimento circolare nel pacchetto richiesto. Vedere il grafico msgid "There is a file with the same name and a similar extension ond disk%sFile: %s%sAmbigious File: %s%s%sDelete ambigious file?" msgstr "C'è un file con lo stesso nome e un'estensione simile su disco%sFile: %s%sFile ambiguo: %s%s%sCancellare il file ambiguo?" +#: lazarusidestrconsts:lispkgmangthereisafpcunitwiththesamenameasapackage +msgid "There is a FPC unit with the same name as a package:%s%s%s%s%s%s" +msgstr "" + +#: lazarusidestrconsts:lispkgmangthereisafpcunitwiththesamenamefrom +msgid "There is a FPC unit with the same name:%s%s%s%s%s from %s%s%s" +msgstr "" + #: lazarusidestrconsts:lisexttoolthereisamaximumoftools msgid "There is a maximum of %s tools." msgstr "C'è un massimo di %s strumenti." @@ -5635,6 +5655,10 @@ msgstr "C'è un massimo di %s strumenti." msgid "There is a unit with the name %s%s%s in the project.%sPlz choose a different name" msgstr "C'è già una unit con nome %s%s%s nel progetto.%sScegliere un altro nome." +#: lazarusidestrconsts:lispkgmangthereisaunitwiththesamenameasapackage1from2 +msgid "There is a unit with the same name as a package:%s%s1. %s%s%s from %s%s2. %s%s%s%s" +msgstr "" + #: lazarusidestrconsts:listhereisalreadyaformwiththename msgid "There is already a form with the name %s%s%s" msgstr "C'è già una form con il nome %s%s%s" diff --git a/languages/lazaruside.pl.po b/languages/lazaruside.pl.po index 1c1d98bdfe..6de0bf7c48 100644 --- a/languages/lazaruside.pl.po +++ b/languages/lazaruside.pl.po @@ -104,6 +104,10 @@ msgstr "%s, szczeg msgid "%s/ReadOnly" msgstr "%s/Tylko do odczytu" +#: lazarusidestrconsts:lispkgmangbothpackagesareconnectedthismeanseitheronepackageu +msgid "%sBoth packages are connected. This means, either one package uses the other, or they are both used by a third package." +msgstr "" + #: lazarusidestrconsts:lisoipdescriptiondescription msgid "%sDescription: %s" msgstr "%sOpis: %s" @@ -424,6 +428,10 @@ msgstr "Znalaz msgid "Ambigious Unit Name" msgstr "Niejednoznaczna nazwa modu³u" +#: lazarusidestrconsts:lispkgmangambigiousunitsfound +msgid "Ambigious units found" +msgstr "" + #: lazarusidestrconsts:lisa2pancestortype msgid "Ancestor Type" msgstr "Typ przodka" @@ -5620,6 +5628,10 @@ msgstr "Wi msgid "There are other files in the directory with the same name,%swhich only differ in case:%s%s%sDelete them?" msgstr "W katalogu s± inne pliki o tej nazwie,%sktóre ró¿ni± siê tylko wielko¶ci± liter:%s%s%sChcesz je usun±æ?" +#: lazarusidestrconsts:lispkgmangtherearetwounitswiththesamename1from2from +msgid "There are two units with the same name:%s%s1. %s%s%s from %s%s2. %s%s%s from %s%s%s" +msgstr "" + #: lazarusidestrconsts:lispkgmangthereisacircleintherequiredpackages msgid "There is a circle in the required packages. See package graph." msgstr "Wyst±pi³o zapêtlenie zale¿no¶ci w wymaganych pakietach. Spójrz na listê pakietów." @@ -5628,6 +5640,14 @@ msgstr "Wyst msgid "There is a file with the same name and a similar extension ond disk%sFile: %s%sAmbigious File: %s%s%sDelete ambigious file?" msgstr "Istnieje plik z tak± sam± nazw± i podobnym rozszerzeniem na dysku%sPlik: %s%sNiejednoznaczny plik: %s%s%sUsun±æ niejednoznaczny plik?" +#: lazarusidestrconsts:lispkgmangthereisafpcunitwiththesamenameasapackage +msgid "There is a FPC unit with the same name as a package:%s%s%s%s%s%s" +msgstr "" + +#: lazarusidestrconsts:lispkgmangthereisafpcunitwiththesamenamefrom +msgid "There is a FPC unit with the same name:%s%s%s%s%s from %s%s%s" +msgstr "" + #: lazarusidestrconsts:lisexttoolthereisamaximumoftools msgid "There is a maximum of %s tools." msgstr "Mo¿e byæ maksymalnie %s narzêdzi." @@ -5636,6 +5656,10 @@ msgstr "Mo msgid "There is a unit with the name %s%s%s in the project.%sPlz choose a different name" msgstr "Modu³ o nazwie %s%s%s jest ju¿ w projekcie.%sWybierz inn± nazwê." +#: lazarusidestrconsts:lispkgmangthereisaunitwiththesamenameasapackage1from2 +msgid "There is a unit with the same name as a package:%s%s1. %s%s%s from %s%s2. %s%s%s%s" +msgstr "" + #: lazarusidestrconsts:listhereisalreadyaformwiththename msgid "There is already a form with the name %s%s%s" msgstr "Ju¿ jest formularz o nazwie %s%s%s" diff --git a/languages/lazaruside.po b/languages/lazaruside.po index a193d4b313..06c444ed40 100644 --- a/languages/lazaruside.po +++ b/languages/lazaruside.po @@ -5594,6 +5594,30 @@ msgstr "" msgid "There is a circle in the required packages. See package graph." msgstr "" +#: lazarusidestrconsts:lispkgmangtherearetwounitswiththesamename1from2from +msgid "There are two units with the same name:%s%s1. %s%s%s from %s%s2. %s%s%s from %s%s%s" +msgstr "" + +#: lazarusidestrconsts:lispkgmangthereisaunitwiththesamenameasapackage1from2 +msgid "There is a unit with the same name as a package:%s%s1. %s%s%s from %s%s2. %s%s%s%s" +msgstr "" + +#: lazarusidestrconsts:lispkgmangambigiousunitsfound +msgid "Ambigious units found" +msgstr "" + +#: lazarusidestrconsts:lispkgmangbothpackagesareconnectedthismeanseitheronepackageu +msgid "%sBoth packages are connected. This means, either one package uses the other, or they are both used by a third package." +msgstr "" + +#: lazarusidestrconsts:lispkgmangthereisafpcunitwiththesamenamefrom +msgid "There is a FPC unit with the same name:%s%s%s%s%s from %s%s%s" +msgstr "" + +#: lazarusidestrconsts:lispkgmangthereisafpcunitwiththesamenameasapackage +msgid "There is a FPC unit with the same name as a package:%s%s%s%s%s%s" +msgstr "" + #: lazarusidestrconsts:lispkgmangerrorwritingfile msgid "Error writing file" msgstr "" diff --git a/languages/lazaruside.ru.po b/languages/lazaruside.ru.po index 6bae1f1431..03bff4a824 100644 --- a/languages/lazaruside.ru.po +++ b/languages/lazaruside.ru.po @@ -94,6 +94,10 @@ msgstr "%s, msgid "%s/ReadOnly" msgstr "%s/ÔÏÌØËÏ ÞÔÅÎÉÅ" +#: lazarusidestrconsts:lispkgmangbothpackagesareconnectedthismeanseitheronepackageu +msgid "%sBoth packages are connected. This means, either one package uses the other, or they are both used by a third package." +msgstr "" + #: lazarusidestrconsts:lisoipdescriptiondescription msgid "%sDescription: %s" msgstr "%sïÐÉÓÁÎÉÅ: %s" @@ -414,6 +418,10 @@ msgstr " msgid "Ambigious Unit Name" msgstr "ä×ÕÓÍÙÓÌÅÎÎÏÅ ÉÍÑ ÍÏÄÕÌÑ" +#: lazarusidestrconsts:lispkgmangambigiousunitsfound +msgid "Ambigious units found" +msgstr "" + #: lazarusidestrconsts:lisa2pancestortype msgid "Ancestor Type" msgstr "ôÉÐ ÐÒÅÄËÁ" @@ -5610,6 +5618,10 @@ msgstr " msgid "There are other files in the directory with the same name,%swhich only differ in case:%s%s%sDelete them?" msgstr "÷ ËÁÔÁÌÏÇÅ ÅÓÔØ É ÄÒÕÇÉÅ ÆÁÊÌÙ Ó ÔÁËÉÍ ÖÅ ÉÍÅÎÅÍ,%sÏÔÌÉÞÁÀÝÉÅÓÑ ÔÏÌØËÏ ÒÅÇÉÓÔÒÏÍ:%s%s%sõÄÁÌÉÔØ ÉÈ?" +#: lazarusidestrconsts:lispkgmangtherearetwounitswiththesamename1from2from +msgid "There are two units with the same name:%s%s1. %s%s%s from %s%s2. %s%s%s from %s%s%s" +msgstr "" + #: lazarusidestrconsts:lispkgmangthereisacircleintherequiredpackages msgid "There is a circle in the required packages. See package graph." msgstr "ïÂÎÁÒÕÖÅÎ ÃÉËÌ ÚÁ×ÉÓÉÍÏÓÔÅÊ ÐÁËÅÔÏ×. óÍÏÔÒÉÔÅ ÄÉÁÇÒÁÍÍÕ ÐÁËÅÔÏ×." @@ -5618,6 +5630,14 @@ msgstr " msgid "There is a file with the same name and a similar extension ond disk%sFile: %s%sAmbigious File: %s%s%sDelete ambigious file?" msgstr "îÁ ÄÉÓËÅ ÅÓÔØ ÆÁÊÌ Ó ÔÁËÉÍ ÖÅ ÉÍÅÎÅÍ É ÐÏÈÏÖÉÍ ÒÁÓÛÉÒÅÎÉÅÍ%sæÁÊÌ: %s%sðÏÈÏÖÉÊ ÆÁÊÌ: %s%s%sõÄÁÌÉÔØ ×ÔÏÒÏÊ ÆÁÊÌ?" +#: lazarusidestrconsts:lispkgmangthereisafpcunitwiththesamenameasapackage +msgid "There is a FPC unit with the same name as a package:%s%s%s%s%s%s" +msgstr "" + +#: lazarusidestrconsts:lispkgmangthereisafpcunitwiththesamenamefrom +msgid "There is a FPC unit with the same name:%s%s%s%s%s from %s%s%s" +msgstr "" + #: lazarusidestrconsts:lisexttoolthereisamaximumoftools msgid "There is a maximum of %s tools." msgstr "äÏÐÕÓËÁÅÔÓÑ ÍÁËÓÉÍÕÍ %s ÉÎÓÔÒÕÍÅÎÔÏ×." @@ -5626,6 +5646,10 @@ msgstr " msgid "There is a unit with the name %s%s%s in the project.%sPlz choose a different name" msgstr "÷ ÐÒÏÅËÔÅ ÅÓÔØ ÍÏÄÕÌØ Ó ÉÍÅÎÅÍ %s%s%s.%s÷ÙÂÅÒÉÔÅ ÄÒÕÇÏÅ ÉÍÑ" +#: lazarusidestrconsts:lispkgmangthereisaunitwiththesamenameasapackage1from2 +msgid "There is a unit with the same name as a package:%s%s1. %s%s%s from %s%s2. %s%s%s%s" +msgstr "" + #: lazarusidestrconsts:listhereisalreadyaformwiththename msgid "There is already a form with the name %s%s%s" msgstr "õÖÅ ÅÓÔØ ÆÏÒÍÁ Ó ÉÍÅÎÅÍ %s%s%s" diff --git a/languages/lazaruside.ruwin.po b/languages/lazaruside.ruwin.po index f2fb547b62..c03c46fee4 100644 --- a/languages/lazaruside.ruwin.po +++ b/languages/lazaruside.ruwin.po @@ -94,6 +94,10 @@ msgstr "%s, msgid "%s/ReadOnly" msgstr "%s/òîëüêî ÷òåíèå" +#: lazarusidestrconsts:lispkgmangbothpackagesareconnectedthismeanseitheronepackageu +msgid "%sBoth packages are connected. This means, either one package uses the other, or they are both used by a third package." +msgstr "" + #: lazarusidestrconsts:lisoipdescriptiondescription msgid "%sDescription: %s" msgstr "%sÎïèñàíèå: %s" @@ -414,6 +418,10 @@ msgstr " msgid "Ambigious Unit Name" msgstr "Äâóñìûñëåííîå èìÿ ìîäóëÿ" +#: lazarusidestrconsts:lispkgmangambigiousunitsfound +msgid "Ambigious units found" +msgstr "" + #: lazarusidestrconsts:lisa2pancestortype msgid "Ancestor Type" msgstr "Òèï ïðåäêà" @@ -5610,6 +5618,10 @@ msgstr " msgid "There are other files in the directory with the same name,%swhich only differ in case:%s%s%sDelete them?" msgstr " êàòàëîãå åñòü è äðóãèå ôàéëû ñ òàêèì æå èìåíåì,%sîòëè÷àþùèåñÿ òîëüêî ðåãèñòðîì:%s%s%sÓäàëèòü èõ?" +#: lazarusidestrconsts:lispkgmangtherearetwounitswiththesamename1from2from +msgid "There are two units with the same name:%s%s1. %s%s%s from %s%s2. %s%s%s from %s%s%s" +msgstr "" + #: lazarusidestrconsts:lispkgmangthereisacircleintherequiredpackages msgid "There is a circle in the required packages. See package graph." msgstr "Îáíàðóæåí öèêë çàâèñèìîñòåé ïàêåòîâ. Ñìîòðèòå äèàãðàììó ïàêåòîâ." @@ -5618,6 +5630,14 @@ msgstr " msgid "There is a file with the same name and a similar extension ond disk%sFile: %s%sAmbigious File: %s%s%sDelete ambigious file?" msgstr "Íà äèñêå åñòü ôàéë ñ òàêèì æå èìåíåì è ïîõîæèì ðàñøèðåíèåì%sÔàéë: %s%sÏîõîæèé ôàéë: %s%s%sÓäàëèòü âòîðîé ôàéë?" +#: lazarusidestrconsts:lispkgmangthereisafpcunitwiththesamenameasapackage +msgid "There is a FPC unit with the same name as a package:%s%s%s%s%s%s" +msgstr "" + +#: lazarusidestrconsts:lispkgmangthereisafpcunitwiththesamenamefrom +msgid "There is a FPC unit with the same name:%s%s%s%s%s from %s%s%s" +msgstr "" + #: lazarusidestrconsts:lisexttoolthereisamaximumoftools msgid "There is a maximum of %s tools." msgstr "Äîïóñêàåòñÿ ìàêñèìóì %s èíñòðóìåíòîâ." @@ -5626,6 +5646,10 @@ msgstr " msgid "There is a unit with the name %s%s%s in the project.%sPlz choose a different name" msgstr " ïðîåêòå åñòü ìîäóëü ñ èìåíåì %s%s%s.%sÂûáåðèòå äðóãîå èìÿ" +#: lazarusidestrconsts:lispkgmangthereisaunitwiththesamenameasapackage1from2 +msgid "There is a unit with the same name as a package:%s%s1. %s%s%s from %s%s2. %s%s%s%s" +msgstr "" + #: lazarusidestrconsts:listhereisalreadyaformwiththename msgid "There is already a form with the name %s%s%s" msgstr "Óæå åñòü ôîðìà ñ èìåíåì %s%s%s" diff --git a/packager/packagesystem.pas b/packager/packagesystem.pas index 94631e3812..699655bcdb 100644 --- a/packager/packagesystem.pas +++ b/packager/packagesystem.pas @@ -70,6 +70,8 @@ type TPkgDeleteEvent = procedure(APackage: TLazPackage) of object; TDependencyModifiedEvent = procedure(ADependency: TPkgDependency) of object; TEndUpdateEvent = procedure(Sender: TObject; GraphChanged: boolean) of object; + TFindFPCUnitEvent = procedure(const UnitName, Directory: string; + var Filename: string) of object; TLazPackageGraph = class private @@ -134,6 +136,12 @@ type FirstDependency: TPkgDependency; var File1, File2: TPkgFile; var ConflictPkg: TLazPackage): boolean; + function FindFPCConflictUnit(APackage: TLazPackage; + FirstDependency: TPkgDependency; + const Directory: string; + OnFindFPCUnit: TFindFPCUnitEvent; + var File1: TPkgFile; + var ConflictPkg: TLazPackage): boolean; function FindFileInAllPackages(const TheFilename: string; ResolveLinks, IgnoreDeleted: boolean): TPkgFile; function FindLowestPkgNodeByName(const PkgName: string): TAVLTreeNode; @@ -1273,17 +1281,10 @@ function TLazPackageGraph.FindUnsavedDependencyPath(APackage: TLazPackage; end; end; -var - i: Integer; - Pkg: TLazPackage; begin Result:=nil; if (Count=0) or (APackage=nil) then exit; - // mark all packages as not visited - for i:=FItems.Count-1 downto 0 do begin - Pkg:=TLazPackage(FItems[i]); - Pkg.Flags:=Pkg.Flags-[lpfVisited]; - end; + MarkAllPackagesAsNotVisited; if APackage<>nil then begin APackage.Flags:=APackage.Flags+[lpfVisited]; FirstDependency:=APackage.FirstRequiredDependency; @@ -1449,6 +1450,68 @@ begin Result:=false; end; +function TLazPackageGraph.FindFPCConflictUnit(APackage: TLazPackage; + FirstDependency: TPkgDependency; const Directory: string; + OnFindFPCUnit: TFindFPCUnitEvent; + var File1: TPkgFile; var ConflictPkg: TLazPackage): boolean; + + function CheckUnitName(const AnUnitName: string): boolean; + var Filename: string; + begin + Result:=false; + if AnUnitName='' then exit; + OnFindFPCUnit(AnUnitName,Directory,Filename); + Result:=Filename<>''; + end; + + function CheckDependencyList(ADependency: TPkgDependency): boolean; forward; + + function CheckPackage(Pkg1: TLazPackage): boolean; + var + Cnt: Integer; + i: Integer; + begin + Result:=false; + if (Pkg1=nil) or (lpfVisited in Pkg1.Flags) + or (Pkg1=FFCLPackage) then exit; + Pkg1.Flags:=Pkg1.Flags+[lpfVisited]; + Result:=CheckUnitName(Pkg1.Name); + if Result then begin + ConflictPkg:=Pkg1; + exit; + end; + Cnt:=Pkg1.FileCount; + for i:=0 to Cnt-1 do begin + Result:=CheckUnitName(Pkg1.Files[i].UnitName); + if Result then begin + File1:=Pkg1.Files[i]; + exit; + end; + end; + Result:=CheckDependencyList(Pkg1.FirstRequiredDependency); + end; + + function CheckDependencyList(ADependency: TPkgDependency): boolean; + begin + Result:=false; + while ADependency<>nil do begin + Result:=CheckPackage(ADependency.RequiredPackage); + if Result then exit; + ADependency:=ADependency.NextDependency[pdlRequires]; + end; + end; + +begin + Result:=false; + File1:=nil; + ConflictPkg:=nil; + MarkAllPackagesAsNotVisited; + if APackage<>nil then + Result:=CheckPackage(APackage) + else + Result:=CheckDependencyList(FirstDependency); +end; + function TLazPackageGraph.GetAutoCompilationOrder(APackage: TLazPackage; FirstDependency: TPkgDependency; Policies: TPackageUpdatePolicies): TList; // Returns all required auto update packages, including indirect requirements. @@ -2021,3 +2084,4 @@ initialization end. + diff --git a/packager/pkgmanager.pas b/packager/pkgmanager.pas index 38dbf3e288..494921aa5d 100644 --- a/packager/pkgmanager.pas +++ b/packager/pkgmanager.pas @@ -94,6 +94,8 @@ type procedure PackageGraphDeletePackage(APackage: TLazPackage); procedure PackageGraphDependencyModified(ADependency: TPkgDependency); procedure PackageGraphEndUpdate(Sender: TObject; GraphChanged: boolean); + procedure PackageGraphFindFPCUnit(const UnitName, Directory: string; + var Filename: string); // menu procedure MainIDEitmPkgOpenPackageFileClick(Sender: TObject); @@ -121,7 +123,8 @@ type FirstDependency: TPkgDependency; Policies: TPackageUpdatePolicies): TModalResult; function CheckPackageGraphForCompilation(APackage: TLazPackage; - FirstDependency: TPkgDependency): TModalResult; + FirstDependency: TPkgDependency; + const Directory: string): TModalResult; function DoPreparePackageOutputDirectory(APackage: TLazPackage): TModalResult; function DoSavePackageCompiledState(APackage: TLazPackage; const CompilerFilename, CompilerParams: string): TModalResult; @@ -486,6 +489,12 @@ begin end; end; +procedure TPkgManager.PackageGraphFindFPCUnit(const UnitName, + Directory: string; var Filename: string); +begin + Filename:=CodeToolBoss.DefineTree.FindUnitInUnitLinks(UnitName,Directory,true); +end; + procedure TPkgManager.mnuConfigCustomCompsClicked(Sender: TObject); begin ShowConfigureCustomComponents; @@ -736,7 +745,7 @@ begin end; function TPkgManager.CheckPackageGraphForCompilation(APackage: TLazPackage; - FirstDependency: TPkgDependency): TModalResult; + FirstDependency: TPkgDependency; const Directory: string): TModalResult; var PathList: TList; Dependency: TPkgDependency; @@ -793,26 +802,42 @@ begin exit; end; - // check for ambigious units + // check for ambigious units between packages if PackageGraph.FindAmbigiousUnits(APackage,FirstDependency, PkgFile1,PkgFile2,ConflictPkg) then begin - if PkgFile2<>nil then begin - s:='There are two units with the same name:'#13 - +#13 - +'1. "'+PkgFile1.Filename+'" from '+PkgFile1.LazPackage.IDAsString+#13 - +'2. "'+PkgFile2.Filename+'" from '+PkgFile2.LazPackage.IDAsString+#13 - +#13; - end else begin - s:='There is a unit with the same name as a package:'#13 - +#13 - +'1. "'+PkgFile1.Filename+'" from '+PkgFile1.LazPackage.IDAsString+#13 - +'2. "'+ConflictPkg.IDAsString+#13 - +#13; - end; - Result:=MessageDlg('Ambigious units found',s - +'Both packages are connected. This means, either one package uses ' - +'the other, or they are both used by a third package.', + if (PkgFile1<>nil) and (PkgFile2<>nil) then begin + s:=Format(lisPkgMangThereAreTwoUnitsWithTheSameName1From2From, [#13, + #13, '"', PkgFile1.Filename, '"', PkgFile1.LazPackage.IDAsString, + #13, '"', PkgFile2.Filename, '"', PkgFile2.LazPackage.IDAsString, + #13, #13]); + end else if (PkgFile1<>nil) and (ConflictPkg<>nil) then begin + s:=Format(lisPkgMangThereIsAUnitWithTheSameNameAsAPackage1From2, [#13, + #13, '"', PkgFile1.Filename, '"', PkgFile1.LazPackage.IDAsString, + #13, '"', ConflictPkg.IDAsString, #13, #13]); + end else + s:='Internal inconsistency FindAmbigiousUnits: ' + +'Please report this bug and how you get here.'#13; + Result:=MessageDlg(lisPkgMangAmbigiousUnitsFound, Format( + lisPkgMangBothPackagesAreConnectedThisMeansEitherOnePackageU, [s]), + mtError,[mbCancel,mbAbort],0); + exit; + end; + + // check for ambigious units between packages + if PackageGraph.FindFPCConflictUnit(APackage,FirstDependency,Directory, + @PackageGraphFindFPCUnit,PkgFile1,ConflictPkg) + then begin + if (PkgFile1<>nil) then begin + s:=Format(lisPkgMangThereIsAFPCUnitWithTheSameNameFrom, [#13, #13, '"', + PkgFile1.Filename, '"', PkgFile1.LazPackage.IDAsString, #13, #13]); + end else if (PkgFile1<>nil) and (ConflictPkg<>nil) then begin + s:=Format(lisPkgMangThereIsAFPCUnitWithTheSameNameAsAPackage, [#13, + #13, '"', ConflictPkg.IDAsString, #13, #13]); + end else + s:='Internal inconsistency FindFPCConflictUnits: ' + +'Please report this bug and how you get here.'#13; + Result:=MessageDlg(lisPkgMangAmbigiousUnitsFound, s, mtError,[mbCancel,mbAbort],0); exit; end; @@ -1929,7 +1954,8 @@ begin // check graph for circles and broken dependencies if not (pcfDoNotCompileDependencies in Flags) then begin Result:=CheckPackageGraphForCompilation(nil, - AProject.FirstRequiredDependency); + AProject.FirstRequiredDependency, + AProject.ProjectDirectory); if Result<>mrOk then exit; end; @@ -1975,7 +2001,7 @@ begin // check graph for circles and broken dependencies if not (pcfDoNotCompileDependencies in Flags) then begin - Result:=CheckPackageGraphForCompilation(APackage,nil); + Result:=CheckPackageGraphForCompilation(APackage,nil,APackage.Directory); if Result<>mrOk then exit; end; @@ -2390,7 +2416,8 @@ begin end; // check consistency - Result:=CheckPackageGraphForCompilation(APackage,nil); + Result:=CheckPackageGraphForCompilation(APackage,nil, + EnvironmentOptions.LazarusDirectory); if Result<>mrOk then exit; // get all required packages, which will also be auto installed @@ -2546,7 +2573,8 @@ begin end; // check consistency - Result:=CheckPackageGraphForCompilation(nil,FirstAutoInstallDependency); + Result:=CheckPackageGraphForCompilation(nil,FirstAutoInstallDependency, + EnvironmentOptions.LazarusDirectory); if Result<>mrOk then exit; // save all open files