summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarco <marco@3ad0048d-3df7-0310-abae-a5850022a9f2>2012-10-24 11:59:43 +0000
committermarco <marco@3ad0048d-3df7-0310-abae-a5850022a9f2>2012-10-24 11:59:43 +0000
commit2ef21dba7a508b77731270f87dd5d45493d99156 (patch)
tree4c020f61ac16e6da35e72518c68e097c8c0ea288
parentc8bd3f460217f6840e992ffa94a4c4ee30c4be13 (diff)
parentd03acd296f8506a2325f76e885a026ea8d3d09ec (diff)
downloadfpc-release_2_6_2_rc1.tar.gz
--- Merging r22825 into '.':release_2_6_2_rc1
U utils/fppkg/fppkg.pp U packages/fpmkunit/src/fpmkunit.pp U packages/fppkg/src/pkgcommands.pp U packages/fppkg/src/pkgfpmake.pp U packages/fppkg/src/pkgglobals.pp U packages/fppkg/src/pkgdownload.pp U packages/fppkg/src/pkgrepos.pp U packages/fppkg/src/fpxmlrep.pp U packages/fppkg/src/pkgoptions.pp U packages/fppkg/src/fprepos.pp U packages/fppkg/src/pkghandler.pp U packages/fppkg/src/pkgmkconv.pp G . git-svn-id: http://svn.freepascal.org/svn/fpc/tags/release_2_6_2_rc1@22844 3ad0048d-3df7-0310-abae-a5850022a9f2
-rw-r--r--packages/fpmkunit/src/fpmkunit.pp506
-rw-r--r--packages/fppkg/src/fprepos.pp243
-rw-r--r--packages/fppkg/src/fpxmlrep.pp2
-rw-r--r--packages/fppkg/src/pkgcommands.pp24
-rw-r--r--packages/fppkg/src/pkgdownload.pp4
-rw-r--r--packages/fppkg/src/pkgfpmake.pp10
-rw-r--r--packages/fppkg/src/pkgglobals.pp27
-rw-r--r--packages/fppkg/src/pkghandler.pp94
-rw-r--r--packages/fppkg/src/pkgmkconv.pp4
-rw-r--r--packages/fppkg/src/pkgoptions.pp30
-rw-r--r--packages/fppkg/src/pkgrepos.pp43
-rw-r--r--utils/fppkg/fppkg.pp15
12 files changed, 359 insertions, 643 deletions
diff --git a/packages/fpmkunit/src/fpmkunit.pp b/packages/fpmkunit/src/fpmkunit.pp
index 0e16908c2f..570f6eb38d 100644
--- a/packages/fpmkunit/src/fpmkunit.pp
+++ b/packages/fpmkunit/src/fpmkunit.pp
@@ -203,7 +203,6 @@ Const
AllMessages = [vlError,vlWarning,vlCommand,vlInfo];
Type
- TTargets = Class;
{ TNamedItem }
TNamedItem = Class(TCollectionItem)
@@ -219,14 +218,10 @@ Type
TNamedCollection = Class(TCollection)
private
FUniqueNames: Boolean;
- private
- function GetItem(Index: Integer): TNamedItem;
- procedure SetItem(Index: Integer; AValue: TNamedItem);
Public
Function IndexOfName(const AName : String) : Integer;
Function ItemByName(const AName : String) : TNamedItem;
Property UniqueNames : Boolean Read FUniqueNames;
- property Items[Index: Integer]: TNamedItem read GetItem write SetItem;
end;
{ TNamedItemList }
@@ -397,11 +392,8 @@ Type
{ TPackageDictionary }
TPackageDictionary = Class(TDictionary)
- private
- FMasterDictionary: TDictionary;
Public
Function GetValue(const AName,Args : String) : String; override;
- property MasterDictionary: TDictionary read FMasterDictionary write FMasterDictionary;
end;
@@ -427,45 +419,6 @@ Type
Property RequireChecksum : Cardinal Read FRequireChecksum Write FRequireChecksum;
end;
- { TPackageVariant }
-
- TPackage = Class;
- TPackageVariant = class(TNamedItem)
- private
- FOptions: TStrings;
- FTargets: TTargets;
- public
- constructor Create(ACollection: TCollection); override;
- destructor Destroy; override;
- property Options: TStrings read FOptions;
- property Targets: TTargets read FTargets;
- end;
-
- { TPackageVariants }
-
- TPackageVariants = class(TNamedCollection)
- private
- FActivePackageVariantName: string;
- FDefaultPackageVariantName: string;
- FIsInheritable: boolean;
- FMasterPackage: TPackage;
- FName: string;
- function GetActivePackageVariant: TPackageVariant;
- function GetDefaultPackageVariant: TPackageVariant;
- procedure SetActivePackageVariantName(AValue: string);
- procedure SetDefaultPackageVariantName(AValue: string);
- public
- function Add(AName: String): TPackageVariant; overload; virtual;
- property Name: string read FName write FName;
- property MasterPackage: TPackage read FMasterPackage;
- property DefaultPackageVariant: TPackageVariant read GetDefaultPackageVariant;
- property ActivePackageVariant: TPackageVariant read GetActivePackageVariant;
- property DefaultPackageVariantName: string read FDefaultPackageVariantName write SetDefaultPackageVariantName;
- property ActivePackageVariantName: string read FActivePackageVariantName write SetActivePackageVariantName;
- property IsInheritable: boolean read FIsInheritable;
- end;
-
-
TDependencies = Class(TConditionalStrings)
function GetDependency(Index : Integer): TDependency;
procedure SetDependency(Index : Integer; const AValue: TDependency);
@@ -531,7 +484,6 @@ Type
Public
Constructor Create(ACollection : TCollection); override;
Destructor Destroy; override;
- procedure AssignTo(Dest: TPersistent); override;
Function GetOutputFileName (AOs : TOS) : String; Virtual;
Function HaveOptions : Boolean;
procedure SetName(const AValue: String);override;
@@ -702,8 +654,6 @@ Type
FDescriptionFile : String;
FDescription : String;
FInstalledChecksum : Cardinal;
- FUnitsOutputDir: String;
- FPackageUnitInstallDir: String;
// Cached directory of installed packages
FUnitDir : String;
// Used by buildunits
@@ -715,7 +665,6 @@ Type
FDictionary : TDictionary;
// Is set when all sourcefiles are found
FAllFilesResolved: boolean;
- FPackageVariants: TFPList;
Function GetDescription : string;
function GetDictionary: TDictionary;
Function GetFileName : string;
@@ -725,19 +674,15 @@ Type
Procedure SetVersion(const V : string);
Protected
procedure SetName(const AValue: String);override;
+ procedure LoadUnitConfigFromFile(Const AFileName: String);
procedure SaveUnitConfigToStringList(Const AStringList: TStrings;ACPU:TCPU;AOS:TOS); virtual;
+ procedure SaveUnitConfigToFile(Const AFileName: String;ACPU:TCPU;AOS:TOS);
property Dictionary: TDictionary read GetDictionary;
Public
constructor Create(ACollection: TCollection); override;
destructor destroy; override;
Function HaveOptions : Boolean;
Function GetUnitsOutputDir(ACPU:TCPU; AOS : TOS):String;
- Function GetUnitConfigOutputDir(ACPU:TCPU; AOS : TOS):String;
- Procedure InheritPackageVariantsFromDependency(ADependencyPackage: TPackage);
- Function GetPackageVariantsByName(AName: string): TPackageVariants;
- Procedure SetUnitsOutputDir(AValue: string);
- Function GetPackageUnitInstallDir(ACPU:TCPU; AOS : TOS):String;
- Procedure SetPackageUnitInstallDir(AValue: string);
Function GetBinOutputDir(ACPU:TCPU; AOS : TOS) : String;
Procedure GetCleanFiles(List : TStrings; ACPU:TCPU; AOS : TOS); virtual;
procedure GetInstallFiles(List: TStrings;Types : TTargetTypes;ACPU:TCPU; AOS : TOS); virtual;
@@ -745,11 +690,6 @@ Type
Procedure GetArchiveFiles(List : TStrings; ACPU:TCPU; AOS : TOS); virtual;
Procedure GetArchiveSourceFiles(List : TStrings); virtual;
Procedure GetManifest(Manifest : TStrings);
- Procedure AddPackageVariant(APackageVariant: TPackageVariants);
- procedure ApplyPackageVariantToCompilerOptions(ACompilerOptions: tstrings);
- procedure SetDefaultPackageVariant;
- procedure LoadUnitConfigFromFile(Const AFileName: String);
- procedure SaveUnitConfigToFile(Const AFileName: String;ACPU:TCPU;AOS:TOS);
Property Version : String Read GetVersion Write SetVersion;
Property FileName : String Read GetFileName Write FFileName;
Property HomepageURL : String Read FHomepageURL Write FHomepageURL;
@@ -996,7 +936,7 @@ Type
Procedure InstallUnitConfigFile(APAckage : TPackage; Const Dest : String);
Function InstallPackageSourceFiles(APAckage : TPackage; stt : TSourceTypes; ttt : TTargetTypes; Const Dest : String):Boolean;
Function FileNewer(const Src,Dest : String) : Boolean;
- Procedure LogSearchPath(APackage: TPackage;const ASearchPathName:string;Path:TConditionalStrings; ACPU:TCPU;AOS:TOS);
+ Procedure LogSearchPath(const ASearchPathName:string;Path:TConditionalStrings; ACPU:TCPU;AOS:TOS);
Function FindFileInPath(APackage: TPackage; Path:TConditionalStrings; AFileName:String; var FoundPath:String;ACPU:TCPU;AOS:TOS):Boolean;
procedure GetDirectoriesFromFilelist(const AFileList, ADirectoryList: TStringList);
@@ -1096,8 +1036,6 @@ Type
FListMode : Boolean;
FLogLevels : TVerboseLevels;
FFPMakeOptionsString: string;
- FPackageVariantSettings: TStrings;
- FPackageVariants: TFPList;
Protected
Procedure Log(Level : TVerboseLevel; Const Msg : String);
Procedure CreatePackages; virtual;
@@ -1118,7 +1056,6 @@ Type
Constructor Create(AOwner : TComponent); virtual;
Destructor destroy; override;
Function AddPackage(Const AName : String) : TPackage;
- Function AddPackageVariant(AName: string; AIsInheritable: boolean): TPackageVariants;
Function Run : Boolean;
Property FPMakeOptionsString: string read FFPMakeOptionsString;
Property BuildEngine : TBuildEngine Read FBuildEngine;
@@ -1186,7 +1123,6 @@ Type
TInstallerClass = Class of TCustomInstaller;
TDictionaryClass = Class of TDictionary;
- TPackageDictionaryClass = Class of TPackageDictionary;
Type
TArchiveEvent = Procedure (Const AFileName : String; List : TStrings) of Object;
@@ -1194,7 +1130,7 @@ Type
Var
DictionaryClass : TDictionaryClass = TDictionary;
- PackageDictionaryClass : TPackageDictionaryClass = TPackageDictionary;
+ PackageDictionaryClass : TDictionaryClass = TPackageDictionary;
OnArchiveFiles : TArchiveEvent = Nil;
ArchiveFilesProc : TArchiveProc = Nil;
@@ -1284,7 +1220,6 @@ ResourceString
SErrInvalidState = 'Invalid state for target %s';
SErrCouldNotCompile = 'Could not compile target %s from package %s';
SErrUnsupportedBuildmode = 'Package does not support this buildmode';
- SErrPackVarNotExist = 'There is no package variant with the name "%s"';
SWarnCircularTargetDependency = 'Warning: Circular dependency detected when compiling target %s with target %s';
SWarnCircularPackageDependency = 'Warning: Circular dependency detected when compiling package %s with package %s';
@@ -1307,7 +1242,6 @@ ResourceString
SWarnCanNotSetAccessRights = 'Warning: Failed to copy access-rights to file %s';
SWarnCanNotGetFileAge = 'Warning: Failed to get FileAge for %s';
SWarnExtCommandNotFound = 'Warning: External command "%s" not found but "%s" is older then "%s"';
- SWarnDuplicatePackage = 'Warning: Package %s is already added. Using the existing package';
SInfoPackageAlreadyProcessed = 'Package %s is already processed';
SInfoCompilingTarget = 'Compiling target %s';
@@ -1322,7 +1256,6 @@ ResourceString
SInfoSourceNewerDest = 'Source file "%s" (%s) is newer than destination "%s" (%s).';
SInfoDestDoesNotExist = 'Destination file "%s" does not exist.';
SInfoFallbackBuildmode = 'Buildmode not supported by package, falling back to one by one unit compilation';
- SInfoFallbackBuildmodeBU= 'Buildmode not supported by package, falling back to compilation using a buildunit';
SDbgComparingFileTimes = 'Comparing file "%s" time "%s" to "%s" time "%s".';
SDbgCompilingDependenciesOfTarget = 'Compiling dependencies of target %s';
@@ -1333,7 +1266,7 @@ ResourceString
SDbgOutputNotYetAvailable = 'Output file %s not available';
SDbgDependencyOnUnit = 'Dependency of %s on unit %s';
SDbgDependencyUnitRecompiled = 'Dependent unit %s is being recompiled';
- SDbgMustCompile = 'Must compile %s. (%s)';
+ SDbgMustCompile = 'Must compile %s';
SDbgSkippingTargetWrongCPU = 'Skipping target %s, different CPU (%s)';
SDbgSkippingTargetWrongOS = 'Skipping target %s, different OS (%s)';
SDbgTargetIsNotAUnitOrProgram = 'Skipping Target %s, not an unit or program';
@@ -1357,13 +1290,6 @@ ResourceString
SDbgDirectoryDoesNotExist = 'Directory "%s" does not exist';
SDbgDirectoryNotEmpty = 'Directory "%s" is not empty. Will not remove';
SDbgGenerateBuildUnit = 'Generate build-unit %s';
- SDbgForcedCompile = 'Forced compile';
- SDbgOutputDoesNotExist = 'Output file does not exist';
- SDbgNewerSource = 'Source file is newer then output file';
- SDbgNewerInclude = 'The include file %s is newer then output file';
- SDbgDependencyRecompiled = 'The unit %s where this unit depends on is recompiled';
- SDbgPackageDepRecompiled = 'The package %s where this package depends on is recompiled';
- SDbgTargetHasToBeCompiled = 'At least one of the targets in the package has to be compiled.';
// Help messages for usage
SValue = 'Value';
@@ -1434,7 +1360,6 @@ Const
KeyAddIn = 'FPMakeAddIn';
KeySourcePath = 'SourcePath';
KeyFPMakeOptions = 'FPMakeOptions';
- KeyPackageVar = 'PackageVariant_';
{****************************************************************************
Helpers
@@ -1911,16 +1836,15 @@ begin
end;
-function AddConditionalStrings(APackage: TPackage; Dest : TStrings; Src : TConditionalStrings;ACPU:TCPU;AOS:TOS; Const APrefix : String='') : Integer ;
+function AddConditionalStrings(Dest : TStrings; Src : TConditionalStrings;ACPU:TCPU;AOS:TOS; Const APrefix : String='') : Integer ;
Var
I : Integer;
C : TConditionalString;
- D : TPackageDictionary;
+ D : TDictionary;
S : String;
begin
Result:=0;
D := PackageDictionaryClass.Create(nil);
- D.MasterDictionary := APackage.Dictionary;
try
D.AddVariable('CPU',CPUToString(ACPU));
D.AddVariable('OS',OSToString(AOS));
@@ -2171,58 +2095,8 @@ begin
SetLength(Result,Count);
Move(Buf,Result[1],Count);
end;
-{$endif HAS_UNIT_PROCESS}
-
-constructor TPackageVariant.Create(ACollection: TCollection);
-begin
- inherited Create(ACollection);
- FTargets := TTargets.Create(TTarget);
- FOptions := TStringList.Create;
-end;
-
-destructor TPackageVariant.Destroy;
-begin
- FOptions.Free;
- FTargets.Free;
- inherited Destroy;
-end;
-
-{ TPackageVariants }
-
-procedure TPackageVariants.SetDefaultPackageVariantName(AValue: string);
-begin
- if FDefaultPackageVariantName=AValue then Exit;
- if not assigned(ItemByName(avalue)) then
- raise exception.CreateFmt(SErrPackVarNotExist,[AValue]);
- FDefaultPackageVariantName:=AValue;
-end;
-
-function TPackageVariants.GetActivePackageVariant: TPackageVariant;
-begin
- result := ItemByName(ActivePackageVariantName) as TPackageVariant;
-end;
-
-function TPackageVariants.GetDefaultPackageVariant: TPackageVariant;
-begin
- result := ItemByName(DefaultPackageVariantName) as TPackageVariant;
-end;
-
-procedure TPackageVariants.SetActivePackageVariantName(AValue: string);
-begin
- if FActivePackageVariantName=AValue then Exit;
- if not assigned(ItemByName(avalue)) then
- raise exception.CreateFmt(SErrPackVarNotExist,[AValue]);
- FActivePackageVariantName:=AValue;
-end;
-
-function TPackageVariants.Add(AName: String): TPackageVariant;
-begin
- result := self.add as TPackageVariant;
- result.Name := AName;
- if FDefaultPackageVariantName='' then
- FDefaultPackageVariantName:=AName;
-end;
+{$endif HAS_UNIT_PROCESS}
{ TConditionalDestStrings }
@@ -2277,10 +2151,7 @@ begin
I:=Flist.IndexOf(AName);
If (I=-1) then
begin
- if assigned(MasterDictionary) then
- result := MasterDictionary.GetValue(AName,Args)
- else
- result := GlobalDictionary.GetValue(AName,Args);
+ result := GlobalDictionary.GetValue(AName,Args);
Exit;
end;
O:=Flist.Objects[I];
@@ -2368,16 +2239,6 @@ end;
TNamedCollection
****************************************************************************}
-function TNamedCollection.GetItem(Index: Integer): TNamedItem;
-begin
- result := TNamedItem(inherited getItem(index));
-end;
-
-procedure TNamedCollection.SetItem(Index: Integer; AValue: TNamedItem);
-begin
- inherited SetItem(Index, AValue);
-end;
-
function TNamedCollection.IndexOfName(const AName: String): Integer;
begin
@@ -2751,8 +2612,6 @@ begin
FExamplePath:=TConditionalStrings.Create(TConditionalString);
FTestPath:=TConditionalStrings.Create(TConditionalString);
FCommands:=TCommands.Create(TCommand);
- FUnitsOutputDir:='units'+PathDelim+'$(target)'+PathDelim;
- FPackageVariants:=TFPList.Create;
FCPUs:=AllCPUs;
FOSes:=AllOSes;
FInstalledChecksum:=$ffffffff;
@@ -2763,8 +2622,6 @@ end;
destructor TPackage.destroy;
-var
- i: integer;
begin
FreeAndNil(FDictionary);
FreeAndNil(FDependencies);
@@ -2780,7 +2637,6 @@ begin
FreeAndNil(FTargets);
FreeAndNil(FVersion);
FreeAndNil(FOptions);
- FreeAndNil(FPackageVariants);
inherited destroy;
end;
@@ -2801,64 +2657,7 @@ end;
Function TPackage.GetUnitsOutputDir(ACPU:TCPU; AOS : TOS):String;
begin
- result:=FixPath(Dictionary.Substitute(FUnitsOutputDir,['CPU',CPUToString(ACPU),'OS',OSToString(AOS),'target',MakeTargetString(ACPU,AOS)]));
-end;
-
-function TPackage.GetUnitConfigOutputDir(ACPU: TCPU; AOS: TOS): String;
-begin
- result:=FixPath(Dictionary.Substitute('units'+PathDelim+'$(target)'+PathDelim,['CPU',CPUToString(ACPU),'OS',OSToString(AOS),'target',MakeTargetString(ACPU,AOS)]));
-end;
-
-procedure TPackage.InheritPackageVariantsFromDependency(ADependencyPackage: TPackage);
-var
- i: integer;
- APackageVariants: TPackageVariants;
-begin
- for i := 0 to ADependencyPackage.FPackageVariants.Count-1 do
- begin
- APackageVariants := TPackageVariants(ADependencyPackage.FPackageVariants[i]);
- if APackageVariants.IsInheritable then
- begin
- if not assigned(GetPackageVariantsByName(APackageVariants.Name)) then
- begin
- FPackageVariants.Add(APackageVariants);
- end;
- end;
- end;
-end;
-
-function TPackage.GetPackageVariantsByName(AName: string): TPackageVariants;
-var
- i: Integer;
-begin
- result := nil;
- for i := 0 to FPackageVariants.Count-1 do
- if SameText(TPackageVariants(FPackageVariants.Items[i]).Name, AName) then
- begin
- result := TPackageVariants(FPackageVariants.Items[i]);
- break;
- end;
-end;
-
-procedure TPackage.SetUnitsOutputDir(AValue: string);
-begin
- if AValue<>'' then
- FUnitsOutputDir:=IncludeTrailingPathDelimiter(AValue)
- else
- FUnitsOutputDir:='';
-end;
-
-function TPackage.GetPackageUnitInstallDir(ACPU: TCPU; AOS: TOS): String;
-begin
- result:=FixPath(Dictionary.Substitute(FPackageUnitInstallDir,['CPU',CPUToString(ACPU),'OS',OSToString(AOS),'target',MakeTargetString(ACPU,AOS)]));
-end;
-
-procedure TPackage.SetPackageUnitInstallDir(AValue: string);
-begin
- if AValue<>'' then
- FPackageUnitInstallDir:=IncludeTrailingPathDelimiter(AValue)
- else
- FPackageUnitInstallDir:='';
+ Result:='units'+PathDelim+MakeTargetString(ACPU,AOS);
end;
@@ -2875,7 +2674,7 @@ Var
begin
OB:=IncludeTrailingPathDelimiter(GetBinOutputDir(ACPU,AOS));
OU:=IncludeTrailingPathDelimiter(GetUnitsOutputDir(ACPU,AOS));
- AddConditionalStrings(Self, List,CleanFiles,ACPU,AOS);
+ AddConditionalStrings(List,CleanFiles,ACPU,AOS);
For I:=0 to FTargets.Count-1 do
FTargets.TargetItems[I].GetCleanFiles(List, OU, OB, ACPU, AOS);
end;
@@ -2888,7 +2687,7 @@ Var
T : TTarget;
begin
if Types=[] then
- AddConditionalStrings(Self, List,InstallFiles,ACPU,AOS)
+ AddConditionalStrings(List,InstallFiles,ACPU,AOS)
else
begin
OB:=IncludeTrailingPathDelimiter(GetBinOutputDir(Defaults.CPU,Defaults.OS));
@@ -3100,47 +2899,6 @@ begin
end;
end;
-procedure TPackage.AddPackageVariant(APackageVariant: TPackageVariants);
-begin
- if not assigned(APackageVariant.FMasterPackage) then
- APackageVariant.FMasterPackage := Self;
- FPackageVariants.Add(APackageVariant);
-end;
-
-procedure TPackage.ApplyPackageVariantToCompilerOptions(ACompilerOptions: tstrings);
-var
- i: integer;
- PackageVariants: TPackageVariants;
-begin
- for i := 0 to FPackageVariants.Count-1 do
- begin
- PackageVariants := TPackageVariants(FPackageVariants.Items[i]);
- ACompilerOptions.AddStrings(PackageVariants.ActivePackageVariant.Options);
- end;
-end;
-
-procedure TPackage.SetDefaultPackageVariant;
-var
- i,j: integer;
- PackageVariants: TPackageVariants;
-begin
- for i := 0 to FPackageVariants.Count-1 do
- begin
- PackageVariants := TPackageVariants(FPackageVariants.Items[i]);
- if Installer.FPackageVariantSettings.Values[PackageVariants.Name]<>'' then
- PackageVariants.ActivePackageVariantName:= Installer.FPackageVariantSettings.Values[PackageVariants.Name]
- else
- PackageVariants.ActivePackageVariantName:= PackageVariants.DefaultPackageVariantName;
- Dictionary.AddVariable(PackageVariants.Name,PackageVariants.ActivePackageVariantName);
- SetUnitsOutputDir(FUnitsOutputDir+'$('+PackageVariants.name+')');
- SetPackageUnitInstallDir(FPackageUnitInstallDir+'$('+PackageVariants.Name+')');
- // Do not add targets f the package is inherited
- if PackageVariants.MasterPackage=Self then
- for j := 0 to PackageVariants.ActivePackageVariant.Targets.count -1 do
- targets.add.assign(PackageVariants.ActivePackageVariant.Targets.items[j]);
- end;
-end;
-
procedure TPackage.LoadUnitConfigFromFile(Const AFileName: String);
var
@@ -3151,10 +2909,6 @@ var
DepChecksum : Cardinal;
DepName : String;
D : TDependency;
- PackageVariantsStr: string;
- PackageVarName: string;
- pv: TPackageVariants;
- AnIsInheritable: boolean;
begin
L:=TStringList.Create;
Try
@@ -3186,41 +2940,6 @@ begin
FreeAndNil(L2);
NeedLibC:=Upcase(Values[KeyNeedLibC])='Y';
IsFPMakeAddIn:=Upcase(Values[KeyAddIn])='Y';
-
- i := 1;
- repeat
- PackageVariantsStr:=Values[KeyPackageVar+inttostr(i)];
- if PackageVariantsStr<>'' then
- begin
- k := pos(':',PackageVariantsStr);
- if k > 0 then
- begin
- PackageVarName:=copy(PackageVariantsStr,1,k-1);
- if PackageVarName[Length(PackageVarName)]='*' then
- begin
- SetLength(PackageVarName,Length(PackageVarName)-1);
- AnIsInheritable:=true;
- end
- else
- AnIsInheritable:=false;
- PackageVariantsStr:=copy(PackageVariantsStr,k+1,length(PackageVariantsStr)-k);
- pv := Installer.AddPackageVariant(PackageVarName, AnIsInheritable);
- AddPackageVariant(pv);
-
- k := pos(',',PackageVariantsStr);
- while k>0 do
- begin
- PackageVarName:=copy(PackageVariantsStr,1,k-1);
- PackageVariantsStr:=copy(PackageVariantsStr,k+1,length(PackageVariantsStr)-k);
- pv.Add(PackageVarName);
- k := pos(',',PackageVariantsStr);
- end;
- pv.Add(PackageVariantsStr);
- end;
- end;
- inc(i);
- until PackageVariantsStr='';
-
end;
Finally
L.Free;
@@ -3230,11 +2949,9 @@ end;
procedure TPackage.SaveUnitConfigToStringList(const AStringList: TStrings; ACPU: TCPU; AOS: TOS);
Var
Deps : String;
- i,j : integer;
+ i : integer;
D : TDependency;
p : TPackage;
- PackageVariants : TPackageVariants;
- PackageVariantsStr: string;
begin
with AStringList do
begin
@@ -3270,18 +2987,6 @@ begin
Values[KeyAddIn]:='Y'
else
Values[KeyAddIn]:='N';
- for i := 0 to FPackageVariants.Count-1 do
- begin
- PackageVariants := TPackageVariants(FPackageVariants.Items[i]);
- PackageVariantsStr:=PackageVariants.Name;
- if PackageVariants.IsInheritable then
- PackageVariantsStr:=PackageVariantsStr+'*';
- PackageVariantsStr := PackageVariantsStr +':'+PackageVariants.DefaultPackageVariantName;
- for j := 0 to PackageVariants.Count-1 do
- if not sametext(PackageVariants.Items[j].Name, PackageVariants.DefaultPackageVariantName) then
- PackageVariantsStr:=PackageVariantsStr+','+PackageVariants.Items[j].Name;
- values[KeyPackageVar+inttostr(i+1)] := PackageVariantsStr;
- end;
end;
end;
@@ -3325,20 +3030,9 @@ end;
function TPackages.AddPackage(const AName: String): TPackage;
-var
- i: integer;
begin
- i := IndexOfName(AName);
- if i > -1 then
- begin
- result := PackageItems[i];
- Installer.Log(vlWarning,Format(SWarnDuplicatePackage,[AName]))
- end
- else
- begin
- Result:=Add as TPackage;
- Result.Name:=AName;
- end;
+ Result:=Add as TPackage;
+ Result.Name:=AName;
end;
@@ -3827,8 +3521,6 @@ end;
constructor TCustomInstaller.Create(AOwner: TComponent);
begin
- FPackageVariantSettings := TStringList.Create;
- FPackageVariants := TFPList.Create;
GlobalDictionary:=DictionaryClass.Create(Nil);
AnalyzeOptions;
GlobalDictionary.AddVariable('BaseInstallDir',Defaults.BaseInstallDir);
@@ -3840,19 +3532,10 @@ end;
destructor TCustomInstaller.Destroy;
-var
- i: integer;
begin
FreePackages;
FreeAndNil(Defaults);
FreeAndNil(GlobalDictionary);
- FreeAndNil(FPackageVariantSettings);
- for i := 0 to FPackageVariants.Count-1 do
- begin
- if TPackageVariants(FPackageVariants.Items[i]).Owner=Self then
- TPackageVariants(FPackageVariants.Items[i]).Free;
- end;
- FreeAndNil(FPackageVariants);
inherited destroy;
end;
@@ -3909,13 +3592,6 @@ begin
result:=Packages.AddPackage(AName);
end;
-function TCustomInstaller.AddPackageVariant(AName: string; AIsInheritable: boolean): TPackageVariants;
-begin
- result := TPackageVariants.Create(TPackageVariant);
- result.Name:=AName;
- result.FIsInheritable:=AIsInheritable;
- FPackageVariants.Add(result);
-end;
procedure TCustomInstaller.AnalyzeOptions;
@@ -3928,28 +3604,6 @@ procedure TCustomInstaller.AnalyzeOptions;
if AddToOptionString and Result then FFPMakeOptionsString := FFPMakeOptionsString+' '+O;
end;
- Function CheckBuildOptionSetValue(Index: Integer): boolean;
- var
- O : String;
- BuildModeName: string;
- P: integer;
- begin
- O:=Paramstr(Index);
- result := O[1]='+';
- if result then
- begin
- P:=Pos('=',Paramstr(Index));
- If (P=0) then
- Error(SErrNeedArgument,[Index,O])
- else
- begin
- BuildModeName:=copy(o,2,P-2);
- Delete(O,1,P);
- FPackageVariantSettings.Values[BuildModeName] := O;
- end;
- end;
- end;
-
Function CheckCustomOption(Index : Integer; out CustOptName: string): Boolean;
var
O : String;
@@ -4105,7 +3759,7 @@ begin
CustomFpMakeCommandlineValues := TStringList.Create;
CustomFpMakeCommandlineValues.Values[CustOptName]:=OptionArg(I)
end
- else if (not CheckBuildOptionSetValue(I)) and (not Defaults.IgnoreInvalidOptions) then
+ else if not Defaults.IgnoreInvalidOptions then
begin
Usage(SErrInValidArgument,[I,ParamStr(I)]);
end;
@@ -4779,7 +4433,7 @@ begin
end;
-procedure TBuildEngine.LogSearchPath(APackage: TPackage; const ASearchPathName: string; Path: TConditionalStrings; ACPU: TCPU; AOS: TOS);
+Procedure TBuildEngine.LogSearchPath(const ASearchPathName:string;Path:TConditionalStrings; ACPU:TCPU;AOS:TOS);
var
S : String;
I : Integer;
@@ -4793,7 +4447,7 @@ begin
begin
if S<>'' then
S:=S+PathSeparator;
- S:=S+APackage.Dictionary.ReplaceStrings(C.Value)
+ S:=S+GlobalDictionary.ReplaceStrings(C.Value)
end;
end;
if S<>'' then
@@ -4840,7 +4494,7 @@ Procedure TBuildEngine.ResolveFileNames(APackage : TPackage; ACPU:TCPU;AOS:TOS;D
var
SD,SF : String;
begin
- LogSearchPath(APackage,'package source',APackage.SourcePath,ACPU,AOS);
+ LogSearchPath('package source',APackage.SourcePath,ACPU,AOS);
SD:=APackage.Dictionary.ReplaceStrings(T.Directory);
SF:=APackage.Dictionary.ReplaceStrings(T.SourceFileName);
if SD='' then
@@ -4865,8 +4519,8 @@ Procedure TBuildEngine.ResolveFileNames(APackage : TPackage; ACPU:TCPU;AOS:TOS;D
D : TDependency;
j : integer;
begin
- LogSearchPath(APackage,'target include',T.IncludePath,ACPU,AOS);
- LogSearchPath(APackage,'package include',APackage.IncludePath,ACPU,AOS);
+ LogSearchPath('target include',T.IncludePath,ACPU,AOS);
+ LogSearchPath('package include',APackage.IncludePath,ACPU,AOS);
for j:=0 to T.Dependencies.Count-1 do
begin
D:=T.Dependencies[j];
@@ -4910,7 +4564,7 @@ Procedure TBuildEngine.ResolveFileNames(APackage : TPackage; ACPU:TCPU;AOS:TOS;D
var
SD,SF : String;
begin
- LogSearchPath(APackage,'package example',APackage.ExamplePath,ACPU,AOS);
+ LogSearchPath('package example',APackage.ExamplePath,ACPU,AOS);
SD:=APackage.Dictionary.ReplaceStrings(T.Directory);
SF:=APackage.Dictionary.ReplaceStrings(T.SourceFileName);
if SD='' then
@@ -5000,13 +4654,13 @@ begin
if (APackage.UnitDir='') and
(Defaults.LocalUnitDir<>'') then
begin
- APackage.UnitDir:=IncludeTrailingPathDelimiter(Defaults.LocalUnitDir)+APackage.Name+PathDelim+APackage.GetPackageUnitInstallDir(defaults.CPU, Defaults.OS);
+ APackage.UnitDir:=IncludeTrailingPathDelimiter(Defaults.LocalUnitDir)+APackage.Name;
if not SysDirectoryExists(APackage.UnitDir) then
APackage.UnitDir:='';
end;
if APackage.UnitDir='' then
begin
- APackage.UnitDir:=IncludeTrailingPathDelimiter(Defaults.GlobalUnitDir)+APackage.Name+PathDelim+APackage.GetPackageUnitInstallDir(defaults.CPU, Defaults.OS);
+ APackage.UnitDir:=IncludeTrailingPathDelimiter(Defaults.GlobalUnitDir)+APackage.Name;
if not SysDirectoryExists(APackage.UnitDir) then
APackage.UnitDir:=DirNotFound;
end;
@@ -5141,8 +4795,8 @@ begin
// Object Path
L:=TUnsortedDuplicatesStringList.Create;
L.Duplicates:=dupIgnore;
- AddConditionalStrings(APackage, L,APackage.ObjectPath,Defaults.CPU,Defaults.OS);
- AddConditionalStrings(APackage, L,ATarget.ObjectPath,Defaults.CPU,Defaults.OS);
+ AddConditionalStrings(L,APackage.ObjectPath,Defaults.CPU,Defaults.OS);
+ AddConditionalStrings(L,ATarget.ObjectPath,Defaults.CPU,Defaults.OS);
for i:=0 to L.Count-1 do
Args.Add('-Fo'+AddPathPrefix(APackage,L[i]));
FreeAndNil(L);
@@ -5151,8 +4805,8 @@ begin
L.Duplicates:=dupIgnore;
AddDependencyUnitPaths(L,APackage);
AddDependencyPaths(L,depUnit,ATarget);
- AddConditionalStrings(APackage, L,APackage.UnitPath,Defaults.CPU,Defaults.OS);
- AddConditionalStrings(APackage, L,ATarget.UnitPath,Defaults.CPU,Defaults.OS);
+ AddConditionalStrings(L,APackage.UnitPath,Defaults.CPU,Defaults.OS);
+ AddConditionalStrings(L,ATarget.UnitPath,Defaults.CPU,Defaults.OS);
for i:=0 to L.Count-1 do
Args.Add('-Fu'+AddPathPrefix(APackage,L[i]));
FreeAndNil(L);
@@ -5160,17 +4814,14 @@ begin
L:=TUnsortedDuplicatesStringList.Create;
L.Duplicates:=dupIgnore;
AddDependencyPaths(L,depInclude,ATarget);
- AddConditionalStrings(APackage, L,APackage.IncludePath,Defaults.CPU,Defaults.OS);
- AddConditionalStrings(APackage, L,ATarget.IncludePath,Defaults.CPU,Defaults.OS);
+ AddConditionalStrings(L,APackage.IncludePath,Defaults.CPU,Defaults.OS);
+ AddConditionalStrings(L,ATarget.IncludePath,Defaults.CPU,Defaults.OS);
for i:=0 to L.Count-1 do
Args.Add('-Fi'+AddPathPrefix(APackage,L[i]));
FreeAndNil(L);
// Custom Options
If (Defaults.HaveOptions) then
Args.AddStrings(Defaults.Options);
-
- APackage.ApplyPackageVariantToCompilerOptions(Args);
-
If (APackage.HaveOptions) then
Args.AddStrings(APackage.Options);
If (ATarget.HaveOptions) then
@@ -5301,27 +4952,19 @@ Var
D : TDependency;
T : TTarget;
OD,OFN,TFN : String;
- CompileReason: String;
begin
Result:=False;
// Forced recompile?
if FForceCompile then
- begin
Result:=true;
- CompileReason:=SDbgForcedCompile;
- end;
// For now examples are not compiled at all
if ATarget.TargetType in [ttExampleUnit, ttExampleProgram] then
Exit;
- // Files which should not be compiled on this target can not trigger a compile.
- if not TargetOK(ATarget) then
- Exit;
-
// Check output file
- if not result then
+ if not result and TargetOK(ATarget) then
begin
if ATarget.TargetType in ProgramTargets then
OD:=APackage.GetBinOutputDir(Defaults.CPU,Defaults.OS)
@@ -5332,10 +4975,7 @@ begin
OFN:=AddPathPrefix(APackage, OD+ATarget.GetOutPutFileName(Defaults.OS));
Result:=Not FileExists(OFN);
if Result then
- begin
- CompileReason:=SDbgOutputDoesNotExist;
Log(vlDebug,SDbgOutputNotYetAvailable,[OFN]);
- end;
end;
// Check main source
@@ -5343,9 +4983,7 @@ begin
begin
TFN := AddPathPrefix(APackage,ATarget.TargetSourceFileName);
if FileExists(TFN) then
- Result:=FileNewer(TFN,OFN);
- if Result then
- CompileReason:=SDbgNewerSource;
+ Result:=FileNewer(TFN,OFN)
end;
// Check unit and include dependencies
@@ -5368,10 +5006,7 @@ begin
Log(vldebug, SDbgDependencyOnUnit, [ATarget.Name,T.Name]);
Result:=(T.State=tsCompiled);
if Result then
- begin
Log(vldebug, SDbgDependencyUnitRecompiled, [T.Name]);
- CompileReason:=Format(SDbgDependencyRecompiled,[T.Name]);
- end;
end;
depInclude :
begin
@@ -5379,8 +5014,6 @@ begin
begin
TFN:=AddPathPrefix(APackage,D.TargetFileName);
Result:=FileNewer(TFN,OFN);
- if result then
- CompileReason:=Format(SDbgNewerInclude,[D.TargetFileName]);
end;
end;
depPackage :
@@ -5395,7 +5028,7 @@ begin
end;
if result then
- Log(vlDebug,SDbgMustCompile,[ATarget.Name, CompileReason]);
+ Log(vlDebug,SDbgMustCompile,[ATarget.Name]);
end;
@@ -5410,7 +5043,7 @@ begin
If Assigned(ATarget.BeforeCompile) then
ATarget.BeforeCompile(ATarget);
- if (APackage.BuildMode=bmBuildUnit) and not (ATarget.TargetType in [ttProgram,ttExampleProgram]) then
+ if APackage.BuildMode=bmBuildUnit then
begin
APackage.FBUTarget.Dependencies.AddUnit(ATarget.Name).FTargetFileName:=ATarget.TargetSourceFileName;
end
@@ -5508,16 +5141,12 @@ Var
I : Integer;
P : TPackage;
D : TDependency;
- CompileReason: string;
begin
Result:=False;
// Forced recompile?
if FForceCompile then
- begin
Result:=true;
- CompileReason:=SDbgForcedCompile;
- end;
// Recompile because of Package Dependencies?
if not Result then
@@ -5534,10 +5163,7 @@ begin
begin
Result:=(P.State=tsCompiled);
if Result then
- begin
break;
- CompileReason:=Format(SDbgPackageDepRecompiled,[P.Name]);
- end;
end;
end;
end;
@@ -5552,10 +5178,7 @@ begin
begin
Result:=NeedsCompile(APackage,APackage.Targets.TargetItems[i]);
if Result then
- begin
break;
- CompileReason:=Format(SDbgTargetHasToBeCompiled,[APackage.Targets.TargetItems[i].Name]);
- end;
end;
Finally
GPathPrefix := '';
@@ -5563,7 +5186,7 @@ begin
end;
if result then
- Log(vlDebug,SDbgMustCompile,[APackage.Name, CompileReason]);
+ Log(vlDebug,SDbgMustCompile,[APackage.Name]);
end;
@@ -5594,8 +5217,6 @@ begin
begin
Log(vlDebug, Format(SDbgLoading, [F]));
Result.LoadUnitConfigFromFile(F);
- result.SetDefaultPackageVariant;
- result.UnitDir:=result.UnitDir+Result.GetPackageUnitInstallDir(Defaults.CPU, Defaults.OS);
end;
// Check recursive implicit dependencies
CompileDependencies(Result);
@@ -5641,7 +5262,6 @@ begin
(P.InstalledChecksum<>$ffffffff) and
(P.InstalledChecksum<>D.RequireChecksum) then
Log(vlDebug,SDbgPackageChecksumChanged,[P.Name]);
- APackage.InheritPackageVariantsFromDependency(P);
end;
end;
end;
@@ -5683,7 +5303,6 @@ begin
(P.InstalledChecksum<>$ffffffff) and
(P.InstalledChecksum<>D.RequireChecksum) then
Log(vlDebug,SDbgPackageChecksumChanged,[P.Name]);
- APackage.InheritPackageVariantsFromDependency(P);
end;
end;
end;
@@ -5785,13 +5404,8 @@ begin
case Defaults.BuildMode of
bmOneByOne: begin
- if (bmOneByOne in APackage.SupportBuildModes) then
- APackage.FBuildMode:=bmBuildUnit
- else if bmBuildUnit in APackage.SupportBuildModes then
- begin
- log(vlInfo,SInfoFallbackBuildmodeBU);
- APackage.FBuildMode:=bmBuildUnit;
- end
+ if bmOneByOne in APackage.SupportBuildModes then
+ APackage.FBuildMode:=bmOneByOne
else
raise exception.create(SErrUnsupportedBuildmode);
end;
@@ -5874,7 +5488,7 @@ begin
if RegenerateUnitconfigFile then
begin
- UC:=IncludeTrailingPathDelimiter(AddPathPrefix(APackage,APackage.GetUnitConfigOutputDir(Defaults.CPU,Defaults.OS)))+UnitConfigFile;
+ UC:=IncludeTrailingPathDelimiter(AddPathPrefix(APackage,APackage.GetUnitsOutputDir(Defaults.CPU,Defaults.OS)))+UnitConfigFile;
Log(vlInfo, Format(SDbgGenerating, [UC]));
APackage.SaveUnitConfigToFile(UC,Defaults.CPU,Defaults.OS);
end;
@@ -5953,8 +5567,6 @@ begin
result := False;
Exit;
end;
- APackage.SetDefaultPackageVariant;
-
ResolveFileNames(APackage,Defaults.CPU,Defaults.OS,True,False);
If NeedsCompile(APackage) then
result := True
@@ -5991,7 +5603,7 @@ Var
begin
List:=TStringList.Create;
Try
- List.add(IncludeTrailingPathDelimiter(APackage.GetUnitConfigOutputDir(Defaults.CPU,Defaults.OS))+UnitConfigFile);
+ List.add(IncludeTrailingPathDelimiter(APackage.GetUnitsOutputDir(Defaults.CPU,Defaults.OS))+UnitConfigFile);
CmdCopyFiles(List,Dest);
Finally
List.Free;
@@ -6053,21 +5665,19 @@ begin
B:=false;
GlobalDictionary.AddVariable('PackageName',APackage.Name);
GlobalDictionary.AddVariable('unitinstalldir',Defaults.UnitInstallDir);
- GlobalDictionary.AddVariable('packageunitinstalldir',APackage.GetPackageUnitInstallDir(Defaults.CPU,Defaults.OS));
D:=IncludeTrailingPathDelimiter(Defaults.BaseInstallDir);
// This is to install the TPackage.Installfiles, which are not related to any
// target
if InstallPackageFiles(APackage,[],D) then
B:=true;
- D:=IncludeTrailingPathDelimiter(Defaults.UnitInstallDir)+APackage.GetPackageUnitInstallDir(Defaults.CPU,Defaults.OS);
+ D:=IncludeTrailingPathDelimiter(Defaults.UnitInstallDir);
if InstallPackageFiles(APackage,[ttUnit, ttImplicitUnit],D) then
B:=true;
// By default do not install the examples. Maybe add an option for this later
//if InstallPackageFiles(APAckage,ttExampleUnit,D) then
// B:=true;
// Unit (dependency) configuration if there were units installed
- D:=IncludeTrailingPathDelimiter(Defaults.UnitInstallDir);
if B then
InstallUnitConfigFile(APackage,D);
// Programs
@@ -6652,42 +6262,6 @@ begin
inherited Destroy;
end;
-procedure TTarget.AssignTo(Dest: TPersistent);
-var
- DestTarget: TTarget;
-begin
- if Dest is TTarget then
- begin
- DestTarget := TTarget(Dest);
- DestTarget.Dependencies.Assign(Dependencies);
- DestTarget.Commands.Assign(Commands);
- DestTarget.FTargetState := FTargetState;
- DestTarget.TargetType := TargetType;
- DestTarget.CPUs := CPUs;
- DestTarget.OSes := OSes;
- DestTarget.Mode := Mode;
- DestTarget.Options := Options;
- DestTarget.Name := Name;
- DestTarget.Extension:= Extension;
- DestTarget.FPCTarget := FPCTarget;
- DestTarget.FileType := FileType;
- DestTarget.Directory := Directory;
- DestTarget.ResourceStrings := ResourceStrings;
- DestTarget.Install := Install;
- DestTarget.FTargetSourceFileName := fTargetSourceFileName;
- DestTarget.ObjectPath.Assign(ObjectPath);
- DestTarget.UnitPath.Assign(UnitPath);
- DestTarget.IncludePath.Assign(IncludePath);
- DestTarget.FXML := FXML;
- DestTarget.AfterCompile := AfterCompile;
- DestTarget.BeforeCompile := BeforeCompile;
- DestTarget.BeforeClean := BeforeCompile;
- DestTarget.AfterClean := AfterClean;
- end
- else
- inherited AssignTo(Dest);
-end;
-
function TTarget.GetOptions: TStrings;
begin
If Foptions=Nil then
diff --git a/packages/fppkg/src/fprepos.pp b/packages/fppkg/src/fprepos.pp
index d3b0c58da5..404eadc21e 100644
--- a/packages/fppkg/src/fprepos.pp
+++ b/packages/fppkg/src/fprepos.pp
@@ -19,15 +19,57 @@ interface
uses
classes,sysutils,
contnrs,
- fpmkunit,
streamcoll;
Const
StreamVersion : Integer = 1;
StreamSignature = $FEEF;
+Type
+ // Keep syncronized with fpmkunit.pp
+ TCpu=(cpuNone,
+ i386,m68k,powerpc,sparc,x86_64,arm,powerpc64
+ );
+ TCPUS = Set of TCPU;
+
+ // Keep syncronized with fpmkunit.pp
+ TOS=(osNone,
+ linux,go32v2,win32,os2,freebsd,beos,netbsd,
+ amiga,atari, solaris, qnx, netware, openbsd,wdosx,
+ palmos,macos,darwin,emx,watcom,morphos,netwlibc,
+ win64,wince,gba,nds,embedded,symbian,haiku
+ );
+ TOSes = Set of TOS;
+
+const
+ AllOSes = [Low(TOS)..High(TOS)];
+ AllCPUs = [Low(TCPU)..High(TCPU)];
type
+ { TFPVersion }
+
+ TFPVersion = Class(TPersistent)
+ private
+ FMajor,
+ FMinor,
+ FMicro,
+ FBuild : Word;
+ function GetAsString: String;
+ function GetEmpty: Boolean;
+ procedure SetAsString(const AValue: String);
+ Public
+ Procedure Clear;
+ Procedure Assign(Source : TPersistent); override;
+ Property AsString : String Read GetAsString Write SetAsString;
+ Function CompareVersion(AVersion : TFPVersion) : Integer;
+ Function SameVersion(AVersion : TFPVersion) : Boolean;
+ Property Empty : Boolean Read GetEmpty;
+ Published
+ Property Major : Word Read FMajor Write FMajor;
+ Property Minor : Word Read FMinor Write FMinor;
+ Property Micro : Word Read FMicro Write FMicro;
+ Property Build : Word Read FBuild Write FBuild;
+ end;
{ TFPDependency }
@@ -45,11 +87,11 @@ type
Procedure LoadFromStream(Stream : TStream; Streamversion : Integer); override;
Procedure SaveToStream(Stream : TStream); override;
Procedure Assign(Source : TPersistent); override;
- Property OSes : TOSes Read FOSes Write FOses;
- Property CPUs : TCPUs Read FCPUs Write FCPUs;
Published
Property PackageName : String Read FPackageName Write FPackageName;
Property MinVersion : TFPVersion Read FMinVersion Write SetMinVersion;
+ Property OSes : TOSes Read FOSes Write FOses;
+ Property CPUs : TCPUs Read FCPUs Write FCPUs;
Property RequireChecksum : Cardinal Read FRequireChecksum Write FRequireChecksum;
end;
@@ -111,8 +153,6 @@ type
Property InstalledLocally : boolean read FInstalledLocally write FInstalledLocally;
Property UnusedVersion : TFPVersion Read FUnusedVersion Write SetUnusedVersion;
Property RecompileBroken : boolean read FRecompileBroken write FRecompileBroken;
- Property OSes : TOSes Read FOSes Write FOses;
- Property CPUs : TCPUs Read FCPUs Write FCPUs;
Published
Property Name : String Read FName Write SetName;
Property Author : String Read FAuthor Write FAuthor;
@@ -126,6 +166,8 @@ type
Property DownloadURL : String Read FDownloadURL Write FDownloadURL;
Property FileName : String Read GetFileName Write FFileName;
Property Email : String Read FEmail Write FEmail;
+ Property OSes : TOSes Read FOSes Write FOses;
+ Property CPUs : TCPUs Read FCPUs Write FCPUs;
Property Checksum : Cardinal Read FChecksum Write FChecksum;
Property IsFPMakeAddIn : boolean read FIsFPMakeAddIn write FIsFPMakeAddIn;
// These properties are used to re-compile the package, when it's dependencies are changed.
@@ -243,6 +285,14 @@ Const
// Max level of dependency searching before we decide it's a circular dependency.
DefaultMaxDependencyLevel = 15;
+Function OSToString(OS: TOS) : String;
+Function OSesToString(OSes: TOSes) : String;
+Function CPUToString(CPU: TCPU) : String;
+Function CPUSToString(CPUS: TCPUS) : String;
+Function StringToOS(S : String) : TOS;
+Function OSesToString(S : String) : TOSes;
+Function StringToCPU(S : String) : TCPU;
+Function StringToCPUS(S : String) : TCPUS;
Function MakeTargetString(CPU : TCPU;OS: TOS) : String;
Procedure StringToCPUOS(S : String; Var CPU : TCPU; Var OS: TOS);
@@ -281,6 +331,64 @@ ResourceString
SErrMirrorNotFound = 'Mirror "%s" not found.';
+Function OSToString(OS: TOS) : String;
+begin
+ Result:=LowerCase(GetenumName(TypeInfo(TOS),Ord(OS)));
+end;
+
+
+Function OSesToString(OSes: TOSes) : String;
+begin
+ Result:=LowerCase(SetToString(PtypeInfo(TypeInfo(TOSes)),Integer(OSes),False));
+end;
+
+
+Function CPUToString(CPU: TCPU) : String;
+begin
+ Result:=LowerCase(GetenumName(TypeInfo(TCPU),Ord(CPU)));
+end;
+
+
+Function CPUSToString(CPUS: TCPUS) : String;
+begin
+ Result:=LowerCase(SetToString(PTypeInfo(TypeInfo(TCPUS)),Integer(CPUS),False));
+end;
+
+
+Function StringToOS(S : String) : TOS;
+Var
+ I : Integer;
+begin
+ I:=GetEnumValue(TypeInfo(TOS),S);
+ if (I=-1) then
+ Raise EPackage.CreateFmt(SErrInvalidOS,[S]);
+ Result:=TOS(I);
+end;
+
+
+Function OSesToString(S : String) : TOSes;
+begin
+ Result:=TOSes(StringToSet(PTypeInfo(TypeInfo(TOSes)),S));
+end;
+
+
+Function StringToCPU(S : String) : TCPU;
+Var
+ I : Integer;
+begin
+ I:=GetEnumValue(TypeInfo(TCPU),S);
+ if (I=-1) then
+ Raise EPackage.CreateFmt(SErrInvalidCPU,[S]);
+ Result:=TCPU(I);
+end;
+
+
+Function StringToCPUS(S : String) : TCPUS;
+begin
+ Result:=TCPUS(StringToSet(PTypeInfo(TypeInfo(TCPUS)),S));
+end;
+
+
Function MakeTargetString(CPU : TCPU;OS: TOS) : String;
begin
Result:=CPUToString(CPU)+'-'+OSToString(OS);
@@ -299,6 +407,131 @@ begin
end;
+{ TFPVersion }
+
+function TFPVersion.GetAsString: String;
+begin
+ if Empty then
+ Result:='<none>'
+ else
+ Result:=Format('%d.%d.%d-%d',[Major,Minor,Micro,Build]);
+end;
+
+
+function TFPVersion.GetEmpty: Boolean;
+begin
+ Result:=(Major=0) and (Minor=0) and (Micro=0) and (Build=0);
+end;
+
+
+procedure TFPVersion.SetAsString(const AValue: String);
+
+ Function NextDigit(sep : Char; NonNumerisIsSep : boolean; var V : string; aDefault : integer = 0) : integer;
+ Var
+ P : Integer;
+ i : Integer;
+ begin
+ P:=Pos(Sep,V);
+ If (P=0) then
+ P:=Length(V)+1;
+ If NonNumerisIsSep then
+ for i := 1 to P-1 do
+ if not (V[i] in ['0','1','2','3','4','5','6','7','8','9']) then
+ begin
+ P := i;
+ Break;
+ end;
+ Result:=StrToIntDef(Copy(V,1,P-1),-1);
+ If Result<>-1 then
+ Delete(V,1,P)
+ else
+ Result:=aDefault;
+ end;
+
+Var
+ V : String;
+ b : integer;
+begin
+ Clear;
+ // Special support for empty version string
+ if (AValue='') or (AValue='<none>') then
+ exit;
+ V:=AValue;
+ // Supported version-format is x.y.z-b
+ // x,y,z and b are all optional and are set to 0 if they are not provided
+ // except for b which has a default of 1.
+ // x and y must be numeric. z or b may contain a non-numeric suffix which
+ // will be stripped. If there is any non-numeric character in z or b and
+ // there is no value supplied for b, build will be set to 0
+ // examples:
+ // 2 -> 2.0.0-1
+ // 2.2 -> 2.2.0-1
+ // 2.2.4 -> 2.2.4-1
+ // 2.2.4-0 -> 2.2.4-0
+ // 2.2.4rc1 -> 2.2.4-0
+ // 2.2.4-0rc1 -> 2.2.4-0
+ // 2.2.4-2rc1 -> 2.2.4-2
+ Major:=NextDigit('.',False,V);
+ Minor:=NextDigit('.',False,V);
+ Micro:=NextDigit('-',True,V);
+ b := NextDigit(#0,True,V,-1);
+ if b<0 then
+ if V <> '' then
+ Build := 0
+ else
+ Build := 1
+ else
+ Build := b;
+end;
+
+
+procedure TFPVersion.Clear;
+begin
+ Micro:=0;
+ Major:=0;
+ Minor:=0;
+ Build:=0;
+end;
+
+
+procedure TFPVersion.Assign(Source: TPersistent);
+Var
+ V : TFPVersion;
+begin
+ if Source is TFPVersion then
+ begin
+ V:=Source as TFPVersion;
+ Major:=V.Major;
+ Minor:=V.Minor;
+ Micro:=V.Micro;
+ Build:=V.Build;
+ end
+ else
+ inherited Assign(Source);
+end;
+
+
+function TFPVersion.CompareVersion(AVersion: TFPVersion): Integer;
+begin
+ Result:=Major-AVersion.Major;
+ If (Result=0) then
+ begin
+ Result:=Minor-AVersion.Minor;
+ if (Result=0) then
+ begin
+ Result:=Micro-AVersion.Micro;
+ If (Result=0) then
+ Result:=Build-AVersion.Build;
+ end;
+ end;
+end;
+
+
+function TFPVersion.SameVersion(AVersion: TFPVersion): Boolean;
+begin
+ Result:=CompareVersion(AVersion)=0;
+end;
+
{ TFPPackage }
procedure TFPPackage.SetVersion(const AValue: TFPVersion);
diff --git a/packages/fppkg/src/fpxmlrep.pp b/packages/fppkg/src/fpxmlrep.pp
index f83302e21a..d3e649ca11 100644
--- a/packages/fppkg/src/fpxmlrep.pp
+++ b/packages/fppkg/src/fpxmlrep.pp
@@ -17,7 +17,7 @@ unit fpxmlrep;
interface
uses
- Classes, SysUtils, dom, fprepos, fpmkunit;
+ Classes, SysUtils, dom, fprepos;
Type
diff --git a/packages/fppkg/src/pkgcommands.pp b/packages/fppkg/src/pkgcommands.pp
index 9fc1bbea27..b35173866c 100644
--- a/packages/fppkg/src/pkgcommands.pp
+++ b/packages/fppkg/src/pkgcommands.pp
@@ -124,16 +124,16 @@ var
procedure TCommandListSettings.Execute;
begin
- GlobalOptions.LogValues(llProgres);
- CompilerOptions.LogValues(llProgres,'');
- FPMakeCompilerOptions.LogValues(llProgres,'fpmake-building ');
+ GlobalOptions.LogValues(vlProgres);
+ CompilerOptions.LogValues(vlProgres,'');
+ FPMakeCompilerOptions.LogValues(vlProgres,'fpmake-building ');
end;
procedure TCommandAddConfig.Execute;
begin
{
- Log(llInfo,SLogGeneratingCompilerConfig,[S]);
+ Log(vlInfo,SLogGeneratingCompilerConfig,[S]);
Options.InitCompilerDefaults(Args[2]);
Options.SaveCompilerToFile(S);
}
@@ -149,13 +149,13 @@ begin
if (GlobalOptions.RemoteMirrorsURL<>'') and
(GlobalOptions.RemoteRepository='auto') then
begin
- Log(llCommands,SLogDownloading,[GlobalOptions.RemoteMirrorsURL,GlobalOptions.LocalMirrorsFile]);
+ Log(vlCommands,SLogDownloading,[GlobalOptions.RemoteMirrorsURL,GlobalOptions.LocalMirrorsFile]);
DownloadFile(GlobalOptions.RemoteMirrorsURL,GlobalOptions.LocalMirrorsFile);
LoadLocalAvailableMirrors;
end;
// Download packages.xml
PackagesURL:=GetRemoteRepositoryURL(PackagesFileName);
- Log(llCommands,SLogDownloading,[PackagesURL,GlobalOptions.LocalPackagesFile]);
+ Log(vlCommands,SLogDownloading,[PackagesURL,GlobalOptions.LocalPackagesFile]);
DownloadFile(PackagesURL,GlobalOptions.LocalPackagesFile);
// Read the repository again
LoadLocalAvailableRepository;
@@ -210,7 +210,7 @@ begin
{ Unzip Archive }
With TUnZipper.Create do
try
- Log(llCommands,SLogUnzippping,[ArchiveFile]);
+ Log(vlCommands,SLogUnzippping,[ArchiveFile]);
OutputPath:=PackageBuildPath(P);
UnZipAllFiles(ArchiveFile);
Finally
@@ -404,12 +404,12 @@ begin
else
status:='OK';
end;
- Log(llInfo,SLogPackageDependency,
+ Log(vlInfo,SLogPackageDependency,
[D.PackageName,D.MinVersion.AsString,PackageInstalledVersionStr(D.PackageName),
PackageAvailableVersionStr(D.PackageName),status]);
end
else
- Log(llDebug,SDbgPackageDependencyOtherTarget,[D.PackageName,MakeTargetString(CompilerOptions.CompilerCPU,CompilerOptions.CompilerOS)]);
+ Log(vlDebug,SDbgPackageDependencyOtherTarget,[D.PackageName,MakeTargetString(CompilerOptions.CompilerCPU,CompilerOptions.CompilerOS)]);
end;
// Give error on first missing dependency
if assigned(MissingDependency) then
@@ -418,7 +418,7 @@ begin
if L.Count > 0 then
begin
if DependenciesDepth=0 then
- pkgglobals.Log(llProgres,SProgrInstallDependencies);
+ pkgglobals.Log(vlProgres,SProgrInstallDependencies);
inc(DependenciesDepth);
for i:=0 to L.Count-1 do
@@ -426,7 +426,7 @@ begin
dec(DependenciesDepth);
if DependenciesDepth=0 then
- pkgglobals.Log(llProgres,SProgrDependenciesInstalled);
+ pkgglobals.Log(vlProgres,SProgrDependenciesInstalled);
end;
FreeAndNil(L);
if FreeManifest then
@@ -444,7 +444,7 @@ begin
FindBrokenPackages(SL);
if SL.Count=0 then
break;
- pkgglobals.Log(llProgres,SProgrReinstallDependent);
+ pkgglobals.Log(vlProgres,SProgrReinstallDependent);
for i:=0 to SL.Count-1 do
begin
ExecuteAction(SL[i],'build');
diff --git a/packages/fppkg/src/pkgdownload.pp b/packages/fppkg/src/pkgdownload.pp
index 90634c0de2..e41bcb9dca 100644
--- a/packages/fppkg/src/pkgdownload.pp
+++ b/packages/fppkg/src/pkgdownload.pp
@@ -168,8 +168,8 @@ begin
DownloaderClass:=GetDownloader(GlobalOptions.Downloader);
with DownloaderClass.Create(nil) do
try
- Log(llCommands,SLogDownloading,[PackageRemoteArchive(P),PackageLocalArchive(P)]);
- pkgglobals.log(llProgres,SProgrDownloadPackage,[P.Name, P.Version.AsString]);
+ Log(vlCommands,SLogDownloading,[PackageRemoteArchive(P),PackageLocalArchive(P)]);
+ pkgglobals.log(vlProgres,SProgrDownloadPackage,[P.Name, P.Version.AsString]);
Download(PackageRemoteArchive(P),PackageLocalArchive(P));
finally
Free;
diff --git a/packages/fppkg/src/pkgfpmake.pp b/packages/fppkg/src/pkgfpmake.pp
index 645b61aa0e..da89c863fd 100644
--- a/packages/fppkg/src/pkgfpmake.pp
+++ b/packages/fppkg/src/pkgfpmake.pp
@@ -6,7 +6,7 @@ interface
uses
Classes,SysUtils,DateUtils,
- pkghandler, fpmkunit;
+ pkghandler;
implementation
@@ -224,7 +224,7 @@ begin
// Compile options
// -- default is to optimize, smartlink and strip to reduce
// the executable size (there can be 100's of fpmake's on a system)
- if llInfo in LogLevels then
+ if vlInfo in LogLevels then
AddOption('-vi');
AddOption('-O2');
AddOption('-XXs');
@@ -243,7 +243,7 @@ begin
DeleteDir(TempBuildDir);
end
else
- Log(llCommands,SLogNotCompilingFPMake);
+ Log(vlCommands,SLogNotCompilingFPMake);
end;
@@ -295,9 +295,9 @@ begin
{ Maybe compile fpmake executable? }
ExecuteAction(PackageName,'compilefpmake');
{ Create options }
- if llDebug in LogLevels then
+ if vlDebug in LogLevels then
AddOption('--debug')
- else if llInfo in LogLevels then
+ else if vlInfo in LogLevels then
AddOption('--verbose');
if P.RecompileBroken and
(P.FPMakeOptionsString<>'') then // Check for a empty FPMakeOptionString for packages being installed with an old fpmkunit
diff --git a/packages/fppkg/src/pkgglobals.pp b/packages/fppkg/src/pkgglobals.pp
index b64b17fbee..f08dad086f 100644
--- a/packages/fppkg/src/pkgglobals.pp
+++ b/packages/fppkg/src/pkgglobals.pp
@@ -10,7 +10,6 @@ uses
{$endif}
SysUtils,
Classes,
- fpmkunit,
fprepos;
Const
@@ -53,13 +52,13 @@ Const
);
Type
- TLogLevel = (llError,llWarning,llInfo,llCommands,llDebug,llProgres);
+ TLogLevel = (vlError,vlWarning,vlInfo,vlCommands,vlDebug,vlProgres);
TLogLevels = Set of TLogLevel;
TLogProc = procedure(Level:TLogLevel;Const Msg: String);
const
- DefaultLogLevels = [llError,llWarning, llProgres];
- AllLogLevels = [llError,llWarning,llCommands,llInfo];
+ DefaultLogLevels = [vlError,vlWarning, vlProgres];
+ AllLogLevels = [vlError,vlWarning,vlCommands,vlInfo];
type
EPackagerError = class(Exception);
@@ -155,15 +154,15 @@ begin
exit;
Prefix:='';
case Level of
- llWarning :
+ vlWarning :
Prefix:=SWarning;
- llError :
+ vlError :
Prefix:=SError;
-{ llInfo :
+{ vlInfo :
Prefix:='I: ';
- llCommands :
+ vlCommands :
Prefix:='C: ';
- llDebug :
+ vlDebug :
Prefix:='D: '; }
end;
Writeln(stdOut,Prefix,Msg);
@@ -254,9 +253,9 @@ Function DirectoryExistsLog(const ADir:string):Boolean;
begin
result:=SysUtils.DirectoryExists(ADir);
if result then
- log(llDebug,SDbgDirectoryExists,[ADir,SDbgFound])
+ log(vlDebug,SDbgDirectoryExists,[ADir,SDbgFound])
else
- log(llDebug,SDbgDirectoryExists,[ADir,SDbgNotFound]);
+ log(vlDebug,SDbgDirectoryExists,[ADir,SDbgNotFound]);
end;
@@ -264,9 +263,9 @@ Function FileExistsLog(const AFileName:string):Boolean;
begin
result:=SysUtils.FileExists(AFileName);
if result then
- log(llDebug,SDbgFileExists,[AFileName,SDbgFound])
+ log(vlDebug,SDbgFileExists,[AFileName,SDbgFound])
else
- log(llDebug,SDbgFileExists,[AFileName,SDbgNotFound]);
+ log(vlDebug,SDbgFileExists,[AFileName,SDbgNotFound]);
end;
@@ -275,7 +274,7 @@ Var
BFN : String;
begin
BFN:=AFileName+'.bak';
- log(llDebug,SDbgBackupFile,[BFN]);
+ log(vlDebug,SDbgBackupFile,[BFN]);
If not RenameFile(AFileName,BFN) then
Error(SErrBackupFailed,[AFileName,BFN]);
end;
diff --git a/packages/fppkg/src/pkghandler.pp b/packages/fppkg/src/pkghandler.pp
index 1358e0a89d..7543c59825 100644
--- a/packages/fppkg/src/pkghandler.pp
+++ b/packages/fppkg/src/pkghandler.pp
@@ -87,7 +87,7 @@ begin
FullActionName:=APackageName+AAction;
if ExecutedActions.Find(FullActionName)<>nil then
begin
- Log(llDebug,'Already executed or executing action '+FullActionName);
+ Log(vlDebug,'Already executed or executing action '+FullActionName);
exit;
end;
@@ -97,9 +97,9 @@ begin
pkghandlerclass:=GetPkgHandler(AAction);
With pkghandlerclass.Create(nil,APackageName) do
try
- Log(llDebug,SLogRunAction+' start',[AAction]);
+ Log(vlDebug,SLogRunAction+' start',[AAction]);
Execute;
- Log(llDebug,SLogRunAction+' end',[AAction]);
+ Log(vlDebug,SLogRunAction+' end',[AAction]);
finally
Free;
end;
@@ -169,93 +169,9 @@ begin
FPackageName:=APackageName;
end;
-{$ifdef HAS_UNIT_PROCESS}
-function ExecuteFPC(const Path: string; const ComLine: string): integer;
-var
- P: TProcess;
- ConsoleOutput: TMemoryStream;
- BytesRead: longint;
-
- function ReadFromStream: longint;
-
- const
- READ_BYTES = 2048;
-
- var
- n: longint;
- BuffPos: longint;
- sLine: string;
- ch: char;
- begin
- // make sure we have room
- ConsoleOutput.SetSize(BytesRead + READ_BYTES);
-
- // try reading it
- n := P.Output.Read((ConsoleOutput.Memory + BytesRead)^, READ_BYTES);
- if n > 0 then
- begin
- Inc(BytesRead, n);
-
- sLine := '';
- BuffPos := ConsoleOutput.Position;
-
- //read lines from the stream
- repeat
- ConsoleOutput.Read(ch,1);
-
- if ch in [#10, #13] then
- begin
- log(llProgres,sLine);
- sLine := '';
- BuffPos := ConsoleOutput.Position;
- end
- else
- sLine := sLine + ch;
-
- until ConsoleOutput.Position >= BytesRead;
-
- ConsoleOutput.Position := BuffPos;
- end
- else
- begin
- // no data, wait 100 ms
- Sleep(100);
- end;
-
- Result := n;
- end;
-
-begin
- result := -1;
- BytesRead := 0;
- ConsoleOutput := TMemoryStream.Create;
- try
- P := TProcess.Create(nil);
- try
- P.CommandLine := Path + ' ' + ComLine;
- P.Options := [poUsePipes];
- P.Execute;
- while P.Running do
- ReadFromStream;
-
- // read last part
- repeat
- until ReadFromStream = 0;
- ConsoleOutput.SetSize(BytesRead);
-
- result := P.ExitStatus;
- finally
- P.Free;
- end;
- finally
- ConsoleOutput.Free;
- end;
-end;
-{$endif HAS_UNIT_PROCESS}
-
Function TPackageHandler.ExecuteProcess(Const Prog,Args:String):Integer;
begin
- Log(llCommands,SLogExecute,[Prog,Args]);
+ Log(vlCommands,SLogExecute,[Prog,Args]);
Flush(StdOut);
Result:=SysUtils.ExecuteProcess(Prog,Args);
end;
@@ -263,7 +179,7 @@ end;
Procedure TPackageHandler.SetCurrentDir(Const ADir:String);
begin
- Log(llCommands,SLogChangeDir,[ADir]);
+ Log(vlCommands,SLogChangeDir,[ADir]);
if not SysUtils.SetCurrentDir(ADir) then
Error(SErrChangeDirFailed,[ADir]);
end;
diff --git a/packages/fppkg/src/pkgmkconv.pp b/packages/fppkg/src/pkgmkconv.pp
index 1e06b6bf7a..240cce18e5 100644
--- a/packages/fppkg/src/pkgmkconv.pp
+++ b/packages/fppkg/src/pkgmkconv.pp
@@ -598,7 +598,7 @@ Var
B : Boolean;
begin
- Log(llDebug,'Converting '+AFileName);
+ Log(vlDebug,'Converting '+AFileName);
T:=Nil;
D:=Nil;
S:=Nil;
@@ -684,7 +684,7 @@ Var
L : TStrings;
begin
- Log(llInfo,SLogGeneratingFPMake);
+ Log(vlInfo,SLogGeneratingFPMake);
L:=TStringList.Create;
Try
StartInstaller(L);
diff --git a/packages/fppkg/src/pkgoptions.pp b/packages/fppkg/src/pkgoptions.pp
index 91a15a9f8c..eae37ba7d8 100644
--- a/packages/fppkg/src/pkgoptions.pp
+++ b/packages/fppkg/src/pkgoptions.pp
@@ -16,7 +16,7 @@ unit pkgoptions;
interface
-uses Classes, Sysutils, Inifiles, fprepos, fpTemplate, pkgglobals, fpmkunit;
+uses Classes, Sysutils, Inifiles, fprepos, fpTemplate, pkgglobals;
Const
UnitConfigFileName = 'fpunits.cfg';
@@ -238,11 +238,11 @@ begin
GlobalOptions.CompilerConfig:=GlobalOptions.DefaultCompilerConfig;
// Tracing of what we've done above, need to be done after the verbosity is set
if GeneratedConfig then
- pkgglobals.Log(llDebug,SLogGeneratingGlobalConfig,[cfgfile])
+ pkgglobals.Log(vlDebug,SLogGeneratingGlobalConfig,[cfgfile])
else
- pkgglobals.Log(llDebug,SLogLoadingGlobalConfig,[cfgfile]);
+ pkgglobals.Log(vlDebug,SLogLoadingGlobalConfig,[cfgfile]);
// Log configuration
- GlobalOptions.LogValues(llDebug);
+ GlobalOptions.LogValues(vlDebug);
end;
@@ -255,7 +255,7 @@ begin
CompilerOptions.UpdateLocalRepositoryOption;
if FileExists(S) then
begin
- pkgglobals.Log(llDebug,SLogLoadingCompilerConfig,[S]);
+ pkgglobals.Log(vlDebug,SLogLoadingCompilerConfig,[S]);
CompilerOptions.LoadCompilerFromFile(S)
end
else
@@ -263,7 +263,7 @@ begin
// Generate a default configuration if it doesn't exists
if GlobalOptions.CompilerConfig='default' then
begin
- pkgglobals.Log(llDebug,SLogGeneratingCompilerConfig,[S]);
+ pkgglobals.Log(vlDebug,SLogGeneratingCompilerConfig,[S]);
CompilerOptions.InitCompilerDefaults;
CompilerOptions.SaveCompilerToFile(S);
if CompilerOptions.SaveInifileChanges then
@@ -273,13 +273,13 @@ begin
Error(SErrMissingCompilerConfig,[S]);
end;
// Log compiler configuration
- CompilerOptions.LogValues(llDebug,'');
+ CompilerOptions.LogValues(vlDebug,'');
// 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(llDebug,SLogLoadingFPMakeCompilerConfig,[S]);
+ pkgglobals.Log(vlDebug,SLogLoadingFPMakeCompilerConfig,[S]);
FPMakeCompilerOptions.LoadCompilerFromFile(S);
if FPMakeCompilerOptions.SaveInifileChanges then
FPMakeCompilerOptions.SaveCompilerToFile(S);
@@ -287,7 +287,7 @@ begin
else
Error(SErrMissingCompilerConfig,[S]);
// Log compiler configuration
- FPMakeCompilerOptions.LogValues(llDebug,'fpmake-building ');
+ FPMakeCompilerOptions.LogValues(vlDebug,'fpmake-building ');
end;
@@ -439,7 +439,7 @@ begin
FConfigVersion:=ReadInteger(SDefaults,KeyConfigVersion,0);
if (FConfigVersion<>CurrentConfigVersion) then
begin
- log(llDebug,SLogUpgradingConfig,[AFileName]);
+ log(vlDebug,SLogUpgradingConfig,[AFileName]);
FSaveInifileChanges:=true;
if FConfigVersion<1 then
begin
@@ -688,7 +688,7 @@ begin
// We retrieve the real binary
if FCompilerVersion='2.2.0' then
FCompiler:=GetCompilerInfo(FCompiler,'-PB');
- log(llDebug,SLogDetectedCompiler,[FCompiler,FCompilerVersion,MakeTargetString(FCompilerCPU,FCompilerOS)]);
+ log(vlDebug,SLogDetectedCompiler,[FCompiler,FCompilerVersion,MakeTargetString(FCompilerCPU,FCompilerOS)]);
// Use the same algorithm as the compiler, see options.pas
// Except that the prefix is extracted and GlobalInstallDir is set using
@@ -706,12 +706,12 @@ begin
FGlobalPrefix:=ExpandFileName(FGlobalPrefix);
{$endif unix}
- log(llDebug,SLogDetectedPrefix,['global',FGlobalPrefix]);
+ log(vlDebug,SLogDetectedPrefix,['global',FGlobalPrefix]);
// User writable install directory
if not IsSuperUser then
begin
FLocalPrefix:= '{LocalRepository}';
- log(llDebug,SLogDetectedPrefix,['local',FLocalPrefix]);
+ log(vlDebug,SLogDetectedPrefix,['local',FLocalPrefix]);
end;
fpcdir:=FixPath(GetEnvironmentVariable('FPCDIR'));
@@ -720,7 +720,7 @@ begin
{$ifndef Unix}
fpcdir:=ExpandFileName(fpcdir);
{$endif unix}
- log(llDebug,SLogFPCDirEnv,[fpcdir]);
+ log(vlDebug,SLogFPCDirEnv,[fpcdir]);
FGlobalInstallDir:=fpcdir;
end;
end;
@@ -738,7 +738,7 @@ begin
FConfigVersion:=ReadInteger(SDefaults,KeyConfigVersion,0);
if (FConfigVersion<>CurrentConfigVersion) then
begin
- log(llDebug,SLogUpgradingConfig,[AFileName]);
+ log(vlDebug,SLogUpgradingConfig,[AFileName]);
FSaveInifileChanges:=true;
if (FConfigVersion>CurrentConfigVersion) then
Error(SErrUnsupportedConfigVersion,[AFileName]);
diff --git a/packages/fppkg/src/pkgrepos.pp b/packages/fppkg/src/pkgrepos.pp
index fdafc0fff4..0aa66f3dbd 100644
--- a/packages/fppkg/src/pkgrepos.pp
+++ b/packages/fppkg/src/pkgrepos.pp
@@ -6,8 +6,7 @@ interface
uses
SysUtils,Classes,
- fprepos,pkgoptions,
- fpmkunit;
+ fprepos,pkgoptions;
function GetRemoteRepositoryURL(const AFileName:string):string;
@@ -81,7 +80,7 @@ begin
// Repository
S:=GlobalOptions.LocalMirrorsFile;
- log(llDebug,SLogLoadingMirrorsFile,[S]);
+ log(vlDebug,SLogLoadingMirrorsFile,[S]);
if not FileExists(S) then
exit;
try
@@ -95,7 +94,7 @@ begin
except
on E : Exception do
begin
- Log(llError,E.Message);
+ Log(vlError,E.Message);
Error(SErrCorruptMirrorsFile,[S]);
end;
end;
@@ -137,7 +136,7 @@ begin
end;
if assigned(M) then
begin
- log(llInfo,SLogSelectedMirror,[M.Name]);
+ log(vlInfo,SLogSelectedMirror,[M.Name]);
Result:=M.URL;
end
else
@@ -206,7 +205,7 @@ procedure FindInstalledPackages(ACompilerOptions:TCompilerOptions;showdups:boole
result.UnusedVersion:=result.Version;
// Log packages found in multiple locations (local and global) ?
if showdups then
- log(llDebug,SDbgPackageMultipleLocations,[result.Name,ExtractFilePath(AFileName)]);
+ log(vlDebug,SDbgPackageMultipleLocations,[result.Name,ExtractFilePath(AFileName)]);
end;
result.InstalledLocally:=Local;
end;
@@ -235,7 +234,7 @@ procedure FindInstalledPackages(ACompilerOptions:TCompilerOptions;showdups:boole
Result:=false;
if FindFirst(IncludeTrailingPathDelimiter(AUnitDir)+AllFiles,faDirectory,SR)=0 then
begin
- log(llDebug,SLogFindInstalledPackages,[AUnitDir]);
+ log(vlDebug,SLogFindInstalledPackages,[AUnitDir]);
repeat
if ((SR.Attr and faDirectory)=faDirectory) and (SR.Name<>'.') and (SR.Name<>'..') then
begin
@@ -279,7 +278,7 @@ end;
Procedure AddFPMakeAddIn(APackage: TFPPackage);
begin
- log(llDebug,SLogFoundFPMakeAddin,[APackage.Name]);
+ log(vlDebug,SLogFoundFPMakeAddin,[APackage.Name]);
setlength(FPMKUnitDeps,length(FPMKUnitDeps)+1);
FPMKUnitDeps[high(FPMKUnitDeps)].package:=APackage.Name;
FPMKUnitDeps[high(FPMKUnitDeps)].reqver:=APackage.Version.AsString;
@@ -308,7 +307,7 @@ begin
begin
if (DepPackage.Checksum<>D.RequireChecksum) then
begin
- log(llInfo,SLogPackageChecksumChanged,[APackage.Name,D.PackageName]);
+ log(vlInfo,SLogPackageChecksumChanged,[APackage.Name,D.PackageName]);
result:=true;
if MarkForReInstall then
begin
@@ -337,7 +336,7 @@ begin
end;
end
else
- log(llDebug,SDbgObsoleteDependency,[D.PackageName]);
+ log(vlDebug,SDbgObsoleteDependency,[D.PackageName]);
end;
end;
end;
@@ -387,19 +386,15 @@ begin
else
AvailVerStr:='<not available>';
ReqVer:=TFPVersion.Create;
- try
- ReqVer.AsString:=FPMKUnitDeps[i].ReqVer;
- log(llDebug,SLogFPMKUnitDepVersion,[P.Name,ReqVer.AsString,P.Version.AsString,AvailVerStr]);
- if ReqVer.CompareVersion(P.Version)<=0 then
- FPMKUnitDeps[i].available:=true
- else
- log(llDebug,SLogFPMKUnitDepTooOld,[FPMKUnitDeps[i].package]);
- finally
- ReqVer.Free;
- end;
+ ReqVer.AsString:=FPMKUnitDeps[i].ReqVer;
+ log(vlDebug,SLogFPMKUnitDepVersion,[P.Name,ReqVer.AsString,P.Version.AsString,AvailVerStr]);
+ if ReqVer.CompareVersion(P.Version)<=0 then
+ FPMKUnitDeps[i].available:=true
+ else
+ log(vlDebug,SLogFPMKUnitDepTooOld,[FPMKUnitDeps[i].package]);
end
else
- log(llDebug,SLogFPMKUnitDepTooOld,[FPMKUnitDeps[i].package]);
+ log(vlDebug,SLogFPMKUnitDepTooOld,[FPMKUnitDeps[i].package]);
end;
end;
@@ -418,7 +413,7 @@ begin
AvailableRepository:=GetDefaultRepositoryClass.Create(Nil);
// Repository
S:=GlobalOptions.LocalPackagesFile;
- log(llDebug,SLogLoadingPackagesFile,[S]);
+ log(vlDebug,SLogLoadingPackagesFile,[S]);
if not FileExists(S) then
exit;
try
@@ -432,7 +427,7 @@ begin
except
on E : Exception do
begin
- Log(llError,E.Message);
+ Log(vlError,E.Message);
Error(SErrCorruptPackagesFile,[S]);
end;
end;
@@ -629,7 +624,7 @@ begin
{ Unzip manifest.xml }
With TUnZipper.Create do
try
- log(llCommands,SLogUnzippping,[ArchiveSL[i]]);
+ log(vlCommands,SLogUnzippping,[ArchiveSL[i]]);
OutputPath:='.';
UnZipFiles(ArchiveSL[i],ManifestSL);
Finally
diff --git a/utils/fppkg/fppkg.pp b/utils/fppkg/fppkg.pp
index b644dfc20c..de872a898d 100644
--- a/utils/fppkg/fppkg.pp
+++ b/utils/fppkg/fppkg.pp
@@ -9,7 +9,7 @@ program fppkg;
uses
// General
{$ifdef unix}
- baseunix, cthreads,
+ baseunix,
{$endif}
Classes, SysUtils, TypInfo, custapp,
// Repository handler objects
@@ -17,8 +17,7 @@ uses
pkgmessages, pkgglobals, pkgoptions, pkgrepos,
// Package Handler components
pkghandler,pkgmkconv, pkgdownload,
- pkgfpmake, pkgcommands,
- fpmkunit
+ pkgfpmake, pkgcommands
// Downloaders
{$if defined(unix) or defined(windows)}
,pkgwget
@@ -58,7 +57,7 @@ begin
for i:=1 to ParamCount do
if (ParamStr(i)='-d') or (ParamStr(i)='--debug') then
begin
- LogLevels:=AllLogLevels+[llDebug];
+ LogLevels:=AllLogLevels+[vlDebug];
break;
end;
// First try config file from command line
@@ -199,7 +198,7 @@ begin
else if CheckOption(I,'v','verbose') then
LogLevels:=AllLogLevels
else if CheckOption(I,'d','debug') then
- LogLevels:=AllLogLevels+[llDebug]
+ LogLevels:=AllLogLevels+[vlDebug]
else if CheckOption(I,'g','global') then
GlobalOptions.InstallGlobal:=true
else if CheckOption(I,'r','recovery') then
@@ -314,7 +313,7 @@ begin
pkghandler.ExecuteAction('','update');
except
on E: Exception do
- pkgglobals.Log(llWarning,E.Message);
+ pkgglobals.Log(vlWarning,E.Message);
end;
end;
LoadLocalAvailableRepository;
@@ -333,7 +332,7 @@ begin
(ParaAction='install') or
(ParaAction='archive')) then
begin
- pkgglobals.Log(llDebug,SLogCheckBrokenDependenvies);
+ pkgglobals.Log(vlDebug,SLogCheckBrokenDependenvies);
SL:=TStringList.Create;
if FindBrokenPackages(SL) then
Error(SErrBrokenPackagesFound);
@@ -358,7 +357,7 @@ begin
end
else
begin
- pkgglobals.Log(llDebug,SLogCommandLineAction,['['+ParaPackages[i]+']',ParaAction]);
+ pkgglobals.Log(vlDebug,SLogCommandLineAction,['['+ParaPackages[i]+']',ParaAction]);
pkghandler.ExecuteAction(ParaPackages[i],ParaAction);
end;
end;