[Toybox] [PATCH] Implement dmesg -T.

enh enh at google.com
Tue Apr 4 10:32:27 PDT 2017


On Mon, Apr 3, 2017 at 2:43 PM, Rob Landley <rob at landley.net> wrote:

> On 04/03/2017 03:03 PM, enh wrote:
> > since i have to maintain a parallel build system, promotion/demotion
> > just mean extra work for me, so i'm always happier with the status quo
> :-)
>
> Trying to converge the build systems is on my todo list. :)
>
> (But today I'm playing with GPS signal tracking heuristics for $DAYJOB.
> I'm finally seeing #%*(&%&# bit edges in the raw antenna data! Pretty
> sure I have to correct code phase _before_ trying to track doppler
> because it's just too noisy otherwise, but I might be able to use the
> signal strength (vector length) as a weight for the phase angle deltas.
> Dunno if that's helpful yet. This is _so_ much easier since I converted
> everything to polar coordinates...)
>
> > as for the more recent patches i've been sending... it's not that i hate
> > awk -- i'd actually love to have the time to sit down and write toybox
> > awk -- but i'm trying to get to where we pass all the toybox tests [for
> > the toys we're using] on Android.
>
> I note that some of the tests are broken and most are incomplete. (I
> don't have a pending directory for test code, and large chunks of it
> were contributed.)
>

that's all the more reason why i want to go through them. at the moment i
think we're not paying much attention to them because we know they're not
great. i'd like to get to the point where "all tests passing" is the
default.


> I keep meaning to do a "finishing pass" where I find commands I think
> are done, read through the relevant specs (posix, lsb, and/or man page)
> line by line, write a test for every statement and corner case I can
> think of in its command.test file, then read through the command
> implementation and writte any additional tests _that_ brings up (and
> making sure the "deltas from posix" section is filled out and has
> tests), make sure the command passes all of the tests, and then mark
> both command and test READY (for 1.0).
>

yeah, that's what i've tried to do with gzip/gunzip/zcat too (though the
weaker version in the absence of a spec of "verify every claim in the
--help output").


> It's on the todo list. (It's part of the roadmap.html annotation.) Alas
> I've been getting to spend about 4 hours on toybox in a _good_ week
> recently. (Where "recently" is longer than I care to admit. And it tends
> to be in 15 minute chunks, which are less useful than one 4 hour block
> would be.)


that's one of the good things about at least polishing the existing tests:
we'll need better tests eventually, but "something is better than nothing",
and all the ones i've looked at so far were fittable into 15 minute gaps
between meetings.

the number of changes is starting to get hard to keep track of though, so
if you could start merging some of them...

(and if there's something you want done differently, tell me now so i can
start doing the others that way.)


>
> > ...and one reason i'm [finally] paying that the attention it deserves is
> > that i have a libz-based gzip that i'll add to _tool_box in the short
> > term and then work out how to get that into toybox (since you'll
> > presumably want your no-dependencies version too, but you presumably
> > won't want to reimplement the libz interface).
>
> I have a todo item to do libz wrapper versions of gzip/gunzip already,
> but at this rate you may get to it before I do. :)
>

yeah, it's all done and passing the tests. (including the toybox tar tests,
since tar shells out to gzip.) i'll get it committed to toolbox this week
and then start worrying about porting to toybox.


> I've had the decompress side of gzip implemented in the "compress"
> utility in pending for a while (works fine as far as I know), which
> needs to become gunzip.c. I have about the first 1/4 of the compression
> side but it writes everything out as "stored" gzip blocks (not actually
> compressed; my research went down a "when do you perform dictionary
> resets" rathole and I got distracted).
>
> I note that to implement git you need the libz style header (not the
> gzip or zip or raw header), because that's how git stores data. (There's
> a youtube video with somebody decompressing git objects from the command
> line using the perl zlib module; inside it's a text file with
> keyword:value headers followed by data, a bit like smtp or http. Doing a
> simple git reader (repo downloader) isn't actually _that_ big a deal,
> it's merges and such that get complciated. (I say that not having
> studied the network protocol yet. And implementing "bisect" might hurt,
> dunno yet.)
>
> I was thinking of having the name "compress" be a front-end to deal with
> multiple compression types (hence the help text, and things like
> handling gzip zlib format with command line options), but that was a bit
> of a cul-de-sac and I need to back it out again. (If I did it that way
> I'd either bundle gzip/bzip/xz into compress.c, or have horrible
> cross-command dependencies, or have the engines of those under lib.
> Doesn't seem worth it...)
>

yeah, that's how things are at the moment, which is one reason i decided to
do this in toolbox first. i guess it will be easiest if my patch adds a new
pending/gzip.c and just #if 0s out those parts of compress.c and then let
you decide how you want to implement the non-libz variant?


> Oh, and I have a folder with the references to implement zip.c. Maybe i
> can find a weekend to devote to that sometime.
>
> > but i may as well commit
> > the tests to toybox right away. not least because some of the existing
> > tests (like the tar tests) implicitly test gzip/gunzip/zcat.
>
> I'm happy to merge tests for commands that aren't implemented yet. I may
> tweak them when the command goes in, but good tests are always useful.
>
> Rob
>



-- 
Elliott Hughes - http://who/enh - http://jessies.org/~enh/
Android native code/tools questions? Mail me/drop by/add me as a reviewer.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20170404/5d56f4db/attachment-0001.htm>


More information about the Toybox mailing list