mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 23:09:08 +02:00
* Show ''broken'' option and ''fixbroken'' command in help
* Help output fits now in a width of 80 chars * Do only fail on broken packages for commands for which this is relevant * Show which packages are broken in the list of packages git-svn-id: trunk@15243 -
This commit is contained in:
parent
d9c64ed3c1
commit
2ad42e8d8f
@ -168,23 +168,25 @@ procedure TMakeTool.ShowUsage;
|
|||||||
begin
|
begin
|
||||||
Writeln('Usage: ',Paramstr(0),' [options] <action> <package>');
|
Writeln('Usage: ',Paramstr(0),' [options] <action> <package>');
|
||||||
Writeln('Options:');
|
Writeln('Options:');
|
||||||
Writeln(' -c --config Set compiler configuration to use');
|
Writeln(' -c --config Set compiler configuration to use');
|
||||||
Writeln(' -h --help This help');
|
Writeln(' -h --help This help');
|
||||||
Writeln(' -v --verbose Show more information');
|
Writeln(' -v --verbose Show more information');
|
||||||
Writeln(' -d --debug Show debugging information');
|
Writeln(' -d --debug Show debugging information');
|
||||||
Writeln(' -g --global Force installation to global (system-wide) directory');
|
Writeln(' -g --global Force installation to global (system-wide) directory');
|
||||||
Writeln(' -f --force Force installation also if the package is already installed');
|
Writeln(' -f --force Force installation also if the package is already installed');
|
||||||
Writeln(' -r --recovery Recovery mode, use always internal fpmkunit');
|
Writeln(' -r --recovery Recovery mode, use always internal fpmkunit');
|
||||||
|
Writeln(' -b --broken Do not stop on broken packages');
|
||||||
Writeln('Actions:');
|
Writeln('Actions:');
|
||||||
Writeln(' update Update packages list');
|
Writeln(' update Update packages list');
|
||||||
Writeln(' list List available and installed packages');
|
Writeln(' list List available and installed packages');
|
||||||
Writeln(' build Build package');
|
Writeln(' build Build package');
|
||||||
Writeln(' compile Compile package');
|
Writeln(' compile Compile package');
|
||||||
Writeln(' install Install package');
|
Writeln(' install Install package');
|
||||||
Writeln(' clean Clean package');
|
Writeln(' clean Clean package');
|
||||||
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(' fixbroken Recompile all (broken) packages with changed dependencies');
|
||||||
// Writeln(' addconfig Add a compiler configuration for the supplied compiler');
|
// Writeln(' addconfig Add a compiler configuration for the supplied compiler');
|
||||||
Halt(0);
|
Halt(0);
|
||||||
end;
|
end;
|
||||||
@ -335,8 +337,13 @@ begin
|
|||||||
|
|
||||||
// Check for broken dependencies
|
// Check for broken dependencies
|
||||||
if not GlobalOptions.AllowBroken and
|
if not GlobalOptions.AllowBroken and
|
||||||
not((ParaPackages.Count=0) and (ParaAction='fixbroken')) then
|
(((ParaAction='fixbroken') and (ParaPackages.Count>0)) or
|
||||||
|
(ParaAction='compile') or
|
||||||
|
(ParaAction='build') or
|
||||||
|
(ParaAction='install') or
|
||||||
|
(ParaAction='archive')) then
|
||||||
begin
|
begin
|
||||||
|
pkgglobals.Log(vlDebug,SLogCheckBrokenDependenvies);
|
||||||
SL:=TStringList.Create;
|
SL:=TStringList.Create;
|
||||||
if FindBrokenPackages(SL) then
|
if FindBrokenPackages(SL) then
|
||||||
Error(SErrBrokenPackagesFound);
|
Error(SErrBrokenPackagesFound);
|
||||||
|
@ -77,6 +77,7 @@ Resourcestring
|
|||||||
SLogUpgradingConfig = 'Configuration file "%s" is updated with new configuration settings';
|
SLogUpgradingConfig = 'Configuration file "%s" is updated with new configuration settings';
|
||||||
SLogPackageDependency = 'Dependency on package %s %s, installed %s, available %s (%s)';
|
SLogPackageDependency = 'Dependency on package %s %s, installed %s, available %s (%s)';
|
||||||
SLogPackageChecksumChanged = 'Package %s needs to be rebuild, dependency %s is modified';
|
SLogPackageChecksumChanged = 'Package %s needs to be rebuild, dependency %s is modified';
|
||||||
|
SLogCheckBrokenDependenvies= 'Checking for broken dependencies';
|
||||||
|
|
||||||
SLogGlobalCfgHeader = 'Using global configuration:';
|
SLogGlobalCfgHeader = 'Using global configuration:';
|
||||||
SLogGlobalCfgRemoteMirrorsURL = ' RemoteMirrorsURL: "%s"';
|
SLogGlobalCfgRemoteMirrorsURL = ' RemoteMirrorsURL: "%s"';
|
||||||
|
@ -19,6 +19,7 @@ function PackageIsBroken(APackage:TFPPackage):boolean;
|
|||||||
function FindBrokenPackages(SL:TStrings):Boolean;
|
function FindBrokenPackages(SL:TStrings):Boolean;
|
||||||
procedure CheckFPMakeDependencies;
|
procedure CheckFPMakeDependencies;
|
||||||
function PackageInstalledVersionStr(const AName:String):string;
|
function PackageInstalledVersionStr(const AName:String):string;
|
||||||
|
function PackageInstalledStateStr(const AName:String):string;
|
||||||
function PackageAvailableVersionStr(const AName:String):string;
|
function PackageAvailableVersionStr(const AName:String):string;
|
||||||
procedure ListAvailablePackages;
|
procedure ListAvailablePackages;
|
||||||
procedure ListPackages;
|
procedure ListPackages;
|
||||||
@ -477,6 +478,16 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function PackageInstalledStateStr(const AName:String):string;
|
||||||
|
var
|
||||||
|
P : TFPPackage;
|
||||||
|
begin
|
||||||
|
result := '';
|
||||||
|
P:=InstalledRepository.FindPackage(AName);
|
||||||
|
if (P<>nil) and PackageIsBroken(P) then
|
||||||
|
result:='B';
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure ListAvailablePackages;
|
procedure ListAvailablePackages;
|
||||||
var
|
var
|
||||||
@ -515,12 +526,12 @@ begin
|
|||||||
SL.Add(AvailableRepository.Packages[i].Name);
|
SL.Add(AvailableRepository.Packages[i].Name);
|
||||||
for i:=0 to InstalledRepository.PackageCount-1 do
|
for i:=0 to InstalledRepository.PackageCount-1 do
|
||||||
SL.Add(InstalledRepository.Packages[i].Name);
|
SL.Add(InstalledRepository.Packages[i].Name);
|
||||||
Writeln(Format('%-20s %-12s %-12s',['Name','Installed','Available']));
|
Writeln(Format('%-20s %-12s %-3s %-12s',['Name','Installed','','Available']));
|
||||||
for i:=0 to SL.Count-1 do
|
for i:=0 to SL.Count-1 do
|
||||||
begin
|
begin
|
||||||
PackageName:=SL[i];
|
PackageName:=SL[i];
|
||||||
if (PackageName<>CmdLinePackageName) and (PackageName<>CurrentDirPackageName) then
|
if (PackageName<>CmdLinePackageName) and (PackageName<>CurrentDirPackageName) then
|
||||||
Writeln(Format('%-20s %-12s %-12s',[PackageName,PackageInstalledVersionStr(PackageName),PackageAvailableVersionStr(PackageName)]));
|
Writeln(Format('%-20s %-12s %-3s %-12s',[PackageName,PackageInstalledVersionStr(PackageName),PackageInstalledStateStr(PackageName),PackageAvailableVersionStr(PackageName)]));
|
||||||
end;
|
end;
|
||||||
FreeAndNil(SL);
|
FreeAndNil(SL);
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user