Tiny Core Linux
Tiny Core Base => TCB Bugs => Topic started by: GNUser on March 24, 2025, 03:59:07 PM
-
I found a bug in depends-on.sh:
$ depends-on.sh unbound
getdns.tcz
unbound-dev.tcz
The output is incorrect because prosody.tcz depends on unbound.tcz, so should appear in the command's output.
I found many other instances of unexpected behavior. Just one more example:
$ depends-on.sh protobuf-c
[no hits]
That's also incorrect. protobuf-c-dev.tcz should have been a hit because it depends on protobuf-c.tcz.
After close inspection of dep.db and much head-scratching, I discovered the problem: The default (exact match) searches fail when the lines with expected matches have trailing whitespace. Brutal.
There are at least two ways to fix this:
1. Make the logic in awk more complex so that exact searches can deal with trailing whitespace in dep.db
2. Remove trailing whitespace from dep.db before searching
Option #2 seems more obvious and straight-forward, so I went with that:
https://github.com/tinycorelinux/Core-scripts/pull/75/commits/8e84f192359af77ab7806389768d46897a0b57bc
-
Hi GNUser
I just checked TC16 x86_64 dep.db:
rich@tcbox:~$ grep -E ".* +$" dep.db
rich@tcbox:~$
I couldn't find any trailing whitespace.
-
Hi Rich. Wow, my head is spinning. You're right!
I use a local mirror. It's exactly like the official repo except that I add a few custom extensions into it and have a shell script that adds my custom extensions to the local mirror's metadata files (e.g., dep.db). It seems my shell script is the culprit--it must be inadvertently adding trailing whitespace :(
Sorry for the noise.
-
Hi GNUser
Hi Rich. Wow, my head is spinning. You're right! ...
Well, I never doubted you for a second. That's why I triple checked by also
examining dep.db in the TC15 and TC14 repos before saying anything. :)
-
@GNUser, would be interested in your final disposition on this when you get it sorted. Thanks!
-
Hi gadget42. Here's my final assessment:
1. trailing whitespace in dep.db does cause a problem for depends-on.sh
2. the official repo's dep.db does not contain trailing whitespace
3. my local repo's dep.db did contain trailing whitespace because of a bug in one of my shell scripts, which I have fixed