diff --git a/ide/lazbuild.lpr b/ide/lazbuild.lpr index ec5760fe65..472a4871f3 100644 --- a/ide/lazbuild.lpr +++ b/ide/lazbuild.lpr @@ -420,10 +420,6 @@ begin MainBuildBoss.SetBuildTargetIDE; Flags:=[]; - // try loading install packages - PackageGraph.LoadStaticBasePackages; - PackageGraph.LoadAutoInstallPackages(BuildLazOptions.StaticAutoInstallPackages); - // save target directory TargetDir:=MiscellaneousOptions.BuildLazOpts.TargetDirectory; IDEMacros.SubstituteMacros(TargetDir); diff --git a/packager/packagesystem.pas b/packager/packagesystem.pas index 8ff1eaf584..f06e0a0805 100644 --- a/packager/packagesystem.pas +++ b/packager/packagesystem.pas @@ -292,7 +292,6 @@ type public // installed packages FirstAutoInstallDependency: TPkgDependency; - procedure AddStaticBasePackagesOld; procedure LoadStaticBasePackages; procedure LoadAutoInstallPackages(PkgList: TStringList); procedure SortAutoInstallDependencies; @@ -1818,6 +1817,10 @@ procedure TLazPackageGraph.LoadStaticBasePackages; Dependency: TPkgDependency; Quiet: Boolean; begin + if FindDependencyByNameInList(FirstAutoInstallDependency,pdlRequires, + PkgName)<>nil + then + exit; Dependency:=TPkgDependency.Create; Dependency.Owner:=Self; Dependency.PackageName:=PkgName; @@ -1833,7 +1836,8 @@ begin LoadLazarusBasePackage('SynEdit'); LoadLazarusBasePackage('CodeTools'); // the default package will be added on demand - FDefaultPackage:=CreateDefaultPackage; + if FDefaultPackage=nil then + FDefaultPackage:=CreateDefaultPackage; SortAutoInstallDependencies; @@ -3180,11 +3184,6 @@ begin Result:=mrOK; end; -procedure TLazPackageGraph.AddStaticBasePackagesOld; -begin - -end; - function TLazPackageGraph.PreparePackageOutputDirectory(APackage: TLazPackage; CleanUp: boolean): TModalResult; var diff --git a/packager/pkgmanager.pas b/packager/pkgmanager.pas index 4b0859763e..31f37e775d 100644 --- a/packager/pkgmanager.pas +++ b/packager/pkgmanager.pas @@ -1686,11 +1686,16 @@ begin PackageGraph.OpenInstalledDependency(NewDependency,pitStatic,Quiet); Result:=NewDependency.RequiredPackage; if AddToAutoInstall and (Result<>nil) then begin - NewDependency.AddToList(PackageGraph.FirstAutoInstallDependency,pdlRequires); + if FindDependencyByNameInList( + PackageGraph.FirstAutoInstallDependency,pdlRequires,PackageName)=nil + then begin + NewDependency.RequiredPackage.AutoInstall:=pitStatic; + NewDependency.AddToList(PackageGraph.FirstAutoInstallDependency,pdlRequires) + end else + NewDependency.Free; PackageList:=MiscellaneousOptions.BuildLazOpts.StaticAutoInstallPackages; - if PackageList.IndexOf(NewDependency.PackageName)<0 then - PackageList.Add(NewDependency.PackageName); - NewDependency.RequiredPackage.AutoInstall:=pitStatic; + if PackageList.IndexOf(PackageName)<0 then + PackageList.Add(PackageName); end else begin NewDependency.Free; end;