From 01f30a52b83ab6771542ce9bea274fd056d00cb8 Mon Sep 17 00:00:00 2001 From: maxim Date: Tue, 19 Jul 2016 22:20:26 +0000 Subject: [PATCH] Merged revision(s) 52692 #800f13923b from trunk: Packager: Don't add unit or include search path '.' when adding a file to a package. ........ git-svn-id: branches/fixes_1_6@52720 - --- packager/packagedefs.pas | 42 ++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/packager/packagedefs.pas b/packager/packagedefs.pas index 3760ea8ef0..293e4b15e4 100644 --- a/packager/packagedefs.pas +++ b/packager/packagedefs.pas @@ -3175,21 +3175,21 @@ var CurUnitPaths: String; r: TModalResult; begin + Result:=True; CurUnitPaths:=CompilerOptions.ParsedOpts.GetParsedValue(pcosUnitPath); NewUnitPaths:=RemoveSearchPaths(NewUnitPaths,CurUnitPaths); - if NewUnitPaths<>'' then begin - NewUnitPaths:=CreateRelativeSearchPath(NewUnitPaths,Directory); - r:=IDEMessageDialog(lisExtendUnitPath, - Format(lisExtendUnitSearchPathOfPackageWith, [Name, #13, - NewUnitPaths]), mtConfirmation, [mbYes, mbNo, mbCancel]); - case r of + if NewUnitPaths='' then Exit; + NewUnitPaths:=CreateRelativeSearchPath(NewUnitPaths,Directory); + if NewUnitPaths='.' then Exit; + r:=IDEMessageDialog(lisExtendUnitPath, + Format(lisExtendUnitSearchPathOfPackageWith, [Name, #13, NewUnitPaths]), + mtConfirmation, [mbYes, mbNo, mbCancel]); + case r of mrYes: CompilerOptions.OtherUnitFiles:= MergeSearchPaths(CompilerOptions.OtherUnitFiles,NewUnitPaths); mrNo: ; - else exit(false); - end; + else exit(false); end; - Result:=true; end; function TLazPackage.ExtendIncSearchPath(NewIncPaths: string): boolean; @@ -3197,21 +3197,21 @@ var CurIncPaths: String; r: TModalResult; begin + Result:=True; CurIncPaths:=CompilerOptions.ParsedOpts.GetParsedValue(pcosIncludePath); NewIncPaths:=RemoveSearchPaths(NewIncPaths,CurIncPaths); - if NewIncPaths<>'' then begin - NewIncPaths:=CreateRelativeSearchPath(NewIncPaths,Directory); - r:=IDEMessageDialog(lisExtendIncludePath, - Format(lisExtendIncludeFileSearchPathOfPackageWith, [Name, #13, - NewIncPaths]), mtConfirmation, [mbYes, mbNo, mbCancel]); - case r of - mrYes: CompilerOptions.IncludePath:= - MergeSearchPaths(CompilerOptions.IncludePath,NewIncPaths); - mrNo: ; - else exit(false); - end; + if NewIncPaths='' then Exit; + NewIncPaths:=CreateRelativeSearchPath(NewIncPaths,Directory); + if NewIncPaths='.' then Exit; + r:=IDEMessageDialog(lisExtendIncludePath, + Format(lisExtendIncludeFileSearchPathOfPackageWith, [Name, #13, NewIncPaths]), + mtConfirmation, [mbYes, mbNo, mbCancel]); + case r of + mrYes: CompilerOptions.IncludePath:= + MergeSearchPaths(CompilerOptions.IncludePath,NewIncPaths); + mrNo: ; + else exit(false); end; - Result:=true; end; function TLazPackage.IndexOfPkgComponent(PkgComponent: TPkgComponent): integer;