mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 13:06:18 +02:00
* Added fppkg option to gather info on a package
git-svn-id: trunk@32224 -
This commit is contained in:
parent
f004227d91
commit
18b66865ac
@ -125,9 +125,58 @@ type
|
|||||||
Procedure Execute;override;
|
Procedure Execute;override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ TCommandInfo }
|
||||||
|
|
||||||
|
TCommandInfo = Class(TPackagehandler)
|
||||||
|
Public
|
||||||
|
Procedure Execute;override;
|
||||||
|
end;
|
||||||
|
|
||||||
var
|
var
|
||||||
DependenciesDepth: integer;
|
DependenciesDepth: integer;
|
||||||
|
|
||||||
|
{ TCommandInfo }
|
||||||
|
|
||||||
|
procedure TCommandInfo.Execute;
|
||||||
|
var
|
||||||
|
P : TFPPackage;
|
||||||
|
S : string;
|
||||||
|
I : Integer;
|
||||||
|
begin
|
||||||
|
if PackageName='' then
|
||||||
|
Error(SErrNoPackageSpecified);
|
||||||
|
P:=AvailableRepository.PackageByName(PackageName);
|
||||||
|
|
||||||
|
log(llProgres,SLogPackageInfoName,[P.Name]);
|
||||||
|
S := P.Email;
|
||||||
|
if S <> '' then
|
||||||
|
S := '<' + S +'>';
|
||||||
|
log(llProgres,SLogPackageInfoAuthor,[P.Author, S]);
|
||||||
|
log(llProgres,SLogPackageInfoVersion,[P.Version.AsString]);
|
||||||
|
log(llProgres,SLogPackageInfoCategory,[P.Category]);
|
||||||
|
log(llProgres,SLogPackageInfoWebsite,[P.HomepageURL]);
|
||||||
|
log(llProgres,SLogPackageInfoLicense,[P.License]);
|
||||||
|
|
||||||
|
log(llProgres,SLogPackageInfoOSes,[OSesToString(P.OSes)]);
|
||||||
|
log(llProgres,SLogPackageInfoCPUs,[CPUSToString(P.CPUs)]);
|
||||||
|
|
||||||
|
log(llProgres,SLogPackageInfoDescription1);
|
||||||
|
log(llProgres,SLogPackageInfoDescription2,[P.Description]);
|
||||||
|
|
||||||
|
if P.Dependencies.Count>0 then
|
||||||
|
begin
|
||||||
|
log(llProgres,SLogPackageInfoDependencies1,[]);
|
||||||
|
for I := 0 to P.Dependencies.Count-1 do
|
||||||
|
begin
|
||||||
|
if not P.Dependencies[I].MinVersion.Empty then
|
||||||
|
S := '('+P.Dependencies[I].MinVersion.AsString+')'
|
||||||
|
else
|
||||||
|
S := '';
|
||||||
|
log(llProgres,SLogPackageInfoDependencies2,[P.Dependencies[I].PackageName,S]);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
{ TCommandUnInstall }
|
{ TCommandUnInstall }
|
||||||
|
|
||||||
procedure TCommandUnInstall.Execute;
|
procedure TCommandUnInstall.Execute;
|
||||||
@ -585,4 +634,5 @@ initialization
|
|||||||
RegisterPkgHandler('installdependencies',TCommandInstallDependencies);
|
RegisterPkgHandler('installdependencies',TCommandInstallDependencies);
|
||||||
RegisterPkgHandler('fixbroken',TCommandFixBroken);
|
RegisterPkgHandler('fixbroken',TCommandFixBroken);
|
||||||
RegisterPkgHandler('listsettings',TCommandListSettings);
|
RegisterPkgHandler('listsettings',TCommandListSettings);
|
||||||
|
RegisterPkgHandler('info',TCommandInfo);
|
||||||
end.
|
end.
|
||||||
|
@ -101,6 +101,19 @@ Resourcestring
|
|||||||
SLogCompilerCfgGlobalPrefix = ' GlobalPrefix: "%s" -> "%s"';
|
SLogCompilerCfgGlobalPrefix = ' GlobalPrefix: "%s" -> "%s"';
|
||||||
SLogCompilerCfgLocalPrefix = ' LocalPrefix: "%s" -> "%s"';
|
SLogCompilerCfgLocalPrefix = ' LocalPrefix: "%s" -> "%s"';
|
||||||
|
|
||||||
|
SLogPackageInfoName = 'Package: %s';
|
||||||
|
SLogPackageInfoVersion = 'Version: %s';
|
||||||
|
SLogPackageInfoAuthor = 'Author: %s %s';
|
||||||
|
SLogPackageInfoCategory = 'Category: %s';
|
||||||
|
SLogPackageInfoLicense = 'License: %s';
|
||||||
|
SLogPackageInfoWebsite = 'Website: %s';
|
||||||
|
SLogPackageInfoOSes = 'Supported OSes: %s';
|
||||||
|
SLogPackageInfoCPUs = 'Supported CPUs: %s';
|
||||||
|
SLogPackageInfoDescription1 = 'Description:';
|
||||||
|
SLogPackageInfoDescription2 = '%s';
|
||||||
|
SLogPackageInfoDependencies1 = 'Dependencies:';
|
||||||
|
SLogPackageInfoDependencies2 = ' %s %s';
|
||||||
|
|
||||||
SDbgFound = 'Found';
|
SDbgFound = 'Found';
|
||||||
SDbgNotFound = 'Not Found';
|
SDbgNotFound = 'Not Found';
|
||||||
SDbgDirectoryExists = 'Directory "%s" %s';
|
SDbgDirectoryExists = 'Directory "%s" %s';
|
||||||
|
@ -110,6 +110,7 @@ begin
|
|||||||
Writeln(' archive Create archive of package');
|
Writeln(' archive Create archive of package');
|
||||||
Writeln(' download Download package');
|
Writeln(' download Download package');
|
||||||
Writeln(' convertmk Convert Makefile.fpc to fpmake.pp');
|
Writeln(' convertmk Convert Makefile.fpc to fpmake.pp');
|
||||||
|
Writeln(' info Show more information about a package');
|
||||||
Writeln(' fixbroken Recompile all (broken) packages with changed dependencies');
|
Writeln(' fixbroken Recompile all (broken) packages with changed dependencies');
|
||||||
Writeln(' listsettings Show the values for all fppkg settings');
|
Writeln(' listsettings Show the values for all fppkg settings');
|
||||||
// Writeln(' addconfig Add a compiler configuration for the supplied compiler');
|
// Writeln(' addconfig Add a compiler configuration for the supplied compiler');
|
||||||
|
Loading…
Reference in New Issue
Block a user