aarre: less verbose

git-svn-id: trunk@41704 -
This commit is contained in:
mattias 2013-06-13 19:40:05 +00:00
parent dfeb33328b
commit 191934ab45
2 changed files with 36 additions and 14 deletions

View File

@ -35,7 +35,7 @@ interface
uses
Classes, SysUtils, Laz2_XMLCfg, laz2_DOM, LazLogger, LazUTF8, LConvEncoding,
FileProcs;
FileProcs, zstream;
type
TAPackageType = (
@ -173,6 +173,7 @@ type
procedure Save(XML: TXMLConfig; Path: string); virtual;
procedure SaveToStream(s: TStream);
procedure LoadFromStream(s: TStream);
procedure SaveToFile(const aFilename: string);
function AsString: string;
procedure Add(Item: TAarrePkgListItem);
procedure Insert(Index: integer; Item: TAarrePkgListItem);
@ -412,17 +413,6 @@ begin
UnitPath:=xml.GetValue(Path+'CompilerOptions/SearchPaths/UnitPath/Value','');
IncPath:=xml.GetValue(Path+'CompilerOptions/SearchPaths/IncludePath/Value','');
DebugLn(['TLPackage.Load Name="',Name,'"',
' Type=',APackageTypeIdents[PackageType],
' Author="',Author,'"',
' Description="',Description,'"',
' License="',License,'"',
' Version="',Version.AsString,'"',
' UnitPath="',UnitPath,'"',
' IncPath="',IncPath,'"'
]);
finally
xml.Free;
end;
@ -549,6 +539,19 @@ begin
end;
end;
procedure TAarrePkgList.SaveToFile(const aFilename: string);
var
xml: TXMLConfig;
begin
xml:=TXMLConfig.Create(aFilename);
try
Save(XML,'');
xml.Flush;
finally
xml.Free;
end;
end;
function TAarrePkgList.AsString: string;
var
ms: TMemoryStream;

View File

@ -98,7 +98,12 @@ begin
end;
ScanDirectory(Directory);
WriteLn(List.AsString);
if Verbose then
debugln(List.AsString);
if not Quiet then
debugln('writing "',OutputFile,'"');
List.SaveToFile(OutputFile);
// stop program loop
Terminate;
@ -132,12 +137,26 @@ var
Pkg: TAarrePkgListItem;
ok: Boolean;
begin
DebugLn(['TAarreUpdateList.AddLPK ',LPKFilename]);
if not Quiet then
DebugLn(['parsing LPK="',LPKFilename,'"']);
Pkg:=TAarrePkgListItem.Create;
ok:=false;
try
Pkg.LoadLPK(LPKFilename);
if Verbose then begin
with Pkg do
DebugLn(['TLPackage.Load Name="',Name,'"',
' Type=',APackageTypeIdents[PackageType],
' Author="',Author,'"',
' Description="',Description,'"',
' License="',License,'"',
' Version="',Version.AsString,'"',
' UnitPath="',UnitPath,'"',
' IncPath="',IncPath,'"'
]);
end;
ok:=true;
except
on E: Exception do begin