toybox icon indicating copy to clipboard operation
toybox copied to clipboard

Append missing in tar

Open MrVeink opened this issue 2 years ago • 5 comments

Using Toybox tar and the flag -r ain't there. Couldn't find in --help any other flag for append.

MrVeink avatar Apr 08 '22 10:04 MrVeink

Nobody had asked for it yet. I'll try to take a look in the morning. (Does it strip off the trailing null blocks or do they not cause a problem...?)

landley avatar Apr 08 '22 10:04 landley

$ tar c xargs.diff > woot.tar $ tar c zapdots.patch >> woot.tar $ tar tvf woot.tar -rw-r--r-- landley/landley 2213 2019-10-21 16:50 xargs.diff

It's gotta strip. Ok.

landley avatar Apr 08 '22 10:04 landley

I despise github's Gratuitous Wiki Syntax in replies.

landley avatar Apr 08 '22 10:04 landley

Except the archives can be compressed, at which point stripping off the trailing null blocks is nontrivial. Depending on the compression format, you may have to recompress the whole archive. And it's ALREADY nontrivial because you have to parse from the beginning to see how many trailing null blocks are padding and how many are potentially payload from the last file...

landley avatar Apr 08 '22 10:04 landley

Except the archives can be compressed, at which point stripping off the trailing null blocks is nontrivial. Depending on the compression format, you may have to recompress the whole archive. And it's ALREADY nontrivial because you have to parse from the beginning to see how many trailing null blocks are padding and how many are potentially payload from the last file...

Where we're using it, it's a simple .tar without any compression but I don't know how GNU tar does it. We archive a ./usr into a tar, list everything that's in it into a text file and then inject that list afterwards to the archive. Then we use XZ and compress it.

MrVeink avatar Apr 08 '22 20:04 MrVeink