From 191934ab45231991ded9eb3a07d0b4de9145b2ac Mon Sep 17 00:00:00 2001 From: mattias Date: Thu, 13 Jun 2013 19:40:05 +0000 Subject: [PATCH] aarre: less verbose git-svn-id: trunk@41704 - --- components/aarre/src/aarrepkglist.pas | 27 ++++++++++++---------- components/aarre/tools/aarreupdatelist.lpr | 23 ++++++++++++++++-- 2 files changed, 36 insertions(+), 14 deletions(-) diff --git a/components/aarre/src/aarrepkglist.pas b/components/aarre/src/aarrepkglist.pas index c73c1ac396..3de6a84bb0 100644 --- a/components/aarre/src/aarrepkglist.pas +++ b/components/aarre/src/aarrepkglist.pas @@ -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; diff --git a/components/aarre/tools/aarreupdatelist.lpr b/components/aarre/tools/aarreupdatelist.lpr index cb177343bc..0dda47faa8 100644 --- a/components/aarre/tools/aarreupdatelist.lpr +++ b/components/aarre/tools/aarreupdatelist.lpr @@ -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