Toybox patch for busybox.

Denys Vlasenko vda.linux at googlemail.com
Fri Aug 13 13:54:11 UTC 2010


On Thu, Aug 12, 2010 at 8:26 AM, Rob Landley <rob at landley.net> wrote:
> So I was poking at porting this to BusyBox, and I see you've already done 2/3
> of the work.
>
> This is the only toybox app I still maintain because I use it in aboriginal
> LInux (the alternative is gnu patch), and it keeps #*%(&#% breaking every few
> months as I apply new random patches and discover yet another insane corner
> case in gnu diff.
>
> Speaking of which,
>
> 1) How do I make it actually work in busybox?  (The FAQ hasn't been updated
> for the new inline stuff yet.)
>
> 2) Does BusyBox currently have any equivalent for the streaming infrastructure
> and such?  (The library stuff has been copied, not converted.  I dunno what's
> available these days, I'm ~4 years out of date.)
>
> 3) you may want these patches:
>
>
> http://landley.net/hg/toybox/rev/362
> http://landley.net/hg/toybox/rev/375
>
> And optionally some debug crap:
> http://landley.net/hg/toybox/rev/376

I just took the latest source from hg and put it into patch_toybox.c,
then in scratch build renamed it to patch.c.

I need a few changes/fixes there before I can put it into bbox:

(1) It fails one test which current bbox's one does not fail.
With this patch:

--- input.doesnt_exist        Jan 01 01:01:01 2000
+++ input       Jan 01 01:01:01 2000
@@ -1,2 +1,3 @@
 qwe
+asd
 zxc

"patch -R" tries to patch file named "input.doesnt_exist"
whereas it should patch file "input".

(2) printf("patching %s\n", name) should be changed into
printf("patching file %s\n", name) to mimic standard patch.

(3) it does not support -N. bbox one does.


I fixed (1) and (2) and committed the result to git. So you can pull it
and hack on it.

I didn't fully "busyboxify" it, need to restore -N first (and add a test for it,
we don't have one).

> And then two _more_ patches are attached which apply after those, I never
> checked them into the toybox repo (I'm applying from the aboriginal patch list
> instead) because cutting a new toybox release seems kinda pointless.

Will take a look at these now.

> I'm also working on a patch to implement -l support (squash whitespace) if
> you're interested.  And at some point I should do fuzz factor support, and
> better error reporting.  And add a CONFIG symbol to chop out most of the
> command line options...

I will try to not get in the way (in patch.c) for now then.
-- 
vda


More information about the busybox mailing list