Commit graph

55 commits

Author SHA1 Message Date
grant
74f8aaa8f9 remove somewhat bogus test for text files, which was dependent on the
output of file(1) which reports too many false negatives (not
detecting a file as a text file when it really is).

package developers are aware of which files the subst operation
applies to, since they need to specify the filenames, so this test is
not really required.

it's also not inconceivable that one would want to subst over a
non-text file, which is now possible.
2003-12-27 03:02:11 +00:00
grant
f4677e4cb8 only print SUBST_MESSAGE if it's defined. 2003-12-11 00:05:36 +00:00
jlam
653a32a9bc Allow a new variable SUBST_FILTER_CMD.<class> that is a command filter or
pipeline that takes stdin, performs the substitions and writes the result
to stdout.  It defaults to ${SED} ${SUBST_SED.<class>}.  Use this variable
to replace the sed command with something else, like an awk process.
2003-10-07 10:19:09 +00:00
jlam
841b57441b Merge pkgviews-mk branch into the HEAD by running:
cd pkgsrc/mk
	cvs update -Pd -A
	cvs update -Pd -j pkgviews-mk-base -j pkgviews-mk
2003-09-02 06:59:37 +00:00
jlam
b81c512e4f subst.mk is a Makefile fragment that implements a general text replacement
facility for different classes of files in ${WRKSRC}.  For each class of
files, a target <class>-subst is created to perform the text replacement.

The following variables are used:

SUBST_STAGE.<class>
	"stage" at which we do the text replacement, e.g. pre-configure,
	post-build, etc.

SUBST_MESSAGE.<class>
	message to display, noting what is being substituted

SUBST_FILES.<class>
	files on which to run the substitution; these are relative to
	${WRKSRC}

SUBST_SED.<class>
	sed(1) substitution expression to run on the specified files

This basically extracts a useful piece of code from bsd.buildlink2.mk and
puts it in a place that allows it to be more widely used, and so that the
functionality doesn't depend on USE_BUILDLINK2 being defined.
2003-08-27 11:24:37 +00:00