Hi GNUser
Here's final tally of busybox ash vs. busybox awk vs. C++ implementations of treegen. All three implementations parse .dep files present on the local mirror (without using network/wget):
busybox ash busybox awk C++
time to generate labwc-dev.tcz.tree: 11 sec 0.43 sec 0.06 sec
time to generate vlc-dev.tcz.tree: 49 sec 1.86 sec 0.31 sec
...
I decided to try my hand at a busybox ash version.
Using your busybox awk as a benchmark, I got:
tc@E310:~/TreeGen$ time ./treegen.awk vlc-dev.tcz > vlc-dev.tcz.tree2
real 0m 8.49s
user 0m 3.56s
sys 0m 4.92sUsing my busybox ash version, I got:
tc@E310:~/TreeGen$ time ./TreeGen.sh vlc-dev
6.25
real 0m 6.27s
user 0m 3.71s
sys 0m 2.52sThat surprised me, but not as much as this did:
tc@E310:~/TreeGen$ ls -l vlc*
-rw-r--r-- 1 tc staff 1879760 Apr 23 00:56 vlc-dev.tcz.tree <------ ash version
-rw-r--r-- 1 tc staff 1839796 Mar 30 13:48 vlc-dev.tcz.tree.bak <-- repo version
-rw-r--r-- 1 tc staff 1839795 Apr 22 22:53 vlc-dev.tcz.tree2 <----- awk versionThe repo versio is 1 byte longer than yours. It has an extra newline at the end of the file.
But mine is almost 40,000 bytes larger.
And about 900 lines longer:
tc@E310:~/TreeGen$ wc -l vlc-dev.tcz.tree*
41437 vlc-dev.tcz.tree <------ ash version
40528 vlc-dev.tcz.tree.bak <-- repo version
40527 vlc-dev.tcz.tree2 <----- awk versionAt first I figured there was a bug in my version because yours agreed with the repo version.
Then I found this:
Repo version:
3498 libsndfile-dev.tcz
3499 libsndfile.tcz
3500 flac.tcz
3501 libogg.tcz
3502 libvorbis.tcz
3503 libogg.tcz
3504 opus.tcz
3505 libmpg123.tcz
3506 lame.tcz
3507 flac-dev.tcz
3508 libvorbis-dev.tcz
3509 libbluetooth-dev.tczMy version:
3498 libsndfile-dev.tcz
3499 libsndfile.tcz
3500 flac.tcz
3501 libogg.tcz
3502 libvorbis.tcz
3503 libogg.tcz
3504 opus.tcz
3505 libmpg123.tcz
3506 lame.tcz
3507 flac-dev.tcz
3508 flac.tcz
3509 libogg.tcz
3510 libogg-dev.tcz
3511 libogg.tcz
3512 libvorbis-dev.tcz
3513 libvorbis.tcz
3514 libogg.tcz
3515 libogg-dev.tcz
3516 libogg.tcz
3517 libbluetooth-dev.tczThe C++ and awk versions are not parsing flac-dev.tcz.dep and libvorbis-dev.tcz.dep
Here's the cause:
tc@E310:~/TreeGen$ grep " " DepFiles/libsndfile-dev.tcz.dep | tr " " "_"
flac-dev.tcz_
libvorbis-dev.tcz___The trailing spaces on those 2 entries are tripping up the C++ and awk programs.
Checking the rest of the .dep files related to vlc-dev turn up this:
tc@E310:~/TreeGen$ grep " " DepFiles/* | tr " " "_"
DepFiles/acl.tcz.dep:_
DepFiles/libsane.tcz.dep:libavahi.tcz_____
DepFiles/libsndfile-dev.tcz.dep:flac-dev.tcz_
DepFiles/libsndfile-dev.tcz.dep:libvorbis-dev.tcz___
DepFiles/libsndfile.tcz.dep:libmpg123.tcz_
DepFiles/sane-dev.tcz.dep:avahi-dev.tcz__
DepFiles/taglib-dev.tcz.dep:taglib.tcz___________________________________There are a handful of entries with trailing spaces.
So running treegen.awk against libsndfile-dev.tcz:
tc@E310:~/TreeGen$ ./treegen.awk libsndfile-dev.tcz
libsndfile-dev.tcz
libsndfile.tcz
flac.tcz
libogg.tcz
libvorbis.tcz
libogg.tcz
opus.tcz
libmpg123.tcz
lame.tcz
flac-dev.tcz
libvorbis-dev.tczIt reports flac-dev.tcz and libvorbis-dev.tcz have no dependencies.
Running these commands suggestes they do:
tc@E310:~/TreeGen$ ./treegen.awk flac-dev.tcz
flac-dev.tcz
flac.tcz
libogg.tcz
libogg-dev.tcz
libogg.tcz
tc@E310:~/TreeGen$ ./treegen.awk libvorbis-dev.tcz
libvorbis-dev.tcz
libvorbis.tcz
libogg.tcz
libogg-dev.tcz
libogg.tczI've attached my version of TreeGen.sh.
The only variables you need to adjust are kernel version and
path to your local repo.
Kernel="6.18.2-tinycore64"
Repo="DepFiles/"Run the program like this:
./TreeGen.sh FilenameThe script adds .tcz automatically if you omit it.
The script automatically saves results to Filename.tcz.tree in
the current directory.