* support passing archive on the commandline for build,compile,install.

this can be used to test build of archives using 'fppkg archive && fppkg build <archive.zip>'

git-svn-id: trunk@9858 -
This commit is contained in:
peter 2008-01-21 17:58:18 +00:00
parent 2adb03d965
commit 2377b34d16
4 changed files with 21 additions and 2 deletions

View File

@ -291,9 +291,19 @@ begin
// Process packages // Process packages
for i:=0 to ParaPackages.Count-1 do for i:=0 to ParaPackages.Count-1 do
begin begin
ActionPackage:=CurrentRepository.PackageByName(ParaPackages[i]); if FileExists(ParaPackages[i]) then
begin
ActionPackage:=TFPPackage.Create(nil);
ActionPackage.Name:=ChangeFileExt(ExtractFileName(ParaPackages[i]),'');
ActionPackage.FileName:=ExpandFileName(ParaPackages[i]);
ActionPackage.IsLocalPackage:=true;
end
else
ActionPackage:=CurrentRepository.PackageByName(ParaPackages[i]);
Log(vDebug,SLogCommandLineAction,['['+ActionPackage.Name+']',ParaAction]); Log(vDebug,SLogCommandLineAction,['['+ActionPackage.Name+']',ParaAction]);
res:=pkghandler.ExecuteAction(ActionPackage,ParaAction); res:=pkghandler.ExecuteAction(ActionPackage,ParaAction);
if ActionPackage.IsLocalPackage then;
FreeAndNil(ActionPackage);
if not res then if not res then
break; break;
end; end;

View File

@ -111,6 +111,7 @@ Type
FDependencies : TFPDependencies; FDependencies : TFPDependencies;
FOSes : TOSES; FOSes : TOSES;
FCPUs : TCPUS; FCPUs : TCPUS;
FIsLocalPackage : Boolean;
function GetDependencies: TFPDependencies; function GetDependencies: TFPDependencies;
function GetHasDependencies: Boolean; function GetHasDependencies: Boolean;
function GetFileName: String; function GetFileName: String;
@ -139,6 +140,8 @@ Type
Property Email : String Read FEmail Write FEmail; Property Email : String Read FEmail Write FEmail;
Property OSes : TOSes Read FOSes Write FOses; Property OSes : TOSes Read FOSes Write FOses;
Property CPUs : TCPUs Read FCPUs Write FCPUs; Property CPUs : TCPUs Read FCPUs Write FCPUs;
// Manual package from commandline not in official repository
Property IsLocalPackage : Boolean Read FIsLocalPackage Write FIsLocalPackage;
end; end;
{ TFPPackages } { TFPPackages }

View File

@ -174,6 +174,8 @@ function TPackageHandler.PackageRemoteArchive: String;
begin begin
if not assigned(CurrentPackage) then if not assigned(CurrentPackage) then
Error(SErrNoPackageSpecified); Error(SErrNoPackageSpecified);
if CurrentPackage.IsLocalPackage then
Error(SErrPackageIsLocal);
if CurrentPackage.ExternalURL<>'' then if CurrentPackage.ExternalURL<>'' then
Result:=CurrentPackage.ExternalURL Result:=CurrentPackage.ExternalURL
else else
@ -184,7 +186,10 @@ function TPackageHandler.PackageLocalArchive: String;
begin begin
if not assigned(CurrentPackage) then if not assigned(CurrentPackage) then
Error(SErrNoPackageSpecified); Error(SErrNoPackageSpecified);
Result:=GlobalOptions.PackagesDir+CurrentPackage.FileName; if CurrentPackage.IsLocalPackage then
Result:=CurrentPackage.FileName
else
Result:=GlobalOptions.PackagesDir+CurrentPackage.FileName;
end; end;

View File

@ -38,6 +38,7 @@ Resourcestring
SErrInvalidCommand = 'Invalid command: %s'; SErrInvalidCommand = 'Invalid command: %s';
SErrChangeDirFailed = 'Could not change directory to "%s"'; SErrChangeDirFailed = 'Could not change directory to "%s"';
SErrCorruptPackagesFile = 'Packages file "%s" is corrupt, delete file manual and retry'; SErrCorruptPackagesFile = 'Packages file "%s" is corrupt, delete file manual and retry';
SErrPackageIsLocal = 'Operation not supported for local packages';
SErrHTTPGetFailed = 'HTTP Download failed.'; SErrHTTPGetFailed = 'HTTP Download failed.';
SErrLoginFailed = 'FTP LOGIN command failed.'; SErrLoginFailed = 'FTP LOGIN command failed.';