diff options
| author | joost <joost@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2011-02-15 15:56:21 +0000 |
|---|---|---|
| committer | joost <joost@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2011-02-15 15:56:21 +0000 |
| commit | 1044b044b4ebf5e9fcee3e918645ed35fc0b2c5b (patch) | |
| tree | ecc9ea019b18ce3d1105f64aad23beef73f73a15 /packages/fpmkunit | |
| parent | 16fc8270fba3c5f569151c63c99287d5ad009780 (diff) | |
| download | fpc-1044b044b4ebf5e9fcee3e918645ed35fc0b2c5b.tar.gz | |
* Store the location of the original source when installing a package
* Store the used options to install a package in fpunits.conf
* When a package is re-installed because of broken dependencies, use the stored
source-path and options if possible
* When installing a package from the current directory, make sure the right
directory is used. It could be changed while installing dependencies.
git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@16918 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'packages/fpmkunit')
| -rw-r--r-- | packages/fpmkunit/src/fpmkunit.pp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/packages/fpmkunit/src/fpmkunit.pp b/packages/fpmkunit/src/fpmkunit.pp index bdb7173f42..64485893e8 100644 --- a/packages/fpmkunit/src/fpmkunit.pp +++ b/packages/fpmkunit/src/fpmkunit.pp @@ -869,6 +869,7 @@ Type FRunMode: TRunMode; FListMode : Boolean; FLogLevels : TVerboseLevels; + FFPMakeOptionsString: string; Protected Procedure Log(Level : TVerboseLevel; Const Msg : String); Procedure CreatePackages; virtual; @@ -891,6 +892,7 @@ Type Destructor destroy; override; Function AddPackage(Const AName : String) : TPackage; Function Run : Boolean; + Property FPMakeOptionsString: string read FFPMakeOptionsString; //files in package Property Packages : TPackages Read GetPackages; Property RunMode : TRunMode Read FRunMode; @@ -1145,6 +1147,8 @@ Const KeyNeedLibC = 'NeedLibC'; KeyDepends = 'Depends'; KeyAddIn = 'FPMakeAddIn'; + KeySourcePath = 'SourcePath'; + KeyFPMakeOptions = 'FPMakeOptions'; {**************************************************************************** Helpers @@ -2553,6 +2557,9 @@ begin Values[KeyChecksum]:=IntToStr(DateTimeToFileDate(Now)); Values[KeyCPU]:=CPUToString(ACPU); Values[KeyOS]:=OSToString(AOS); + //Installer; + Values[KeySourcePath]:=IncludeTrailingPathDelimiter(IncludeTrailingPathDelimiter(Installer.BuildEngine.FStartDir)+Directory); + Values[KeyFPMakeOptions]:=trim(Installer.FPMakeOptionsString); Deps:=''; for i:=0 to Dependencies.Count-1 do begin @@ -3130,12 +3137,13 @@ end; procedure TCustomInstaller.AnalyzeOptions; - Function CheckOption(Index : Integer;const Short,Long : String): Boolean; + Function CheckOption(Index : Integer;const Short,Long : String; AddToOptionString: boolean = true): Boolean; var O : String; begin O:=Paramstr(Index); Result:=(O='-'+short) or (O='--'+long) or (copy(O,1,Length(Long)+3)=('--'+long+'=')); + if AddToOptionString and Result then FFPMakeOptionsString := FFPMakeOptionsString+' '+O; end; Function CheckCustomOption(Index : Integer; out CustOptName: string): Boolean; @@ -3154,6 +3162,7 @@ procedure TCustomInstaller.AnalyzeOptions; O:=copy(O,3,i-3); CustOptName:=O; Result:=CustomFpmakeCommandlineOptions.IndexOfName(O)>-1; + if Result then FFPMakeOptionsString := FFPMakeOptionsString+' '+Paramstr(Index); end; @@ -3220,9 +3229,9 @@ begin While (I<ParamCount) do begin Inc(I); - if CheckOption(I,'v','verbose') then + if CheckOption(I,'v','verbose',false) then FLogLevels:=AllMessages - else if CheckOption(I,'d','debug') then + else if CheckOption(I,'d','debug',false) then FLogLevels:=AllMessages+[vlDebug] else if CheckCommand(I,'m','compile') then FRunMode:=rmCompile |
