[Toybox] "bad xform" not very helpful

enh enh at google.com
Mon Aug 15 16:50:42 PDT 2022


and here's their minimized repro case:

echo > /tmp/foo.txt; echo /tmp/foo.txt > /tmp/find.txt

cat /tmp/find.txt | prebuilts/build-tools/path/linux-x86/tar czf
/tmp/out.tar.gz \
  --absolute-names \
  --transform 's,^/,,' -T -

This fails with

tar: bad xform

However, if the file names are fed via the -T /tmp/find.txt, it works:

echo > /tmp/foo.txt; echo /tmp/foo.txt > /tmp/find.txt

prebuilts/build-tools/path/linux-x86/tar czf /tmp/out.tar.gz \
  --absolute-names \
  --transform 's,^/,,' -T /tmp/find.txt

(the "prebuilts/build-tools/path/linux-x86/" stuff is just a directory full
of symlinks to toybox.)

On Mon, Aug 15, 2022 at 1:52 PM enh <enh at google.com> wrote:

> the kernel folks are trying to use `tar --transform` and getting the "bad
> xform" error that's not really helping them much. it seems like it would be
> hard to list the _relevant_ sed expression(s), so perhaps just showing the
> specific filename we tried that failed is a better choice?
>
> context here:
> https://android-review.googlesource.com/c/kernel/build/+/2151397/3//COMMIT_MSG#10
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20220815/66d99d6c/attachment.htm>


More information about the Toybox mailing list