mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 04:49:19 +02:00
IDE, startlazarus, buildlazarus: Ensure params (long vs short version) from command-line override lazarus.cfg (last given on command line will be taken). Issue #0034069
git-svn-id: trunk@58696 -
This commit is contained in:
parent
aa9cfe7f1a
commit
9c5d04d5dc
@ -108,6 +108,19 @@ begin
|
||||
end;
|
||||
|
||||
function GetParamsAndCfgFile: TStrings;
|
||||
procedure CleanDuplicates(ACurParam, AMatch, AClean: String);
|
||||
var
|
||||
i: Integer;
|
||||
begin
|
||||
if LowerCase(copy(ACurParam, 1, Length(AMatch))) = LowerCase(AMatch) then begin
|
||||
i := ParamsAndCfgFileContent.Count - 1;
|
||||
while i >= 0 do begin
|
||||
if LowerCase(copy(ParamsAndCfgFileContent[i], 1, Length(AClean))) = LowerCase(AClean) then
|
||||
ParamsAndCfgFileContent.Delete(i);
|
||||
dec(i);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
var
|
||||
Cfg: TStrings;
|
||||
i: Integer;
|
||||
@ -146,8 +159,20 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
for i := 1 to Paramcount do
|
||||
ParamsAndCfgFileContent.Add(ParamStrUTF8(i));
|
||||
for i := 1 to Paramcount do begin
|
||||
s := ParamStrUTF8(i);
|
||||
CleanDuplicates(s, PrimaryConfPathOptLong, PrimaryConfPathOptLong);
|
||||
CleanDuplicates(s, PrimaryConfPathOptLong, PrimaryConfPathOptShort);
|
||||
CleanDuplicates(s, PrimaryConfPathOptShort, PrimaryConfPathOptLong);
|
||||
CleanDuplicates(s, PrimaryConfPathOptShort, PrimaryConfPathOptShort);
|
||||
CleanDuplicates(s, SecondaryConfPathOptLong, SecondaryConfPathOptLong);
|
||||
CleanDuplicates(s, SecondaryConfPathOptLong, SecondaryConfPathOptShort);
|
||||
CleanDuplicates(s, SecondaryConfPathOptShort, SecondaryConfPathOptLong);
|
||||
CleanDuplicates(s, SecondaryConfPathOptShort, SecondaryConfPathOptShort);
|
||||
CleanDuplicates(s, LanguageOpt, LanguageOpt);
|
||||
CleanDuplicates(s, LazarusDirOpt, LazarusDirOpt);
|
||||
ParamsAndCfgFileContent.Add(s);
|
||||
end;
|
||||
|
||||
Result := ParamsAndCfgFileContent;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user