* 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
for i:=0 to ParaPackages.Count-1 do
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]);
res:=pkghandler.ExecuteAction(ActionPackage,ParaAction);
if ActionPackage.IsLocalPackage then;
FreeAndNil(ActionPackage);
if not res then
break;
end;

View File

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

View File

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

View File

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