The following reply was made to PR pkg/37793; it has been noted by GNATS.
From: Roland Illig <rillig%netbsd.org@localhost>
To: gnats-bugs%gnats.NetBSD.org@localhost
Cc:
Subject: PR/37793 CVS commit: pkgsrc/mk
Date: Fri, 18 Jan 2008 11:16:08 +0000 (UTC)
Module Name: pkgsrc
Committed By: rillig
Date: Fri Jan 18 11:16:08 UTC 2008
Modified Files:
pkgsrc/mk: subst.mk
Log Message:
Don't rely on file(1) to distinguish text files from binary files. This
has proven too unreliable in the past. For example, some Makefile.in
files were classified as "Quake I or II world or extension", just
because they happen to start with the letters "PACK". This method was
also subject to subtle differences in the locale.
The new method counts the number of NUL bytes in the file. It does not
depend on the locale settings. The -c option of wc(1) counts bytes, not
characters, and tr(1), which may interpret multibyte sequences, is
protected by LC_ALL. It should also work with the historical
implementations of tr(1) that could not handle NUL bytes and discarded
them, since this is exactly the intention.
See also:
* http://mail-index.netbsd.org/tech-pkg/2006/07/05/0000.html
* PR 37793
To generate a diff of this commit:
cvs rdiff -r1.49 -r1.50 pkgsrc/mk/subst.mk
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.