|
@@ -31,6 +31,7 @@ Type
|
|
|
|
|
|
{ TFppkgOptionSection }
|
|
{ TFppkgOptionSection }
|
|
|
|
|
|
|
|
+ TCompilerOptions = class;
|
|
TFppkgOptionSection = class(TPersistent)
|
|
TFppkgOptionSection = class(TPersistent)
|
|
private
|
|
private
|
|
FOptionParser: TTemplateParser;
|
|
FOptionParser: TTemplateParser;
|
|
@@ -127,6 +128,8 @@ Type
|
|
procedure LogValues(ALogLevel: TLogLevel); override;
|
|
procedure LogValues(ALogLevel: TLogLevel); override;
|
|
function AllowDuplicate: Boolean; override;
|
|
function AllowDuplicate: Boolean; override;
|
|
|
|
|
|
|
|
+ function InitRepository(AParent: TComponent; ACompilerOptions: TCompilerOptions): TFPRepository; virtual;
|
|
|
|
+
|
|
property RepositoryName: string read FRepositoryName write SetRepositoryName;
|
|
property RepositoryName: string read FRepositoryName write SetRepositoryName;
|
|
property Description: string read FDescription write SetDescription;
|
|
property Description: string read FDescription write SetDescription;
|
|
property Path: string read GetPath write SetPath;
|
|
property Path: string read GetPath write SetPath;
|
|
@@ -158,7 +161,6 @@ Type
|
|
|
|
|
|
{ TFppkgOptions }
|
|
{ TFppkgOptions }
|
|
|
|
|
|
- TCompilerOptions = class;
|
|
|
|
TFppkgOptions = class(TPersistent)
|
|
TFppkgOptions = class(TPersistent)
|
|
private
|
|
private
|
|
FOptionParser: TTemplateParser;
|
|
FOptionParser: TTemplateParser;
|
|
@@ -234,6 +236,8 @@ Type
|
|
Implementation
|
|
Implementation
|
|
|
|
|
|
uses
|
|
uses
|
|
|
|
+ pkgUninstalledSourcesRepository,
|
|
|
|
+ pkgPackagesStructure,
|
|
pkgmessages;
|
|
pkgmessages;
|
|
|
|
|
|
Const
|
|
Const
|
|
@@ -254,6 +258,7 @@ Const
|
|
KeyDeprGlobalSection = 'Defaults';
|
|
KeyDeprGlobalSection = 'Defaults';
|
|
KeyGlobalSection = 'Global';
|
|
KeyGlobalSection = 'Global';
|
|
KeyRepositorySection = 'Repository';
|
|
KeyRepositorySection = 'Repository';
|
|
|
|
+ KeySrcRepositorySection = 'UninstalledSourceRepository';
|
|
KeyRemoteMirrorsURL = 'RemoteMirrors';
|
|
KeyRemoteMirrorsURL = 'RemoteMirrors';
|
|
KeyRemoteRepository = 'RemoteRepository';
|
|
KeyRemoteRepository = 'RemoteRepository';
|
|
KeyLocalRepository = 'LocalRepository';
|
|
KeyLocalRepository = 'LocalRepository';
|
|
@@ -314,7 +319,7 @@ end;
|
|
procedure TFppkgRepositoryOptionSection.SetPath(AValue: string);
|
|
procedure TFppkgRepositoryOptionSection.SetPath(AValue: string);
|
|
begin
|
|
begin
|
|
if FPath = AValue then Exit;
|
|
if FPath = AValue then Exit;
|
|
- FPath := AValue;
|
|
|
|
|
|
+ FPath := fpmkunit.FixPath(AValue, True);
|
|
end;
|
|
end;
|
|
|
|
|
|
procedure TFppkgRepositoryOptionSection.AddKeyValue(const AKey, AValue: string);
|
|
procedure TFppkgRepositoryOptionSection.AddKeyValue(const AKey, AValue: string);
|
|
@@ -343,6 +348,23 @@ begin
|
|
Result := True;
|
|
Result := True;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+function TFppkgRepositoryOptionSection.InitRepository(AParent: TComponent;
|
|
|
|
+ ACompilerOptions: TCompilerOptions): TFPRepository;
|
|
|
|
+var
|
|
|
|
+ InstPackages: TFPInstalledPackagesStructure;
|
|
|
|
+begin
|
|
|
|
+ if Path <> '' then
|
|
|
|
+ begin
|
|
|
|
+ Result := TFPRepository.Create(AParent);
|
|
|
|
+ Result.RepositoryType := fprtInstalled;
|
|
|
|
+ Result.RepositoryName := RepositoryName;
|
|
|
|
+ Result.Description := Description;
|
|
|
|
+ InstPackages := TFPInstalledPackagesStructure.Create(AParent, Path, ACompilerOptions);
|
|
|
|
+ Result.DefaultPackagesStructure := InstPackages;
|
|
|
|
+ InstPackages.Prefix:=Prefix;
|
|
|
|
+ end;
|
|
|
|
+end;
|
|
|
|
+
|
|
{ TFppkgCommandLineOptionSection }
|
|
{ TFppkgCommandLineOptionSection }
|
|
|
|
|
|
constructor TFppkgCommandLineOptionSection.Create(AnOptionParser: TTemplateParser);
|
|
constructor TFppkgCommandLineOptionSection.Create(AnOptionParser: TTemplateParser);
|
|
@@ -667,6 +689,8 @@ begin
|
|
CurrentSection := TFppkgGlobalOptionSection.Create(FOptionParser)
|
|
CurrentSection := TFppkgGlobalOptionSection.Create(FOptionParser)
|
|
else if SameText(s, KeyRepositorySection) then
|
|
else if SameText(s, KeyRepositorySection) then
|
|
CurrentSection := TFppkgRepositoryOptionSection.Create(FOptionParser)
|
|
CurrentSection := TFppkgRepositoryOptionSection.Create(FOptionParser)
|
|
|
|
+ else if SameText(s, KeySrcRepositorySection) then
|
|
|
|
+ CurrentSection := TFppkgUninstalledSourceRepositoryOptionSection.Create(FOptionParser)
|
|
else
|
|
else
|
|
CurrentSection := TFppkgCustomOptionSection.Create(FOptionParser);
|
|
CurrentSection := TFppkgCustomOptionSection.Create(FOptionParser);
|
|
FSectionList.Add(CurrentSection);
|
|
FSectionList.Add(CurrentSection);
|