program gpggraph; {$R *.res} uses mystringlistunit, classes, sysutils, graphunit, lowlevelunit; const gpgCommand = 'gpg --no-auto-check-trustdb --fast-list-mode --fixed-list-mode'; var lKeys,kKeys: tMyStringList; baum: tKnotens; wurzel: tKnoten; spitzen: array of tKnoten; i,j,k: longint; cK: tKnoten; s: string; f: textfile; begin lKeys:=tMyStringList.create; kKeys:=tMyStringList.create; write('Kernel-Schlüssel inkl. Signaturen laden ...'); kKeys.loadFromPipe(gpgCommand+' --list-sigs --homedir /var/cache/kernelKeys/.gnupg'); write(' und bereinigen ...'); kKeys.grep('^(pub|sig)'); write(' und umformen ...'); kKeys.replace('^pub .*/([0-9A-F]{8}) .*$','pub $1'); kKeys.replace('^sig .* ([0-9A-F]{8}) .*$','sig $1'); write(' und noch mal bereinigen ...'); kKeys.uniq('-'); write(' und in Graphen umwandeln ...'); baum:=tKnotens.create; i:=0; j:=0; while i=500 then begin write('.'); j:=0; end; if rightStr(kKeys[i],8)='65D0FD58' then begin inc(i); continue; end; cK:=baum.findeKnoten(rightStr(kKeys[i],8)); inc(i); while (i '+inttostr(kKeys.count)+' ('+inttostr(j)+')'); kKeys.sort; kKeys.uniq('-'); end; writeln(kKeys.count); j:=-1; assignfile(f,''); for i:=0 to kKeys.count-1 do begin s:=kKeys[i]; k:=strtoint(erstesArgument(s,':')); if j<>k then begin if j<>-1 then closefile(f); j:=k; assignfile(f,extractfilepath(paramstr(0))+'out.'+inttostr(j)); rewrite(f); end; writeln(f,s); end; if j<>-1 then closefile(f); lKeys.free; kKeys.free; end.