Projeto-Pindorama / heirloom-ng

A collection of standard Unix utilities that is intended to provide maximum compatibility with traditional Unix while incorporating additional features necessary today.
http://heirloom-ng.pindorama.net.br
Other
28 stars 7 forks source link

Fix a lot of issues at tar(1) #44

Open takusuman opened 6 months ago

takusuman commented 6 months ago

Happy (early-hours of) Easter! What have we won? At least four things to fix at tar(1). I commented at #27 that this tar implementation had some, well, questions to be solved, and @arthurbacci asked me to open an issue to talk specifically about these questions.

First: it will shamelessly break when the path is informed with a trailing slash. image

Second: as I said in #27, it will probably break if used in a dircp(1)-ish way (or, effectively, in some specific pipelines) with this error. In this example, with a xz-compressed tarball: image Using it in a dircp-ish way: image

Third: Well, it won't support any file larger than 8GB. Working around that would be a really big challenge if a guy called Jörg Schilling haven't described why it only supports 8GB and what could we implement if we want to store files larger than 8GB at star(1) manual page. Apparently this tar implements just the "ustar" standard.

Fourth: It will go full batsh?t printing "zstd: \/*stdin*\: unsupported format" and then "zstd: \/*stdin*\: unexpected end of file" if it can not identify which is the file type. This was broken when we implemented zstd support and "accidentally" broke the error switch amid the process of doing it. image That may be the simplest to fix.

Jokes apart, I hope you enjoy a blessed and happy Easter and, really, do not worry with these for now --- at least not this Sunday, just Monday --- and be with your families instead. Just wrote this for now because of a simple formality. Be well.

Last consideration before "closing the opening" of this new issue: "But I want to use Heirloom and I do not have a tar implementation, what should I do?" I would recommend to use star, which is used by Copacabana Linux as the default /bin/tar and is being actively maintained at Codeberg or to use bsdtar.

Although this team is hardworking, I highly doubt that an UNIX v7-derived implementation of tar, even with all the bells and whistles implemented both by Ritter along with us, will soon match the trustworthiness of Schily's tar, bsdtar or even GNU tar for "heavier" operations often done nowadays. To ratify my hopeful spirit, I must say that maybe in some years of work, or even in a separate branch of development, but not for this very next release.

If you're using tar in a script and Heirloom tar is currently breaking it, you can try to workaround it by writing a function that searches for a suitable implementation of tar to be used. Copacabana's build system has an example of how it could be done.

takusuman commented 5 months ago

Take-a-Fifth one Ha, get it?: It breaks with longer file names and it doesn't print user names correctly. image