From 7ab46e8507f87183cd3d9b1ac2113c5539b7686b Mon Sep 17 00:00:00 2001 From: peter Date: Sun, 3 Feb 2008 15:16:13 +0000 Subject: [PATCH] * basic work to load installed versions from fpunits.conf git-svn-id: trunk@10182 - --- utils/fppkg/fppkg.lpi | 97 ++++++++++++++------------------------- utils/fppkg/fppkg.pp | 3 +- utils/fppkg/pkgoptions.pp | 1 + utils/fppkg/pkgrepos.pp | 83 +++++++++++++++++++++++++++++++++ 4 files changed, 119 insertions(+), 65 deletions(-) diff --git a/utils/fppkg/fppkg.lpi b/utils/fppkg/fppkg.lpi index f4273de2d3..55cb9a545f 100644 --- a/utils/fppkg/fppkg.lpi +++ b/utils/fppkg/fppkg.lpi @@ -12,7 +12,7 @@ - + @@ -28,17 +28,17 @@ - + - + - - + + @@ -75,8 +75,8 @@ - - + + @@ -205,8 +205,8 @@ - - + + @@ -276,7 +276,7 @@ - + @@ -321,76 +321,47 @@ + + + + + + + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/utils/fppkg/fppkg.pp b/utils/fppkg/fppkg.pp index 402f70c612..a8652625d3 100644 --- a/utils/fppkg/fppkg.pp +++ b/utils/fppkg/fppkg.pp @@ -310,8 +310,7 @@ begin begin if FileExists(ParaPackages[i]) then begin - ActionPackage:=TFPPackage.Create(nil); - ActionPackage.Name:=ChangeFileExt(ExtractFileName(ParaPackages[i]),''); + ActionPackage:=CurrentRepository.AddPackage(ChangeFileExt(ExtractFileName(ParaPackages[i]),'')); ActionPackage.FileName:=ExpandFileName(ParaPackages[i]); ActionPackage.IsLocalPackage:=true; end diff --git a/utils/fppkg/pkgoptions.pp b/utils/fppkg/pkgoptions.pp index fab065fe60..c4c456ece9 100644 --- a/utils/fppkg/pkgoptions.pp +++ b/utils/fppkg/pkgoptions.pp @@ -19,6 +19,7 @@ interface uses Classes, Sysutils, Inifiles, fprepos; Const + UnitConfigFileName = 'fpunits.conf'; ManifestFileName = 'manifest.xml'; MirrorsFileName = 'mirrors.xml'; PackagesFileName = 'packages.xml'; diff --git a/utils/fppkg/pkgrepos.pp b/utils/fppkg/pkgrepos.pp index 7aab3d2b53..5ee11d4411 100644 --- a/utils/fppkg/pkgrepos.pp +++ b/utils/fppkg/pkgrepos.pp @@ -165,15 +165,94 @@ begin end; +procedure LoadLocalStatus(ACompilerOptions:TCompilerOptions); + + procedure LoadUnitConfigFromFile(APackage:TFPPackage;const AFileName: String); + Var + L,L2 : TStrings; + Line : String; + I,P,PC : Integer; + VOS : TOS; + VCPU : TCPU; + V : String; + F : TFileStream; + begin + F:=TFileStream.Create(AFileName,fmOpenRead); + L:=TStringList.Create; + Try + L.LoadFromStream(F); + // Fix lines. + For I:=L.Count-1 downto 0 do + begin + Line:=L[I]; + P:=Pos('=',Line); + PC:=Pos(';',Line); // Comment line. + If (P=0) or ((PC<>0) and (PC0; + end; + end; + +begin + if ACompilerOptions.LocalUnitDir<>'' then + CheckUnitDir(ACompilerOptions.LocalUnitDir); +// if ACompilerOptions.GlobalUnitDir<>'' then +// CheckUnitDir(ACompilerOptions.GlobalUnitDir); +end; + + procedure LoadLocalStatus; var S : String; begin + LoadLocalStatus(CompilerOptions); +{ S:=GlobalOptions.LocalVersionsFile(GlobalOptions.CompilerConfig); Log(vlDebug,SLogLoadingStatusFile,[S]); CurrentRepository.ClearStatus; if FileExists(S) then CurrentRepository.LoadStatusFromFile(S); +} end; @@ -194,11 +273,15 @@ var P : TFPPackage; ReqVer : TFPVersion; begin +{ S:=GlobalOptions.LocalVersionsFile(GlobalOptions.FPMakeCompilerConfig); Log(vlDebug,SLogLoadingStatusFile,[S]); CurrentRepository.ClearStatus; if FileExists(S) then CurrentRepository.LoadStatusFromFile(S); +} + LoadLocalStatus(FPMakeCompilerOptions); + // Check for fpmkunit dependencies for i:=1 to FPMKUnitDepCount do begin