Subject: Re: subst.mk only for text files
To: None <tech-pkg@NetBSD.org>
From: grant beattie <grant@NetBSD.org>
Date: 12/19/2003 00:49:38
On Fri, Dec 12, 2003 at 01:12:33AM +0100, Klaus Heinz wrote:
> today, using pkgsrc/mk/subst.mk I encountered a small problem on Solaris
> where a file was not altered because the test _SUBST_IS_TEXT_FILE (used
> to verify that only text files are changed) failed. /usr/bin/file on
> Solaris uses some output strings different from NetBSD's "file" command
> and the egrep regular expression didn't catch this output.
> A package creator using subst.mk knows which files will be changed
> and I cannot see the need for a runtime test like this.
as I mentioned in private mail, I don't think we should rely on the
output of file(1) being consistent, nor do we really want to maintain
a huge list of what "might be" correct (and sometimes file(1) gets it
wrong, anyway, eg. high-bit characters in a text file).
the test seems bogus to me - as you pointed out, the package author
knows what files s/he wants to subst over. we should remove it, I
think, and as a side-effect, save a fork() and a read for every
there's probably also legitimate cases of wanting to patch a binary,
though I don't think that would happen too often..