Tiny Core Base > TCB Bugs
tce-size broken output caused by changes in dc CL syntax since BusyBox 1.30
jazzbiker:
Hi, Core people!
Bad news from BusyBox team - they decided to change dc applet command line syntax. They named this "much fuller version". This took place in BusyBox since 1.30 and in the latest TC11, which uses 1.31 I can't write
--- Code: ---$dc 2 2 add p
--- End code ---
and get
--- Code: ---4
--- End code ---
Happy user of the "fuller version" must write
--- Code: ---$dc -e '2 2 + p'
--- End code ---
By the way "add", "sub", "mul" and "div" keywords were thrown out, now we must use only +, -. * and / in string constants. How about * symbol in your commands ?
One of the direct consequencies is that "tce-size" utility ( called by tce ) now is showing rubbish, because it uses dc line calls for extension size arythmetics. Please, forgive my anger, but in order to have proper tce-size output data this script needs to be edited after so many years of excellent functioning.
Maybe there are other cases of dc applet use in TC system stuff. Probably all of them will fail too. (
aw:
That's a pretty big regression, as I'm sure other programs rely on 'dc'.
There seems to be a busybox option: FEATURE_BC_LONG_OPTIONS which can be enabled and might fix the problem.. see the config http://repo.tinycorelinux.net/11.x/x86_64/release/src/busybox/busybox-1.31.1_config.nosuid
I haven't tested.. it might be useful to look at the 'bc' source code as well: https://git.busybox.net/busybox/tree/miscutils/bc.c
Juanito:
:(
If any dc users would like to test the effect of FEATURE_BC_LONG_OPTIONS it would be much appreciated..
jazzbiker:
HI!
There are no references to bc functions in dc.c, and bc config options will not have any impact on dc behaviour. The main "improvement" is done in dc_main(), and it means, that getopt() is used, so dc command line is tested for the two switches "e" and "f" and no more.
Other "improvement" ( throwing out of keywords sub, add, etc ) is done by commenting with the help of //.
My first glance on the sources of 1.31 and 1.29 BB make me feel, that old dc behaviour can be restored by simply replacing of dc_main() with dc_main() from 1.29. This will eliminate e and f switches processing.
So we have two ways:
1. Patch TC system stuff in order to achieve new dc compatibility.
2. Patch dc in order to restore its native behaviour.
What's the choice?
P.S. As for me personally i will unconditionally patch the dc in order to use TC11
Rich:
Hi jazzbiker
--- Quote from: jazzbiker on February 13, 2020, 04:49:32 AM --- ... So we have two ways:
1. Patch TC system stuff in order to achieve new dc compatibility.
2. Patch dc in order to restore its native behaviour. ...
--- End quote ---
3. Remove the dc requirement from the system stuff.
Attached are patches for 2 possible ways of removing dc:
1. The tce-size.sh.diff uses the shells built in math capabilities. It's not floating point math so all the numbers end in .00 and anything
smaller than 1 Meg shows up as 0.00. I personally never pay attention to the decimal places. The integer byte count is just to the
left of the "floating point" number if someone really cares about actual size. This patch runs just as fast as the dc version.
2. The tce-size.calc.diff uses the calc script which is just a wrapper for awk and it does do floating point math. It is a little slower
than the dc version. The time to populate the window when selecting the size tab for gtk3-dev.tcz in Apps is:
dc=3 Secs.
calc=4.5 Secs.
The only effected files I found were tce-size and filetool.sh.
Navigation
[0] Message Index
[#] Next page
Go to full version