Re: CVS commit: src/external/bsd/libarchive/dist/libarchive
Thomas Klausner <[email protected]>
| Newsgroups | gmane.os.netbsd.devel.userlevel |
|---|---|
| Message-ID | <[email protected]> |
On Mon, Aug 24, 2026 at 12:42:33PM +0100, Taylor R Campbell wrote: > How was the archive extracted before? Did it turn into a file called > `???.py' (i.e., with literal question marks)? Yes: meson_python-0.20.0/tests/packages/encoding/???.py > I suspect that the code was only `working' by accident before, i.e., > failing to report failure and blithely barging ahead with output that > the libarchive authors thought of as corrupted, having had replacement > characters substituted where the input can't be represented. > > On a Debian system (where bsdtar is presumably using GNU iconv), if I > try this, it fails in exactly the same way with LANG=C and works with > LANG=C.UTF-8. archivers/bsdtar is built without any iconv at all, so > it rejects the archive altogether no matter what your locale is! And > as far as I know, there's no way to ask bsdtar/libarchive to just > treat each path as a sequence of bytes without interpretation. I guess I'll switch the affected packages to GNU tar then, which extracts the exact binary sequence and reports no error: meson_python-0.20.0/tests/packages/encoding/<E3><83><86><E3><82><B9><E3><83><88>.py # ls -al total 40 drwxr-xr-x 2 root wheel 144 Aug 24 12:51 . drwxr-xr-x 41 root wheel 1872 Aug 24 12:51 .. -rw-rw-r-- 1 root wheel 210 Jun 10 19:15 meson.build -rw-rw-r-- 1 root wheel 162 Jun 10 19:15 pyproject.toml -rw-rw-r-- 1 root wheel 92 Jun 10 19:15 ?????????.py # ls | hexdump -C 00000000 6d 65 73 6f 6e 2e 62 75 69 6c 64 0a 70 79 70 72 |meson.build.pypr| 00000010 6f 6a 65 63 74 2e 74 6f 6d 6c 0a e3 83 86 e3 82 |oject.toml......| 00000020 b9 e3 83 88 2e 70 79 0a |.....py.| 00000028 # Personally I'm not quite sure if I want a tar tool to convert between encodings. Is the base encoding included in the tar file? If not, how does the unpacking tar know how it should interpret the byte sequence? It could be EUC-JP for all we know. Thomas