Tiny Core Extensions > TCE Talk

tree of tcz which depends of one chosen tcz

(1/2) > >>

nick65go:
I saw in https://en.wikipedia.org/wiki/Graphviz some tree dependency, build by

--- Code: ---Title:          graphviz.tcz
Version:        2.38.0
Size: 5.9MB
Extension_by:   juanito
Comments:       graph drawing programs and libraries
Change-log:     first version
Current:        2016/01/28
--- End code ---
I do not know how o use it; and even if I will know, I think we do not need a 6 MB apps to draw an ASCII tree, when we have a tcz.dep.db.gz on the server.

The idea is to have a A.tcz as root, and then list (optionally to a specific level, let say LEV=4 branches), the hierarchical tcz which ask for this A.tcz, aside of their size. Something like:
--- Code: ---A.tcz
- B1.tcz [x1 kb]
  -- C1.tcz [x2 kb]
  -- D1.tcz [x3 kb]
- B2.tcz [x1 kb]
  -- C2.tcz [x2 kb]
     -- E1.tcz [x1 kb ]
        -- F1.tcz [x2 kb] 
     -- D3.tcz [x3 kb]
        -- E1.tcz [x1 kb]
- B3.tcz [x1 kb]

--- End code ---
I think having these 2 files on the server: size.gz (kb for each tcz) and the new tcz.dep.db.gz, some skilled programmer could build a script using just busybox tools, like awk.
The logic i think is similar with the engine of tce-load, using an array of variable number of fields in awk.
I do not have the skills, but maybe someone could take the challenge, for fun, or as an exercise.

 

nick65go:
as a sample, for what other package-manager could do, I chroot into Alpine-Linux:
--- Code: ---root@box:/# apk --help  info
apk-tools 2.12.11, compiled for x86_64.
Info options:
  -r, --rdepends        List reverse dependencies of the package (all other
                        packages which depend on the package)
  -R, --depends         List the dependencies of the package
root@box:/#

--- End code ---


--- Code: ---root@box:/# time apk info -R goffice
goffice-0.10.55-r0 depends on:
so:libatk-1.0.so.0
so:libc.musl-x86_64.so.1
so:libcairo.so.2
so:libgdk-3.so.0
so:libgdk_pixbuf-2.0.so.0
so:libgio-2.0.so.0
so:libglib-2.0.so.0
so:libgmodule-2.0.so.0
so:libgobject-2.0.so.0
so:libgsf-1.so.114
so:libgtk-3.so.0
so:libintl.so.8
so:libpango-1.0.so.0
so:libpangocairo-1.0.so.0
so:librsvg-2.so.2
so:libxml2.so.2
so:libxslt.so.1

real    0m 2.43s
user    0m 1.80s
sys     0m 0.63s

--- End code ---


--- Code: ---root@box:/# time apk info -r goffice
goffice-0.10.55-r0 is required by:
gnumeric-1.12.55-r0
abiword-3.0.5-r6

real    0m 1.21s
user    0m 0.90s
sys     0m 0.30s

--- End code ---

curaga:
We already have tree files, and the depends-on script was just added?

nick65go:
I was thinking about a tree plus BRANCHES, plus SIZE, plus optionally trim at a chosen deep LEVEL.
You replay that (see my first post here) we will have something like a short list.

--- Code: ---A.tcz is required by:
B1.tcz
B2.tcz
B3.tcz

--- End code ---

But not lets say, branches at level =2, like:
--- Code: ---A.tcz is required by:
- B1.tcz [x1 kb] ->
-- C1.tcz [x2 kb]   LEV=2
- B2.tcz [x1 kb]
  -- C2.tcz [x2 kb]   LEV=2
- B3.tcz [x1 kb]
--- End code ---

If this is already the plan for depends-on.sh then I miss-interpreted.

curaga:
Ah, you want a reverse tree. No, that is not planned, it's not very commonly needed. I can't really think of any use case for it.

You can write it for yourself, call depends-on.sh recursively and indent to create a tree.

Navigation

[0] Message Index

[#] Next page

Go to full version