[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[tyndur-devel] [PATCH] lpt list kompakter machen



* lpt: Die Paketliste ist im Moment als Baum nur sehr bedingt sinnvoll,
  weil es sowieso keine Knoten mit mehr als einem Kind gibt. Machen wir
  lieber eine schoene Liste draus und packen die Paketbeschreibung noch
  rein.

Signed-off-by: Kevin Wolf <kevin@xxxxxxxxxx>
---
 src/modules/pas/lpt/lpt.pas |   16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/src/modules/pas/lpt/lpt.pas b/src/modules/pas/lpt/lpt.pas
index d4d1630..348900b 100644
--- a/src/modules/pas/lpt/lpt.pas
+++ b/src/modules/pas/lpt/lpt.pas
@@ -263,22 +263,28 @@ begin
 
     for i := 0 to pkgset.packages.count - 1 do begin
         pkg := TPackage(pkgset.packages.items[i]);
-        WriteLn('+ ' + pkg.name);
         for j := 0 to pkg.sections.count - 1 do begin
             sect := TPackageSection(pkg.sections.items[j]);
-            WriteLn('| + ' + sect.section);
             for k := 0 to sect.versions.count - 1 do begin
                 ver := TPackageVersion(sect.versions.items[k]);
-                WriteLn('| | + ' + ver.version);
+
+                Write(pkg.name, StringOfChar(' ', 12 - Length(pkg.name)));
+                Write(' | ', sect.section, StringOfChar(' ', 5 - Length(sect.section)));
+                Write(' | ', ver.version : 10);
+                if Length(pkg.desc) > 43 then begin
+                    WriteLn(' | ' + Copy(pkg.desc, 1, 40), '...');
+                end else begin
+                    WriteLn(' | ' + pkg.desc);
+                end;
 
                 for l := 0 to ver.preinstDependencies.count - 1 do begin
                     dep := TDependency(ver.preinstDependencies.items[l]);
-                    WriteLn('| | |  [i] ' + dep.pkgname + ' (' + dep.section + ')');
+                    WriteLn('' : 36, 'Installation hängt ab von: ' + dep.pkgname + ' (' + dep.section + ')');
                 end;
                 
                 for l := 0 to ver.runDependencies.count - 1 do begin
                     dep := TDependency(ver.runDependencies.items[l]);
-                    WriteLn('| | |  [r] ' + dep.pkgname + ' (' + dep.section + ')');
+                    WriteLn('' : 36, 'Hängt ab von: ' + dep.pkgname + ' (' + dep.section + ')');
                 end;
 
             end;
-- 
1.6.0.2