Components: fixed Lazarus Package Manager compilation with FPC >= 2.6.3

git-svn-id: trunk@43371 -
This commit is contained in:
maxim 2013-11-04 13:23:38 +00:00
parent 2937458fa6
commit 14551314c1
4 changed files with 46 additions and 9 deletions

View File

@ -158,10 +158,17 @@ begin
exit;
Prefix:='';
case Level of
{$IF FPC_FULLVERSION > 20602}
llWarning :
Prefix:=SWarning;
llError :
Prefix:=SError;
{$ELSE}
vlWarning :
Prefix:=SWarning;
vlError :
Prefix:=SError;
{$ENDIF}
{ vlInfo :
Prefix:='I: ';
vlCommands :
@ -574,7 +581,7 @@ begin
CompilerOptions.UpdateLocalRepositoryOption;
if FileExists(S) then
begin
pkgglobals.Log(vlDebug, SLogLoadingCompilerConfig, [S]);
pkgglobals.Log({$IF FPC_FULLVERSION > 20602}llDebug{$ELSE}vlDebug{$ENDIF}, SLogLoadingCompilerConfig, [S]);
CompilerOptions.LoadCompilerFromFile(S);
end
else
@ -582,7 +589,7 @@ begin
// Generate a default configuration if it doesn't exists
if GlobalOptions.CompilerConfig = 'default' then
begin
pkgglobals.Log(vlDebug, SLogGeneratingCompilerConfig, [S]);
pkgglobals.Log({$IF FPC_FULLVERSION > 20602}llDebug{$ELSE}vlDebug{$ENDIF}, SLogGeneratingCompilerConfig, [S]);
CompilerOptions.InitCompilerDefaults;
CompilerOptions.SaveCompilerToFile(S);
if CompilerOptions.SaveInifileChanges then
@ -592,13 +599,13 @@ begin
Error(SErrMissingCompilerConfig, [S]);
end;
// Log compiler configuration
CompilerOptions.LogValues(vlDebug, '');
CompilerOptions.LogValues({$IF FPC_FULLVERSION > 20602}llDebug{$ELSE}vlDebug{$ENDIF}, '');
// Load FPMake compiler config, this is normally the same config as above
S := GlobalOptions.CompilerConfigDir + GlobalOptions.FPMakeCompilerConfig;
FPMakeCompilerOptions.UpdateLocalRepositoryOption;
if FileExists(S) then
begin
pkgglobals.Log(vlDebug, SLogLoadingFPMakeCompilerConfig, [S]);
pkgglobals.Log({$IF FPC_FULLVERSION > 20602}llDebug{$ELSE}vlDebug{$ENDIF}, SLogLoadingFPMakeCompilerConfig, [S]);
FPMakeCompilerOptions.LoadCompilerFromFile(S);
if FPMakeCompilerOptions.SaveInifileChanges then
FPMakeCompilerOptions.SaveCompilerToFile(S);
@ -606,7 +613,7 @@ begin
else
Error(SErrMissingCompilerConfig, [S]);
// Log compiler configuration
FPMakeCompilerOptions.LogValues(vlDebug, 'fpmake-building ');
FPMakeCompilerOptions.LogValues({$IF FPC_FULLVERSION > 20602}llDebug{$ELSE}vlDebug{$ENDIF}, 'fpmake-building ');
end;
procedure TFppkgForm.DoRun(cfg: TFppkgConfigOptions; ParaAction: string;
@ -660,7 +667,7 @@ begin
laz_pkghandler.Laz_ExecuteAction('', 'laz_update');
except
on E: Exception do
pkgglobals.Log(vlWarning, E.Message);
pkgglobals.Log({$IF FPC_FULLVERSION > 20602}llWarning{$ELSE}vlWarning{$ENDIF}, E.Message);
end;
end;
LoadLocalAvailableRepository;
@ -677,7 +684,7 @@ begin
(ParaAction = 'laz_compile') or (ParaAction = 'laz_build') or
(ParaAction = 'laz_install') or (ParaAction = 'laz_archive')) then
begin
pkgglobals.Log(vlDebug, SLogCheckBrokenDependenvies);
pkgglobals.Log({$IF FPC_FULLVERSION > 20602}llDebug{$ELSE}vlDebug{$ENDIF}, SLogCheckBrokenDependenvies);
SL := TStringList.Create;
if FindBrokenPackages(SL) then
Error(SErrBrokenPackagesFound);
@ -703,7 +710,7 @@ begin
end
else
begin
pkgglobals.Log(vlDebug, SLogCommandLineAction,['[' + ParaPackages[i] + ']', ParaAction]);
pkgglobals.Log({$IF FPC_FULLVERSION > 20602}llDebug{$ELSE}vlDebug{$ENDIF}, SLogCommandLineAction,['[' + ParaPackages[i] + ']', ParaAction]);
laz_pkghandler.Laz_ExecuteAction(ParaPackages[i], ParaAction);
end;
end;

View File

@ -279,12 +279,21 @@ begin
//setup verbosity
with VerbosityCheckGroup do
begin
{$IF FPC_FULLVERSION > 20602}
Checked[Items.IndexOf('Error')] := llError in LazPkgOptions.Verbosity;
Checked[Items.IndexOf('Warning')] := llWarning in LazPkgOptions.Verbosity;
Checked[Items.IndexOf('Info')] := llInfo in LazPkgOptions.Verbosity;
Checked[Items.IndexOf('Commands')] := llCommands in LazPkgOptions.Verbosity;
Checked[Items.IndexOf('Debug')] := llDebug in LazPkgOptions.Verbosity;
Checked[Items.IndexOf('Progress')] := llProgres in LazPkgOptions.Verbosity;
{$ELSE}
Checked[Items.IndexOf('Error')] := vlError in LazPkgOptions.Verbosity;
Checked[Items.IndexOf('Warning')] := vlWarning in LazPkgOptions.Verbosity;
Checked[Items.IndexOf('Info')] := vlInfo in LazPkgOptions.Verbosity;
Checked[Items.IndexOf('Commands')] := vlCommands in LazPkgOptions.Verbosity;
Checked[Items.IndexOf('Debug')] := vlDebug in LazPkgOptions.Verbosity;
Checked[Items.IndexOf('Progress')] := vlProgres in LazPkgOptions.Verbosity;
{$ENDIF}
end;
end;
@ -296,6 +305,20 @@ begin
LazPkgOptions.Verbosity := [];
with VerbosityCheckGroup do
begin
{$IF FPC_FULLVERSION > 20602}
if Checked[Items.IndexOf('Error')] then
LazPkgOptions.Verbosity := LazPkgOptions.Verbosity + [llError];
if Checked[Items.IndexOf('Warning')] then
LazPkgOptions.Verbosity := LazPkgOptions.Verbosity + [llWarning];
if Checked[Items.IndexOf('Info')] then
LazPkgOptions.Verbosity := LazPkgOptions.Verbosity + [llInfo];
if Checked[Items.IndexOf('Commands')] then
LazPkgOptions.Verbosity := LazPkgOptions.Verbosity + [llCommands];
if Checked[Items.IndexOf('Debug')] then
LazPkgOptions.Verbosity := LazPkgOptions.Verbosity + [llDebug];
if Checked[Items.IndexOf('Progress')] then
LazPkgOptions.Verbosity := LazPkgOptions.Verbosity + [llProgres];
{$ELSE}
if Checked[Items.IndexOf('Error')] then
LazPkgOptions.Verbosity := LazPkgOptions.Verbosity + [vlError];
if Checked[Items.IndexOf('Warning')] then
@ -308,6 +331,7 @@ begin
LazPkgOptions.Verbosity := LazPkgOptions.Verbosity + [vlDebug];
if Checked[Items.IndexOf('Progress')] then
LazPkgOptions.Verbosity := LazPkgOptions.Verbosity + [vlProgres];
{$ENDIF}
end;
Close;

View File

@ -19,9 +19,15 @@ begin
pkghandlerclass:=GetPkgHandler(AAction);
With pkghandlerclass.Create(nil,APackageName) do
try
{$IF FPC_FULLVERSION > 20602}
Log(llDebug,SLogRunAction+' start',[AAction]);
Execute;
Log(llDebug,SLogRunAction+' end',[AAction]);
{$ELSE}
Log(vlDebug,SLogRunAction+' start',[AAction]);
Execute;
Log(vlDebug,SLogRunAction+' end',[AAction]);
{$ENDIF}
finally
Free;
end;

View File

@ -6,7 +6,7 @@ interface
uses
SysUtils, Classes, ComCtrls,
fprepos;
fprepos{$IF FPC_FULLVERSION > 20602}, fpmkunit{$ENDIF};
type