[Toybox] [PATCH] find: add -printf support.

enh enh at google.com
Sun May 26 09:12:37 PDT 2019


On Sat, May 25, 2019 at 7:53 PM Rob Landley <rob at landley.net> wrote:
>
> On 5/24/19 6:06 PM, enh via Toybox wrote:
> > This only implements the format specifiers that I've seen used in the
> > wild (which is actually a significant fraction of the total supported by
> > findutils' find). The most obvious gap is in the time support. I'm happy
> > to add more, but didn't want to add stuff "just because".
>
> Grumble grumble trying to cut a release... (My own fault for being too slow, the
> world doesn't wait for me to catch up on my todo list...)
>
> > I'd say %A@, %C@, and -- for SELinux users -- %Z are probably the most
> > plausibly useful formats still missing. I don't think the human-readable
> > date formatting is particularly useful unless someone's seen it actually
> > used in the wild. The %T+ "full ISO" format being the most likely
> > exception to that.
>
> I need to add xattr support to tar. And there's a new cpio xattr proposal
> (METADATA!!! entries) I have a window open for that I was hoping to get to this
> weekend...
>
> But _after_ release...
>
> > Anyway, this is enough for me get started building AOSP with toybox find.
>
> Let's see, does it...
>
>   find . -type f -printf '%.3s\n'
>
> Of course it does. And this is why I created next_printf().

huh. i did think about that, and though i didn't test (obviously), the
docs explicitly said that the only modifiers supported were # with %m
(which i couldn't find anyone using, and to which there's the easy
workaround of saying `0%m` instead) and i took their word for it.

yeah, searching as much code as i can, i see two uses. neither is in
Android, though, so i'd have gotten away with it :-)

there's an open source one for you here:
https://github.com/openembedded/openembedded-core/blob/master/meta/classes/buildhistory.bbclass#L524

> (Some day, some glorious day,
> https://slashdot.org/story/06/09/04/1335226/debian-kicks-jrg-schilling will no
> longer be on the posix commitee and then maybe it'll start to matter to
> non-solaris users again. Today is not that day.)
>
> Rob



More information about the Toybox mailing list