The PRINTED variable keeps track of whether a certain package has been outputted, but is reset each record. This means that if we tce-load two packages with a common dependancyj perhaps jwm & flwm, both of them will have the common dependancy listed by the output function, and then the duplicates will be filtered out by the tce-load bash scripting.
It seems to me that the recursive_scan would be better off being simplified to the following (meta code):
(capitals means its an array)
function scan(EXT,extcount){
for(idx=1;idx<=extcount;idx++
//Remove Duplicates
PRINTED[EXT[idx]]=1
print(EXT[idx])
foreach(dep in depfile){
if(PRINTED[dep]!=1){
EXT[++extcount]=dep
}
}
}
}
This would only output each extension once, guaranteed by the PRINTED dictionary (equivelant to the output function's PRINTED dictionary in the current recursive_scan)
For the appbrowser, it could also be a small modification to make it print out repeated dependancies, but not repeated dependancy's dependancy's.
foreach(dep in depfile){
if(PRINTED[dep]!=1){
would become
if(PRINTED[EXT[idx]]!=1){
foreach(dep in depfile){
Reasoning behind only printing out repeated dependancy's but not recursing on them is because of things like libX11, which prints out
libX11.tcz
libxcb.tcz
libXau.tcz
libXdmcp.tcz
underneath every package requiring libX11, instead of printing that out once at the top, and then cutting it down to "libX11.tcz" and no more for the rest.
I'm assuming that when appsbrowser downloads a deptree from the repo (not .dep, the dependancies tab.), that the deptree was generated once by a version of recursive_scan.