pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Odd checksum issue on MacOS



On 1/9/23 4:47 PM, Roland Illig wrote:
Am 09.01.2023 um 20:34 schrieb Louis Guillaume:
Ignoring patch file devel/libcfg+/patches/patch-ab: invalid checksum

I got a clue. The file patch-ab has a non-ASCII character 0xAD in line
30, before the word 'include'.

To compute the checksum, mk/checksum/checksum.awk runs sed over the
patch file, to filter out the '$NetBSD$' line.

NetBSD's sed works in byte mode, while macOS sed probably works in UTF-8
mode. >
Does it work if you run 'LC_ALL=C bmake patch'?

Yes it does! It's the current encoding being UTF-8 that's the culprit. I now remember this happening with the old pkg_alternatives a long time ago.

What is the output of 'bmake -v TOOLS_SED'? According to
mk/tools/tools.Darwin.mk, it should be '/usr/bin/sed'.

If you install the package textproc/nbsed, does 'bmake
TOOLS_PLATFORM.sed=nbsed patch' work?

This does work too. From what I can tell, "nbsed" does the right thing no matter what the locale or file encoding is, while the built-in "sed" chokes on latin-1 bytes when they haven't been UTF-8 encoded in the file, and the locale says we're UTF-8 encoding.

Seems like TOOLS_PLATFORM.sed=nbsed is generally more appropriate for MacOS. I'll add this to my mk.conf, but maybe it should be the default?

Thanks!

--
Louis



Home | Main Index | Thread Index | Old Index