The NetBSD Project

CVS log for pkgsrc/mk/subst.mk

[BACK] Up to [cvs.NetBSD.org] / pkgsrc / mk

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.107 / (download) - annotate - [select for diffs], Wed Mar 29 10:57:16 2023 UTC (12 months ago) by rillig
Branch: MAIN
CVS Tags: pkgsrc-2023Q4-base, pkgsrc-2023Q4, pkgsrc-2023Q3-base, pkgsrc-2023Q3, pkgsrc-2023Q2-base, pkgsrc-2023Q2, HEAD
Changes since 1.106: +4 -4 lines
Diff to previous 1.106 (colored) to selected 1.42 (colored)

mk/subst.mk: clean up documentation

Revision 1.106 / (download) - annotate - [select for diffs], Wed Nov 23 10:53:14 2022 UTC (16 months ago) by jperkin
Branch: MAIN
CVS Tags: pkgsrc-2023Q1-base, pkgsrc-2023Q1, pkgsrc-2022Q4-base, pkgsrc-2022Q4
Changes since 1.105: +3 -3 lines
Diff to previous 1.105 (colored) to selected 1.42 (colored)

mk: Don't define DO_NADA to true.

Ironically, DO_NADA was not doing nothing, it was invoking shells simply
to run true.  Now that we are actually doing nothing, we're saving around
160 shell execs per build!

Revision 1.105 / (download) - annotate - [select for diffs], Wed Jul 6 20:59:51 2022 UTC (20 months, 3 weeks ago) by rillig
Branch: MAIN
CVS Tags: pkgsrc-2022Q3-base, pkgsrc-2022Q3
Changes since 1.104: +3 -3 lines
Diff to previous 1.104 (colored) to selected 1.42 (colored)

mk/subst.mk: fix indentation of directives

Revision 1.104 / (download) - annotate - [select for diffs], Wed May 19 14:44:22 2021 UTC (2 years, 10 months ago) by triaxx
Branch: MAIN
CVS Tags: pkgsrc-2022Q2-base, pkgsrc-2022Q2, pkgsrc-2022Q1-base, pkgsrc-2022Q1, pkgsrc-2021Q4-base, pkgsrc-2021Q4, pkgsrc-2021Q3-base, pkgsrc-2021Q3, pkgsrc-2021Q2-base, pkgsrc-2021Q2
Changes since 1.103: +2 -2 lines
Diff to previous 1.103 (colored) to selected 1.42 (colored)

subst.mk: Fix mk/scrips/subst-identity.awk for FreeBSD

At least on FreeBSD 13.0, awk '/^[\t -~]/' does not match alphabetical
characters with some utf-8 locales (e.g. neither en_US.UTF-8 nor
fr_FR.UTF-8 works but C.UTF-8 does).

Revision 1.103 / (download) - annotate - [select for diffs], Tue Oct 6 17:48:02 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
CVS Tags: pkgsrc-2021Q1-base, pkgsrc-2021Q1, pkgsrc-2020Q4-base, pkgsrc-2020Q4
Changes since 1.102: +12 -19 lines
Diff to previous 1.102 (colored) to selected 1.42 (colored)

mk/subst.mk: remove SUBST_NOOP_OK

This means that from now on, there is no global setting to switch off
this redundancy check.  Individual SUBST classes can still set their own
SUBST_NOOP_OK.<id> in order to ignore no-op filename patterns.

The current bulk builds do not show any build failures that are caused
by this, which means that really almost all packages have been migrated.

Revision 1.102 / (download) - annotate - [select for diffs], Mon Jun 29 18:04:13 2020 UTC (3 years, 8 months ago) by rillig
Branch: MAIN
CVS Tags: pkgsrc-2020Q3-base, pkgsrc-2020Q3
Changes since 1.101: +2 -2 lines
Diff to previous 1.101 (colored) to selected 1.42 (colored)

mk/subst.mk: activate the SUBST no-op check again by default

It had been switched off to not affect packages in the stable branch
2020Q2.  Now starts the last round where it is possible to disable this
check.  After 2020Q3, all SUBST blocks must either find their patterns or
be explicitly marked as potential no-ops.  This will help to find
outdated SUBST blocks.

Revision 1.101 / (download) - annotate - [select for diffs], Thu Jun 25 08:45:00 2020 UTC (3 years, 9 months ago) by jperkin
Branch: MAIN
CVS Tags: pkgsrc-2020Q2-base, pkgsrc-2020Q2
Changes since 1.100: +2 -2 lines
Diff to previous 1.100 (colored) to selected 1.42 (colored)

mk: Handle pdksh issue with "set -e" in for loop.

With our current version of pdksh, a "false && something" construct under
"set -e" conditions will continue as it does with other shells, but if the
construct is within a for loop then it exits, causing failures in the
substitution code.  An explicit "|| true" is necessary to avoid this.

Approved during the freeze by wiz.

Revision 1.100 / (download) - annotate - [select for diffs], Tue Jun 16 18:13:54 2020 UTC (3 years, 9 months ago) by rillig
Branch: MAIN
Changes since 1.99: +2 -2 lines
Diff to previous 1.99 (colored) to selected 1.42 (colored)

mk/subst.mk: SUBST_NOOP_OK defaults to yes again

There are still some packages that fail the strict SUBST check.  These
packages should nevertheless be built using the default pkgsrc
configuration, at least in the stable 2020Q2 branch.  After 2020Q2 has
been switched, the strict SUBST checks will be activated again in the
default configuration.

Revision 1.99 / (download) - annotate - [select for diffs], Thu Jun 11 20:13:22 2020 UTC (3 years, 9 months ago) by rillig
Branch: MAIN
Changes since 1.98: +1 -2 lines
Diff to previous 1.98 (colored) to selected 1.42 (colored)

mk/subst.mk: remove unnecessary SUBST_VARS definition

This is a package-settable variable, and if a package leaves it
undefined, "bmake show-all-subst" should show exactly this.

Revision 1.98 / (download) - annotate - [select for diffs], Thu Jun 11 19:38:40 2020 UTC (3 years, 9 months ago) by rillig
Branch: MAIN
Changes since 1.97: +2 -1 lines
Diff to previous 1.97 (colored) to selected 1.42 (colored)

mk/subst.mk: document the unspecified application order

To avoid bmake warnings because of duplicate class names, the :O:u
modifier had been added in r1.66 on 2020-03-21.  This had the side effect
that the subst classes are now applied in alphabetical order instead of
declaration order.

For this to actually matter, there must be a file that is affected by two
different subst classes and in which the substitutions depend on each
other or prevent each other.  Chances for that are pretty low.

The order is intentionally documented as being unspecified, to allow for
future modifications, just in case that a bmake variable modifier is
invented that filters for duplicates without requiring the duplicates to
be adjacent to each other.  In that situation, it would be nicer to
switch back to declaration order instead of alphabetical.

Revision 1.97 / (download) - annotate - [select for diffs], Thu Jun 11 19:27:56 2020 UTC (3 years, 9 months ago) by rillig
Branch: MAIN
Changes since 1.96: +8 -8 lines
Diff to previous 1.96 (colored) to selected 1.42 (colored)

mk/subst.mk: fix local variable names

These variables don't record whether a file is changed but instead
whether a pattern was found.

Revision 1.96 / (download) - annotate - [select for diffs], Thu Jun 11 18:04:41 2020 UTC (3 years, 9 months ago) by rillig
Branch: MAIN
Changes since 1.95: +4 -6 lines
Diff to previous 1.95 (colored) to selected 1.42 (colored)

mk/subst.mk: always remove temporary file

Fixes PR pkg/55364.

Revision 1.95 / (download) - annotate - [select for diffs], Wed Jun 3 10:56:46 2020 UTC (3 years, 9 months ago) by gdt
Branch: MAIN
Changes since 1.94: +4 -5 lines
Diff to previous 1.94 (colored) to selected 1.42 (colored)

subst.mk: Move hint about find to package-settable section

Revision 1.94 / (download) - annotate - [select for diffs], Tue Jun 2 23:37:25 2020 UTC (3 years, 9 months ago) by gdt
Branch: MAIN
Changes since 1.93: +3 -2 lines
Diff to previous 1.93 (colored) to selected 1.42 (colored)

subst.mk: Give hint abotu SUBST_NOOP_OK

Note that a typical reason to need this is using find to generate a
list of files.

Revision 1.93 / (download) - annotate - [select for diffs], Sat May 16 19:02:32 2020 UTC (3 years, 10 months ago) by rillig
Branch: MAIN
Changes since 1.92: +25 -22 lines
Diff to previous 1.92 (colored) to selected 1.42 (colored)

mk/subst.mk: change default value for SUBST_NOOP_OK from yes to no

This makes the SUBST blocks stricter than before, to detect outdated or
unnecessary definitions.

Filename patterns that are not affected by any of the SUBST_SED
expressions make the build fail.  It is still ok if only some of the
files from a pattern are affected and some aren't.

The latest bulk build shows that most of the build failures are fixed.
The packages that fail in that build are mostly due to other failures,
like missing C headers, wrong PLIST files, unresolved references at link
time.  There may be a few packages that still fail because of this, but
these are near the leaves of the dependency tree.

https://mail-index.netbsd.org/pkgsrc-bulk/2020/05/14/msg018919.html

Revision 1.92 / (download) - annotate - [select for diffs], Sat May 2 05:52:09 2020 UTC (3 years, 10 months ago) by rillig
Branch: MAIN
Changes since 1.91: +2 -2 lines
Diff to previous 1.91 (colored) to selected 1.42 (colored)

mk/subst.mk: fix shell parse error for special sed expressions

The escaping inside the backticks had been wrong.  Because of this,
parentheses and semicolons were interpreted as shell syntax.

Switching to $(...) command substitution removes the need for quoting
some of the characters and makes the whole command simpler to understand.
Doing the escaping for the backticks command properly would have involved
lots of special cases.

The $(...) command substitution was used sparingly in pkgsrc up to now
because some older or broken shells do not support it.  Since these
shells do not end up as the shell that runs the commands from Makefiles,
that's not a problem.

Revision 1.91 / (download) - annotate - [select for diffs], Fri May 1 19:53:48 2020 UTC (3 years, 10 months ago) by rillig
Branch: MAIN
Changes since 1.90: +2 -2 lines
Diff to previous 1.90 (colored) to selected 1.42 (colored)

mk/subst.mk: fix typo in diagnostic

Revision 1.90 / (download) - annotate - [select for diffs], Fri May 1 06:42:32 2020 UTC (3 years, 10 months ago) by rillig
Branch: MAIN
Changes since 1.89: +2 -2 lines
Diff to previous 1.89 (colored) to selected 1.42 (colored)

mk/subst.mk: switch command substitution back to backticks

To work properly, the $(...) should have been $$(...).

In pkgsrc the command substitution is usually done via `backticks`, for
compatibility with /bin/sh from Solaris.  To fix the shell parse errors,
the special characters are properly escaped inside the command
substitution.

Revision 1.89 / (download) - annotate - [select for diffs], Thu Apr 30 23:52:30 2020 UTC (3 years, 10 months ago) by joerg
Branch: MAIN
Changes since 1.88: +2 -2 lines
Diff to previous 1.88 (colored) to selected 1.42 (colored)

Simplify

Revision 1.88 / (download) - annotate - [select for diffs], Thu Apr 30 23:51:45 2020 UTC (3 years, 10 months ago) by joerg
Branch: MAIN
Changes since 1.87: +2 -2 lines
Diff to previous 1.87 (colored) to selected 1.42 (colored)

Use $() as it gives more consistent quoting behavior as seen by
devel/ruby-redmine.

Revision 1.87 / (download) - annotate - [select for diffs], Thu Apr 30 23:51:15 2020 UTC (3 years, 10 months ago) by joerg
Branch: MAIN
Changes since 1.86: +2 -2 lines
Diff to previous 1.86 (colored) to selected 1.42 (colored)

Terminate case properly

Revision 1.86 / (download) - annotate - [select for diffs], Wed Apr 29 22:46:42 2020 UTC (3 years, 10 months ago) by rillig
Branch: MAIN
Changes since 1.85: +6 -3 lines
Diff to previous 1.85 (colored) to selected 1.42 (colored)

mk/subst.mk: fix combination of SUBST_FILTER_CMD with SUBST_NOOP_OK=no

Since SUBST_FILTER_CMD is a shell command, it may contain arbitrary
characters.  The condition in mk/subst.mk that tested whether
SUBST_FILTER_CMD was the default filter command was evaluated at run
time.  In such an evaluation, the variables (lhs and rhs) are fully
expanded before parsing the condition.  This means that these variables
must not contain quotes or unquoted condition operators.

Exactly this situation came up in one of the regression tests.  The
quoted "0-9" was copied verbatimly into the condition, including the
quotes.  The resulting condition was:

	"tr -d "0-9"" == "LC_ALL=C /usr/bin/sed "

This produced a syntax error because of the left-hand side. Adding a :Q
modifier would have helped for the left-hand side, but this would have
been necessary for the right-hand side as well.  Since an empty SUBST_SED
is defined not to "contain only identity substitutions", the first
condition can simply be removed.

The whole condition in the shell program had not worked anyway since it
expanded to either "[ true ]" or to "[ false ]", and both of these
commands exited successfully.

Revision 1.85 / (download) - annotate - [select for diffs], Wed Apr 29 18:33:56 2020 UTC (3 years, 10 months ago) by rillig
Branch: MAIN
Changes since 1.84: +24 -5 lines
Diff to previous 1.84 (colored) to selected 1.42 (colored)

mk/subst.mk: allow identity substitutions in SUBST_NOOP_OK=no mode

There are several cases where patterns like s|man|${PKGMANDIR}| appear in
SUBST_SED.  Up to now, these had been categorized as no-ops and required
extra code to make the package build when SUBST_NOOP_OK was set to "no".

This was against the original intention of SUBST_NOOP_OK, which was to
find outdated substitution patterns that do not occur in SUBST_FILES
anymore, most often because the packages have been updated since.

The identity substitutions do appear in the files, they just don't change
them.  Typical cases are for PKGMANDIR, DEVOSSAUDIO, PREFIX, and these
variables may well be different in another pkgsrc setup.  These patterns
are therefore excluded from the SUBST_NOOP_OK check.

Revision 1.84 / (download) - annotate - [select for diffs], Thu Apr 23 19:32:53 2020 UTC (3 years, 11 months ago) by rillig
Branch: MAIN
Changes since 1.83: +2 -2 lines
Diff to previous 1.83 (colored) to selected 1.42 (colored)

mk/subst.mk: don't recommend {pre,do,post}-patch

These often lead to broken patches, unless the patches are generated very
cautiously. Because of this, pkglint already warns about this.

Revision 1.83 / (download) - annotate - [select for diffs], Thu Apr 23 19:30:29 2020 UTC (3 years, 11 months ago) by rillig
Branch: MAIN
Changes since 1.82: +16 -5 lines
Diff to previous 1.82 (colored) to selected 1.42 (colored)

mk/subst.mk: warn about all noop patterns before erroring out

Revision 1.82 / (download) - annotate - [select for diffs], Thu Apr 23 19:16:49 2020 UTC (3 years, 11 months ago) by rillig
Branch: MAIN
Changes since 1.81: +3 -3 lines
Diff to previous 1.81 (colored) to selected 1.42 (colored)

mk/subst.mk: omit ./ for sanely named files, quote filename patterns

Revision 1.81 / (download) - annotate - [select for diffs], Thu Apr 23 19:06:09 2020 UTC (3 years, 11 months ago) by rillig
Branch: MAIN
Changes since 1.80: +34 -33 lines
Diff to previous 1.80 (colored) to selected 1.42 (colored)

mk/subst.mk: refactor main code

The indentation of the inner loop has been fixed.

The chmod is only run if the file has actually changed. In the other
case, the file would have been removed right after the chmod, which made
the chmod unnecessary.

For compatibility with ancient operating systems whose /bin/sh still does
not understand negated conditions (SunOS), these conditions have been
avoided and were written using && and || instead.

The inner loop has been flattened a bit, to compensate for the
indentation of the outer loop.

Revision 1.80 / (download) - annotate - [select for diffs], Thu Apr 23 18:06:13 2020 UTC (3 years, 11 months ago) by rillig
Branch: MAIN
Changes since 1.79: +6 -8 lines
Diff to previous 1.79 (colored) to selected 1.42 (colored)

mk/subst.mk: prevent filename expansion using "set -f"

This avoids creating a temporary directory.

The "set -f" option is not used anywhere else in pkgsrc, even though it
has been available since 1985 in the 8th Edition of Research Unix. Even
AIX and IRIX have that option, so it seems a safe bet.

Revision 1.79 / (download) - annotate - [select for diffs], Sat Apr 18 15:04:34 2020 UTC (3 years, 11 months ago) by rillig
Branch: MAIN
Changes since 1.78: +2 -2 lines
Diff to previous 1.78 (colored) to selected 1.42 (colored)

mk/subst.mk: document that SUBST_VARS does not support dollar

Revision 1.78 / (download) - annotate - [select for diffs], Sat Apr 18 12:59:43 2020 UTC (3 years, 11 months ago) by rillig
Branch: MAIN
Changes since 1.77: +2 -2 lines
Diff to previous 1.77 (colored) to selected 1.42 (colored)

mk/subst.mk: make error message for filename pattern easier readable

Revision 1.77 / (download) - annotate - [select for diffs], Sat Apr 18 12:21:10 2020 UTC (3 years, 11 months ago) by rillig
Branch: MAIN
Changes since 1.76: +2 -2 lines
Diff to previous 1.76 (colored) to selected 1.42 (colored)

mk/subst.mk: avoid undefined behavior in regular expressions

https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap09.html
says in section 9.3.2 BRE Ordinary Characters that only very few
characters may be preceded with a backslash.

As a side effect, this change allows parentheses in the variable names
listed in SUBST_VARS (even if that will never happen in practice).

The reason that the regression test had not replaced VAR.[] before was
simply that this variable had not been listed in SUBST_VARS.

Revision 1.76 / (download) - annotate - [select for diffs], Sat Apr 18 11:42:34 2020 UTC (3 years, 11 months ago) by rillig
Branch: MAIN
Changes since 1.75: +11 -10 lines
Diff to previous 1.75 (colored) to selected 1.42 (colored)

mk/subst.mk: fix pkglint warnings and notes

Revision 1.75 / (download) - annotate - [select for diffs], Sat Apr 18 11:32:01 2020 UTC (3 years, 11 months ago) by rillig
Branch: MAIN
Changes since 1.74: +33 -33 lines
Diff to previous 1.74 (colored) to selected 1.42 (colored)

mk/subst.mk: rename local variable _class_ to class

This makes the code a bit more readable.

Revision 1.74 / (download) - annotate - [select for diffs], Wed Apr 1 15:10:09 2020 UTC (3 years, 11 months ago) by rillig
Branch: MAIN
Changes since 1.73: +13 -3 lines
Diff to previous 1.73 (colored) to selected 1.42 (colored)

mk/subst.mk: add user-settable SUBST_NOOP_OK

This variable allows to make SUBST stricter than before. This will break
several packages that have redundant filename patterns. Most of these are
typos or outdated and should be updated or removed.

Revision 1.73 / (download) - annotate - [select for diffs], Sat Mar 28 20:39:50 2020 UTC (4 years ago) by rillig
Branch: MAIN
CVS Tags: pkgsrc-2020Q1-base, pkgsrc-2020Q1
Changes since 1.72: +2 -2 lines
Diff to previous 1.72 (colored) to selected 1.42 (colored)

mk/subst.mk: fix typo in documentation

Revision 1.72 / (download) - annotate - [select for diffs], Mon Mar 23 11:27:29 2020 UTC (4 years ago) by jperkin
Branch: MAIN
Changes since 1.71: +2 -2 lines
Diff to previous 1.71 (colored) to selected 1.42 (colored)

mk/subst.mk: Unbreak builds with no substitutions.

At least some implementations of rmdir(1) do not allow you to remove the
current working directory.  Fixes bootstrap on SunOS.

Revision 1.71 / (download) - annotate - [select for diffs], Sun Mar 22 18:43:46 2020 UTC (4 years ago) by rillig
Branch: MAIN
Changes since 1.70: +3 -3 lines
Diff to previous 1.70 (colored) to selected 1.42 (colored)

mk/subst.mk: only create cookie after everything is finished

When fixing the SUBST definitions in a package, it can hapen that the
substitution aborts in the middle. In such a case the cookie should not
be written and the substitution should be retried. Otherwise the build
may continue with half the substitutions done.

Revision 1.70 / (download) - annotate - [select for diffs], Sun Mar 22 13:19:50 2020 UTC (4 years ago) by rillig
Branch: MAIN
Changes since 1.69: +2 -2 lines
Diff to previous 1.69 (colored) to selected 1.42 (colored)

mk/subst.mk: ignore directories in SUBST_FILES

Seen in multimedia/libmp4v2, where a pattern also matches the CVS
directory from the distfiles.

Revision 1.69 / (download) - annotate - [select for diffs], Sun Mar 22 12:15:59 2020 UTC (4 years ago) by rillig
Branch: MAIN
Changes since 1.68: +5 -4 lines
Diff to previous 1.68 (colored) to selected 1.42 (colored)

mk/subst.mk: use the same severity for all messages

The severity now depends only on the setting of SUBST_NOOP_OK. Right now
this means that some former warnings will be reported as info only, but
that will change after switching the default of SUBST_NOOP_OK after
2020Q1. Then they will all be reported as warnings, followed by the final
error saying that the pattern has no effect.

This change makes it easier to detect inconsistencies and outdated
definitions, for example by setting the global SUBST_NOOP_OK=no and
redefining WARNING_MSG to actuall fail.

Revision 1.68 / (download) - annotate - [select for diffs], Sat Mar 21 19:26:12 2020 UTC (4 years ago) by rillig
Branch: MAIN
Changes since 1.67: +2 -2 lines
Diff to previous 1.67 (colored) to selected 1.42 (colored)

mk/subst.mk: run diff in the default locale

The diff program is only used to produce informative output in the build
logs, nevertheless its output might be translated if there are lines that
do not end with a newline.

Revision 1.67 / (download) - annotate - [select for diffs], Sat Mar 21 13:30:35 2020 UTC (4 years ago) by rillig
Branch: MAIN
Changes since 1.66: +9 -2 lines
Diff to previous 1.66 (colored) to selected 1.42 (colored)

mk/subst.mk: add global SUBST_SHOW_DIFF variable

This is useful in bulk builds or when trying to understand what happens
under the hood, since the SUBST code leaves no .orig files around.

Revision 1.66 / (download) - annotate - [select for diffs], Sat Mar 21 12:22:31 2020 UTC (4 years ago) by rillig
Branch: MAIN
Changes since 1.65: +3 -3 lines
Diff to previous 1.65 (colored) to selected 1.42 (colored)

mk/subst.mk: fix bmake warnings in case of duplicate SUBST classes

Revision 1.65 / (download) - annotate - [select for diffs], Fri Mar 20 09:00:44 2020 UTC (4 years ago) by rillig
Branch: MAIN
Changes since 1.64: +7 -4 lines
Diff to previous 1.64 (colored) to selected 1.42 (colored)

mk/subst.mk: evaluate SUBST_MESSAGE only once, and late

The default value of SUBST_MESSAGE is based on SUBST_FILES, and that
variable may use the :sh modifier to list files from WRKSRC, which may
not exist at load time.

Revision 1.64 / (download) - annotate - [select for diffs], Fri Mar 20 06:17:48 2020 UTC (4 years ago) by rillig
Branch: MAIN
Changes since 1.63: +13 -7 lines
Diff to previous 1.63 (colored) to selected 1.42 (colored)

mk/subst.mk: fix early evaluation of SUBST_FILES

In the case of pkglocaledir, the SUBST_FILES are generated by a shell
command. That command assumes that the WRKDIR already exists. Therefore
SUBST_FILES must be evaluated as late as possible.

See mk/configure/replace-localedir.mk; an example package that fails is
devel/gettext-tools.

Revision 1.63 / (download) - annotate - [select for diffs], Thu Mar 19 16:57:35 2020 UTC (4 years ago) by rillig
Branch: MAIN
Changes since 1.62: +29 -6 lines
Diff to previous 1.62 (colored) to selected 1.42 (colored)

mk/subst.mk: add SUBST_NOOP_OK to catch typos and outdated definitions

In a bulk build with very strict settings (WARNING_MSG fails, as well as
no-op substitutions), it became clear that nearly all of the cases where
SUBST didn't replace anything were bugs in the package definition.

Most of them were just outdated, which is no surprise given that some
packages are already over 20 years old.

For backwards compatibility, SUBST_NOOP_OK defaults to "yes" right now.
After correcting the affected packages, the default will change to "no".

Revision 1.62 / (download) - annotate - [select for diffs], Fri Nov 22 18:04:49 2019 UTC (4 years, 4 months ago) by minskim
Branch: MAIN
CVS Tags: pkgsrc-2019Q4-base, pkgsrc-2019Q4
Changes since 1.61: +3 -3 lines
Diff to previous 1.61 (colored) to selected 1.42 (colored)

mk: Set LC_ALL=C to avoid encoding issue with tr and sed

Revision 1.61 / (download) - annotate - [select for diffs], Sun Sep 8 09:06:06 2019 UTC (4 years, 6 months ago) by rillig
Branch: MAIN
CVS Tags: pkgsrc-2019Q3-base, pkgsrc-2019Q3
Changes since 1.60: +11 -15 lines
Diff to previous 1.60 (colored) to selected 1.42 (colored)

mk/subst.mk: document variables used in the file, remove SUBST_TARGETS

All variables that are used or defined in the file are now listed in the
_VARGROUPS section.

The "is text file" command variable has been renamed since pkglint
thought the former variable name would specify a filename, not a shell
command.

The "is text file" command has been rewritten to only rely on tr(1)
instead of both tr(1) and wc(1). This makes it both simpler and maybe
also a little faster, since the file only has to be read once.

The SUBST_TARGETS variable has been removed since it is used nowhere
else. To get the list of all subst targets (should that ever be
necessary), use the expression ${SUBST_CLASSES:S,^,subst-,}.

Revision 1.60 / (download) - annotate - [select for diffs], Sun Apr 28 12:31:15 2019 UTC (4 years, 11 months ago) by rillig
Branch: MAIN
CVS Tags: pkgsrc-2019Q2-base, pkgsrc-2019Q2
Changes since 1.59: +18 -8 lines
Diff to previous 1.59 (colored) to selected 1.42 (colored)

mk/subst.mk: use simpler words in the documentation, add an example

Revision 1.59 / (download) - annotate - [select for diffs], Sun Mar 17 12:01:14 2019 UTC (5 years ago) by rillig
Branch: MAIN
CVS Tags: pkgsrc-2019Q1-base, pkgsrc-2019Q1
Changes since 1.58: +2 -2 lines
Diff to previous 1.58 (colored) to selected 1.42 (colored)

mk/subst.mk: substitute embedded newlines, escape dots in variable names

Revision 1.58 / (download) - annotate - [select for diffs], Fri Nov 30 18:38:19 2018 UTC (5 years, 3 months ago) by rillig
Branch: MAIN
CVS Tags: pkgsrc-2018Q4-base, pkgsrc-2018Q4
Changes since 1.57: +3 -1 lines
Diff to previous 1.57 (colored) to selected 1.42 (colored)

mk/misc: make configuration for show-all targets more configurable

Up to now, there was a central list of variable name patterns that
defined whether a variable was printed as a sorted list, as a list or as
a single value.

Now each variable group decides on its own which of the variables are
printed in which way, using the usual glob patterns. This is more
flexible since different files sometimes differ in their naming
conventions.

Two variable groups are added: license (for everything related to
LICENSE) and go (for lang/go).

Revision 1.57 / (download) - annotate - [select for diffs], Mon Oct 8 20:35:00 2018 UTC (5 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.56: +2 -2 lines
Diff to previous 1.56 (colored) to selected 1.42 (colored)

Fix whitespace issues reported by pkglint

Revision 1.56 / (download) - annotate - [select for diffs], Tue Jan 2 21:18:48 2018 UTC (6 years, 2 months ago) by rillig
Branch: MAIN
CVS Tags: pkgsrc-2018Q3-base, pkgsrc-2018Q3, pkgsrc-2018Q2-base, pkgsrc-2018Q2, pkgsrc-2018Q1-base, pkgsrc-2018Q1
Changes since 1.55: +8 -1 lines
Diff to previous 1.55 (colored) to selected 1.42 (colored)

Allow package developers to easily see and check the SUBST changes.

Revision 1.55 / (download) - annotate - [select for diffs], Sun Jan 31 17:27:41 2016 UTC (8 years, 1 month ago) by rillig
Branch: MAIN
CVS Tags: pkgsrc-2017Q4-base, pkgsrc-2017Q4, pkgsrc-2017Q3-base, pkgsrc-2017Q3, pkgsrc-2017Q2-base, pkgsrc-2017Q2, pkgsrc-2017Q1-base, pkgsrc-2017Q1, pkgsrc-2016Q4-base, pkgsrc-2016Q4, pkgsrc-2016Q3-base, pkgsrc-2016Q3, pkgsrc-2016Q2-base, pkgsrc-2016Q2, pkgsrc-2016Q1-base, pkgsrc-2016Q1
Changes since 1.54: +10 -14 lines
Diff to previous 1.54 (colored) to selected 1.42 (colored)

Fixed subst.mk not to corrupt files

Up to now, using subst.mk may have led to file corruption during active
package development. This happened when a sed(1) command had a syntax
error, in which case the whole sed(1) command was terminated, leaving an
empty original file behind.

This commit changes that behavior by applying the sed(1) commands to
the original file and saving the result in a temporary file. Only
after that succeeded is the original file overwritten.

During this rewrite, SUBST_POSTCMD has been removed, since it was
only used in one place (mk/wrapper), and since it relied on the exact
sequence of the internal commands. No package in either main pkgsrc
or pkgsrc-wip uses this variable right now.

Revision 1.54 / (download) - annotate - [select for diffs], Sun Oct 13 21:38:36 2013 UTC (10 years, 5 months ago) by dholland
Branch: MAIN
CVS Tags: pkgsrc-2015Q4-base, pkgsrc-2015Q4, pkgsrc-2015Q3-base, pkgsrc-2015Q3, pkgsrc-2015Q2-base, pkgsrc-2015Q2, pkgsrc-2015Q1-base, pkgsrc-2015Q1, pkgsrc-2014Q4-base, pkgsrc-2014Q4, pkgsrc-2014Q3-base, pkgsrc-2014Q3, pkgsrc-2014Q2-base, pkgsrc-2014Q2, pkgsrc-2014Q1-base, pkgsrc-2014Q1, pkgsrc-2013Q4-base, pkgsrc-2013Q4
Changes since 1.53: +4 -3 lines
Diff to previous 1.53 (colored) to selected 1.42 (colored)

Add note to SUBST_SED noting that -E is not a standard sed option.
From Leonardo Taccari in followup to PR 48254.

Revision 1.53 / (download) - annotate - [select for diffs], Sat Jan 26 15:23:21 2008 UTC (16 years, 2 months ago) by rillig
Branch: MAIN
CVS Tags: pkgsrc-2013Q3-base, pkgsrc-2013Q3, pkgsrc-2013Q2-base, pkgsrc-2013Q2, pkgsrc-2013Q1-base, pkgsrc-2013Q1, pkgsrc-2012Q4-base, pkgsrc-2012Q4, pkgsrc-2012Q3-base, pkgsrc-2012Q3, pkgsrc-2012Q2-base, pkgsrc-2012Q2, pkgsrc-2012Q1-base, pkgsrc-2012Q1, pkgsrc-2011Q4-base, pkgsrc-2011Q4, pkgsrc-2011Q3-base, pkgsrc-2011Q3, pkgsrc-2011Q2-base, pkgsrc-2011Q2, pkgsrc-2011Q1-base, pkgsrc-2011Q1, pkgsrc-2010Q4-base, pkgsrc-2010Q4, pkgsrc-2010Q3-base, pkgsrc-2010Q3, pkgsrc-2010Q2-base, pkgsrc-2010Q2, pkgsrc-2010Q1-base, pkgsrc-2010Q1, pkgsrc-2009Q4-base, pkgsrc-2009Q4, pkgsrc-2009Q3-base, pkgsrc-2009Q3, pkgsrc-2009Q2-base, pkgsrc-2009Q2, pkgsrc-2009Q1-base, pkgsrc-2009Q1, pkgsrc-2008Q4-base, pkgsrc-2008Q4, pkgsrc-2008Q3-base, pkgsrc-2008Q3, pkgsrc-2008Q2-base, pkgsrc-2008Q2, pkgsrc-2008Q1-base, pkgsrc-2008Q1, cwrapper, cube-native-xorg-base, cube-native-xorg
Changes since 1.52: +4 -1 lines
Diff to previous 1.52 (colored) to selected 1.42 (colored)

See also: PLIST_SUBST

Revision 1.52 / (download) - annotate - [select for diffs], Wed Jan 23 01:44:28 2008 UTC (16 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.51: +3 -2 lines
Diff to previous 1.51 (colored) to selected 1.42 (colored)

Made the wording more into an explanation.

Revision 1.51 / (download) - annotate - [select for diffs], Fri Jan 18 11:26:11 2008 UTC (16 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.50: +4 -3 lines
Diff to previous 1.50 (colored) to selected 1.42 (colored)

If the package doesn't provide a SUBST_MESSAGE, generate a default one.
This way, file modifications cannot go unnoticed and at least appear in
the build logs. While here, fixed an ambiguity in the description of
SUBST_MESSAGE.

Revision 1.50 / (download) - annotate - [select for diffs], Fri Jan 18 11:16:08 2008 UTC (16 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.49: +5 -5 lines
Diff to previous 1.49 (colored) to selected 1.42 (colored)

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

Revision 1.49 / (download) - annotate - [select for diffs], Fri Jan 18 10:41:05 2008 UTC (16 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.48: +4 -7 lines
Diff to previous 1.48 (colored) to selected 1.42 (colored)

Replaced _PKG_SILENT and _PKG_DEBUG with RUN.

Revision 1.48 / (download) - annotate - [select for diffs], Mon Nov 19 23:38:03 2007 UTC (16 years, 4 months ago) by rillig
Branch: MAIN
CVS Tags: pkgsrc-2007Q4-base, pkgsrc-2007Q4
Changes since 1.47: +3 -2 lines
Diff to previous 1.47 (colored) to selected 1.42 (colored)

Explicitly mentioned that both SUBST_SED and SUBST_VARS may be used in a
class.

Revision 1.47 / (download) - annotate - [select for diffs], Thu Nov 1 13:12:48 2007 UTC (16 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.46: +5 -5 lines
Diff to previous 1.46 (colored) to selected 1.42 (colored)

Before running _SUBST_IS_TEXT_FILE on a file, make sure that the file
exists.

Revision 1.46 / (download) - annotate - [select for diffs], Thu Apr 5 18:33:09 2007 UTC (16 years, 11 months ago) by wiz
Branch: MAIN
CVS Tags: pkgsrc-2007Q3-base, pkgsrc-2007Q3, pkgsrc-2007Q2-base, pkgsrc-2007Q2, pkgsrc-2007Q1-base, pkgsrc-2007Q1
Changes since 1.45: +2 -2 lines
Diff to previous 1.45 (colored) to selected 1.42 (colored)

Recognize XML files as text.

Revision 1.45 / (download) - annotate - [select for diffs], Thu Mar 15 22:54:24 2007 UTC (17 years ago) by rillig
Branch: MAIN
CVS Tags: jlam-pkgviews-base, jlam-pkgviews
Changes since 1.44: +10 -1 lines
Diff to previous 1.44 (colored) to selected 1.42 (colored)

For all those who are interested in the inner workings of pkgsrc, there
is a new target "show-all" that fits to the existing "debug",
"show-tools", "show-vars" targets. It prints a list of the variables
that make up the public interface to pkgsrc. Running this target is
especially useful if you want to do some things, you know that they must
have been implemented but you don't know what it is called. It also
shows the "class" of a variable (user-defined, package-defined,
system-defined).

Revision 1.44 / (download) - annotate - [select for diffs], Wed Mar 7 21:27:59 2007 UTC (17 years ago) by rillig
Branch: MAIN
Changes since 1.43: +5 -2 lines
Diff to previous 1.43 (colored) to selected 1.42 (colored)

Fixed the quoting for SUBST_VARS.*. Now every character gets replaced
properly. The regression test passes.

Revision 1.43 / (download) - annotate - [select for diffs], Mon Feb 5 08:39:23 2007 UTC (17 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.42: +2 -2 lines
Diff to previous 1.42 (colored)

Some Makefile.in files start with the letters PACKAGE. NetBSD's file(1)
considers files starting with the letters PACK to be related to Quake.

Revision 1.42 / (download) - annotate - [selected], Tue Jan 23 06:05:39 2007 UTC (17 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.41: +11 -2 lines
Diff to previous 1.41 (colored)

Since there are many cases where the string @FOO@ is replaced with the
pkgsrc variable ${FOO}, there is now a shorter variant for it. Instead
of defining SUBST_SED.*, just say SUBST_VARS.* = FOO.

Revision 1.41 / (download) - annotate - [select for diffs], Sun Jan 14 17:05:02 2007 UTC (17 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.40: +14 -2 lines
Diff to previous 1.40 (colored) to selected 1.42 (colored)

The new variable SUBST_SKIP_TEXT_CHECK.* can be set to "yes" to do the
substitutions in all files, whether or not file(1) says they are text.

Revision 1.40 / (download) - annotate - [select for diffs], Thu Jan 11 12:12:12 2007 UTC (17 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.39: +4 -3 lines
Diff to previous 1.39 (colored) to selected 1.42 (colored)

When a SUBST change leaves a file as-is, print an informational message.
For all messages, the current SUBST_CLASS is printed, too.

Revision 1.39 / (download) - annotate - [select for diffs], Wed Jan 3 23:35:13 2007 UTC (17 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.38: +4 -1 lines
Diff to previous 1.38 (colored) to selected 1.42 (colored)

+ keyword "subst"

Revision 1.38 / (download) - annotate - [select for diffs], Sun Dec 10 02:25:13 2006 UTC (17 years, 3 months ago) by reed
Branch: MAIN
CVS Tags: pkgsrc-2006Q4-base, pkgsrc-2006Q4
Changes since 1.37: +2 -2 lines
Diff to previous 1.37 (colored) to selected 1.42 (colored)

Also "Assembler source" is a text file for _SUBST_IS_TEXT_FILE.

(Really the file is a wdm config file. Noticed when building wdm.)

Revision 1.37 / (download) - annotate - [select for diffs], Thu Nov 23 16:27:53 2006 UTC (17 years, 4 months ago) by tron
Branch: MAIN
Changes since 1.36: +2 -2 lines
Diff to previous 1.36 (colored) to selected 1.42 (colored)

file(1) under NetBSD-sparc64 4.99.4 identifies the file
"gdk-pixbuf/Makefile.in" from the "gtk2" package as "libtool library file".
Change the textfile check to accept any file which file(1) identifies
as "<whatever>libtool<whateverelse>" to fix the build of the
"gtk2" package (and probably other packages).

Revision 1.36 / (download) - annotate - [select for diffs], Thu Nov 9 02:06:29 2006 UTC (17 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.35: +2 -2 lines
Diff to previous 1.35 (colored) to selected 1.42 (colored)

Clarify _who_ is supposed to set the SUBST_* variables.

Revision 1.35 / (download) - annotate - [select for diffs], Sun Jul 2 09:35:05 2006 UTC (17 years, 9 months ago) by rillig
Branch: MAIN
CVS Tags: pkgsrc-2006Q3-base, pkgsrc-2006Q3
Changes since 1.34: +3 -2 lines
Diff to previous 1.34 (colored) to selected 1.42 (colored)

Fixed the documentation for SUBST_SED.*, which is not _one_ sed
expression, but a list of sed expressions.

Revision 1.34 / (download) - annotate - [select for diffs], Thu Jun 22 20:45:48 2006 UTC (17 years, 9 months ago) by rillig
Branch: MAIN
CVS Tags: pkgsrc-2006Q2-base, pkgsrc-2006Q2
Changes since 1.33: +3 -2 lines
Diff to previous 1.33 (colored) to selected 1.42 (colored)

SUBST_STAGE.* is currently not defined by all SUBST blocks, so disable
PKG_FAIL_REASON in that case. It didn't have an effect anyway for normal
builds, since subst.mk is included after checking PKG_FAIL_REASON.

Discussed with jlam.

Revision 1.33 / (download) - annotate - [select for diffs], Sat Jun 17 22:42:00 2006 UTC (17 years, 9 months ago) by rillig
Branch: MAIN
Changes since 1.32: +11 -20 lines
Diff to previous 1.32 (colored) to selected 1.42 (colored)

Simplified the code by reducing the number of different targets that are
evaluated. Now the SUBST_MESSAGE is only printed once when the
substitution is actually done. Before this change it had been printed
also when the subst-<class> target had been invoked a second time, but
the substitution didn't take place again, which had confused me. Also,
converted the code to use ${WARNING_MSG} and ${STEP_MSG}.

Revision 1.16.4.2, Wed Jun 7 15:25:39 2006 UTC (17 years, 9 months ago) by tv
Branch: tv-derecurse
Changes since 1.16.4.1: +1 -1 lines
FILE REMOVED

EOL the tv-derecurse branch; it has become too outdated.  The last live
revision can be fetched at the tv-derecurse-eol tag.

Revision 1.32 / (download) - annotate - [select for diffs], Sun Jan 8 01:07:35 2006 UTC (18 years, 2 months ago) by rillig
Branch: MAIN
CVS Tags: pkgsrc-2006Q1-base, pkgsrc-2006Q1
Changes since 1.31: +11 -2 lines
Diff to previous 1.31 (colored) to selected 1.42 (colored)

Reverted the change from 1.29 to 1.30, as it had led to build failures in
the "unwrap" class.

Revision 1.31 / (download) - annotate - [select for diffs], Sat Jan 7 23:27:41 2006 UTC (18 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.30: +3 -3 lines
Diff to previous 1.30 (colored) to selected 1.42 (colored)

Added two missing :Q operators. One of them affects how the
SUBST_MESSAGE is printed. The ones that have been defined with "quotes"
in their Makefiles are printed with quotes (of course). This is the
consequence of the design pattern "quote-exactly-where-necessary", which
in fact should be have been applied to pkgsrc as a whole, but still isn't.

Revision 1.30 / (download) - annotate - [select for diffs], Sat Jan 7 18:43:05 2006 UTC (18 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.29: +2 -11 lines
Diff to previous 1.29 (colored) to selected 1.42 (colored)

Removed the use of ${FILE_CMD} from the substitution framework. The
detection whether a given file was a text file or some other file had
been unreliable. In the recent bulk builds, all of the warnings that had
appeared because of that unreliable detection had been false positives.

Revision 1.29 / (download) - annotate - [select for diffs], Thu Jan 5 23:16:01 2006 UTC (18 years, 2 months ago) by joerg
Branch: MAIN
Changes since 1.28: +2 -2 lines
Diff to previous 1.28 (colored) to selected 1.42 (colored)

Adjust comment about SUBST_FILES to match reality:
absolute file names work as well.

Revision 1.28 / (download) - annotate - [select for diffs], Sun Jan 1 22:52:16 2006 UTC (18 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.27: +4 -4 lines
Diff to previous 1.27 (colored) to selected 1.42 (colored)

Fixed some cases where the exitcode of child processes has been ignored.
This will cause package builds to fail instead of hiding bugs.

Revision 1.27 / (download) - annotate - [select for diffs], Sun Jan 1 22:30:35 2006 UTC (18 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.26: +4 -4 lines
Diff to previous 1.26 (colored) to selected 1.42 (colored)

Fixed trivial pkglint warnings:
- Removed leading white-space in dependency lines.
- s/existant/existent/.

Revision 1.26 / (download) - annotate - [select for diffs], Tue Dec 6 17:17:30 2005 UTC (18 years, 3 months ago) by rillig
Branch: MAIN
CVS Tags: pkgsrc-2005Q4-base, pkgsrc-2005Q4
Changes since 1.25: +2 -2 lines
Diff to previous 1.25 (colored) to selected 1.42 (colored)

Allow absolute filenames for SUBST_FILES. Needed for converters/convmv and
maybe some others.

Revision 1.25 / (download) - annotate - [select for diffs], Thu Nov 24 20:02:40 2005 UTC (18 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.24: +4 -2 lines
Diff to previous 1.24 (colored) to selected 1.42 (colored)

Added another diagnostic message to distinguish the cases for non-text
file and non-existant file.

Revision 1.24 / (download) - annotate - [select for diffs], Thu Nov 17 23:17:02 2005 UTC (18 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.23: +3 -1 lines
Diff to previous 1.23 (colored) to selected 1.42 (colored)

A warning is printed for every non-text file. This helps in detecting
broken file(1) databases. It also gives an indication of whether this
test is necessary at all.

Revision 1.23 / (download) - annotate - [select for diffs], Sun Aug 21 22:00:07 2005 UTC (18 years, 7 months ago) by rillig
Branch: MAIN
CVS Tags: pkgsrc-2005Q3-base, pkgsrc-2005Q3
Changes since 1.22: +9 -9 lines
Diff to previous 1.22 (colored) to selected 1.42 (colored)

Changed the comment for SUBST_STAGE to be more complete. Started the other
sentences with an uppercase letter. No code changes.

Revision 1.22 / (download) - annotate - [select for diffs], Thu Jun 9 19:49:48 2005 UTC (18 years, 9 months ago) by rillig
Branch: MAIN
CVS Tags: pkgsrc-2005Q2-base, pkgsrc-2005Q2
Changes since 1.21: +2 -2 lines
Diff to previous 1.21 (colored) to selected 1.42 (colored)

Fixed a typo.

Revision 1.21 / (download) - annotate - [select for diffs], Fri May 20 21:36:05 2005 UTC (18 years, 10 months ago) by jlam
Branch: MAIN
Changes since 1.20: +21 -22 lines
Diff to previous 1.20 (colored) to selected 1.42 (colored)

Change instances where we stored `shell command` in a make variable into
variables that use the :sh modifier.  This still causes expansion to only
happen when referenced, and has the advantage of being :Q-safe.

Bring back the changes from revision 1.19 of mk/subst.mk now that the
problem noted above has been fixed.  This passes the buildlink-unwrap
regression test.

Revision 1.20 / (download) - annotate - [select for diffs], Fri May 20 18:40:42 2005 UTC (18 years, 10 months ago) by jlam
Branch: MAIN
Changes since 1.19: +23 -22 lines
Diff to previous 1.19 (colored) to selected 1.42 (colored)

Revert part of revision 1.18.  The new quoting was breaking some
assumptions being made by the USE_PKGLOCALEDIR code and the wrapper
framework since it added backtick expressions to the SUBST_FILES.*
variables, which were being mangled by the :Q modifier.  This is
evident when running "make regress" in regress/buildlink-unwrap.

Mea culpa.

Revision 1.19 / (download) - annotate - [select for diffs], Wed May 18 03:33:51 2005 UTC (18 years, 10 months ago) by rillig
Branch: MAIN
Changes since 1.18: +2 -2 lines
Diff to previous 1.18 (colored) to selected 1.42 (colored)

Removed the quoting for SUBST_MESSAGE.<class>. Most packages unnecessarily
define that inside double quotes.

Revision 1.18 / (download) - annotate - [select for diffs], Tue May 17 19:01:36 2005 UTC (18 years, 10 months ago) by rillig
Branch: MAIN
Changes since 1.17: +27 -25 lines
Diff to previous 1.17 (colored) to selected 1.42 (colored)

Fixed shell quoting. Reviewed by jlam.

Revision 1.16.4.1 / (download) - annotate - [select for diffs], Tue May 17 18:29:44 2005 UTC (18 years, 10 months ago) by tv
Branch: tv-derecurse
CVS Tags: tv-derecurse-eol
Changes since 1.16: +1 -7 lines
Diff to previous 1.16 (colored) to selected 1.42 (colored)

sync [all but bsd.pkg.mk] with HEAD

Revision 1.17 / (download) - annotate - [select for diffs], Sat Apr 30 15:05:06 2005 UTC (18 years, 11 months ago) by jlam
Branch: MAIN
CVS Tags: tv-derecurse-merge
Changes since 1.16: +1 -7 lines
Diff to previous 1.16 (colored) to selected 1.42 (colored)

Avoid checking for !empty(...) so that we that defer variable references.

Revision 1.16 / (download) - annotate - [select for diffs], Mon Aug 23 16:37:09 2004 UTC (19 years, 7 months ago) by jlam
Branch: MAIN
CVS Tags: tv-derecurse-base, pkgsrc-2005Q1-base, pkgsrc-2005Q1, pkgsrc-2004Q4-base, pkgsrc-2004Q4, pkgsrc-2004Q3-base, pkgsrc-2004Q3
Branch point for: tv-derecurse
Changes since 1.15: +2 -2 lines
Diff to previous 1.15 (colored) to selected 1.42 (colored)

SUBST_POSTCMD must be globally defined or else it breaks.

Revision 1.15 / (download) - annotate - [select for diffs], Mon Aug 23 16:36:00 2004 UTC (19 years, 7 months ago) by jlam
Branch: MAIN
Changes since 1.14: +2 -2 lines
Diff to previous 1.14 (colored) to selected 1.42 (colored)

Actually, it's okay if SUBST_FILTER_CMD is empty... the ${SUBST_COOKIE}
target takes care of this case already.

Revision 1.14 / (download) - annotate - [select for diffs], Mon Aug 23 16:35:11 2004 UTC (19 years, 7 months ago) by jlam
Branch: MAIN
Changes since 1.13: +10 -8 lines
Diff to previous 1.13 (colored) to selected 1.42 (colored)

Use _SUBST_BACKUP_SUFFIX instead of hardcoding ".subst.sav" everywhere.

Revision 1.13 / (download) - annotate - [select for diffs], Mon Aug 23 09:01:57 2004 UTC (19 years, 7 months ago) by jlam
Branch: MAIN
Changes since 1.12: +2 -2 lines
Diff to previous 1.12 (colored) to selected 1.42 (colored)

SUBST_FILTER_CMD can't be empty.  It must be a real filter cmd, so default
it to ${CAT} as a fall-through.

Revision 1.12 / (download) - annotate - [select for diffs], Sun Jun 6 04:22:23 2004 UTC (19 years, 9 months ago) by schmonz
Branch: MAIN
CVS Tags: pkgsrc-2004Q2-base, pkgsrc-2004Q2
Changes since 1.11: +8 -2 lines
Diff to previous 1.11 (colored) to selected 1.42 (colored)

Usually there's no need to keep the original version of a file
"foo" as "foo.subst.sav". Implement SUBST_POSTCMD, which by default
cleans up these leftovers. If you need to keep them around, e.g.
while debugging, set it to ${DO_NADA}.

Remove superfluous whitespace in a comment.

Revision 1.11 / (download) - annotate - [select for diffs], Sun Mar 7 09:29:25 2004 UTC (20 years ago) by grant
Branch: MAIN
CVS Tags: pkgsrc-2004Q1-base, pkgsrc-2004Q1
Changes since 1.10: +2 -2 lines
Diff to previous 1.10 (colored) to selected 1.42 (colored)

Solaris' file(1) reports "executable [path] script" on scripts which
arent't shell scripts, so allow them to be subst'd.

Revision 1.10 / (download) - annotate - [select for diffs], Mon Mar 1 09:57:10 2004 UTC (20 years, 1 month ago) by uebayasi
Branch: MAIN
Changes since 1.9: +13 -9 lines
Diff to previous 1.9 (colored) to selected 1.42 (colored)

* Document SUBST_CLASSES.
* Indent conditionals.

Reviewed By:	wiz

Revision 1.9 / (download) - annotate - [select for diffs], Mon Dec 29 02:55:22 2003 UTC (20 years, 3 months ago) by kim
Branch: MAIN
Changes since 1.8: +2 -2 lines
Diff to previous 1.8 (colored) to selected 1.42 (colored)

Reinstate the fix in revision 1.6

Revision 1.8 / (download) - annotate - [select for diffs], Sun Dec 28 17:28:26 2003 UTC (20 years, 3 months ago) by kim
Branch: MAIN
Changes since 1.7: +18 -12 lines
Diff to previous 1.7 (colored) to selected 1.42 (colored)

Revert revision 1.5 as binaries and directories are now being substed
unintentionally.

Also revert revision 1.6 as part of the overall change, as I suspect
the change might be unnecessary.  While I'm not 100% sure, this does
just revert to the previous behaviour.

Revision 1.7 / (download) - annotate - [select for diffs], Sun Dec 28 15:57:29 2003 UTC (20 years, 3 months ago) by jmmv
Branch: MAIN
Changes since 1.6: +2 -2 lines
Diff to previous 1.6 (colored) to selected 1.42 (colored)

The generated target is subst-<class>, not <class>-subst.  Fix comment
accordingly.

Revision 1.6 / (download) - annotate - [select for diffs], Sat Dec 27 03:05:53 2003 UTC (20 years, 3 months ago) by grant
Branch: MAIN
Changes since 1.5: +2 -2 lines
Diff to previous 1.5 (colored) to selected 1.42 (colored)

bomb to prevent silent failure if we're unable to rename a file
before subst'ing it.

previously, only a warning would be printed and the .subst_done
cookie(s) would be created, indicating that the subst target was
successful when it really was not.

Revision 1.5 / (download) - annotate - [select for diffs], Sat Dec 27 03:02:11 2003 UTC (20 years, 3 months ago) by grant
Branch: MAIN
Changes since 1.4: +12 -18 lines
Diff to previous 1.4 (colored) to selected 1.42 (colored)

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.

Revision 1.3.2.1 / (download) - annotate - [select for diffs], Thu Dec 11 09:55:31 2003 UTC (20 years, 3 months ago) by agc
Branch: pkgsrc-2003Q4
Changes since 1.3: +3 -1 lines
Diff to previous 1.3 (colored) next main 1.4 (colored) to selected 1.42 (colored)

Pullup fix to pkgsrc-2003Q4 branch, requested by Grant Beattie.

	Module Name:    pkgsrc
	Committed By:   grant
	Date:           Thu Dec 11 00:05:36 UTC 2003

	Modified Files:
		pkgsrc/mk: subst.mk

	Log Message:
	only print SUBST_MESSAGE if it's defined.

Revision 1.4 / (download) - annotate - [select for diffs], Thu Dec 11 00:05:36 2003 UTC (20 years, 3 months ago) by grant
Branch: MAIN
Changes since 1.3: +3 -1 lines
Diff to previous 1.3 (colored) to selected 1.42 (colored)

only print SUBST_MESSAGE if it's defined.

Revision 1.3 / (download) - annotate - [select for diffs], Tue Oct 7 10:19:09 2003 UTC (20 years, 5 months ago) by jlam
Branch: MAIN
CVS Tags: pkgsrc-2003Q4-base
Branch point for: pkgsrc-2003Q4
Changes since 1.2: +17 -6 lines
Diff to previous 1.2 (colored) to selected 1.42 (colored)

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.

Revision 1.2 / (download) - annotate - [select for diffs], Tue Sep 2 06:59:47 2003 UTC (20 years, 7 months ago) by jlam
Branch: MAIN
Changes since 1.1: +1 -1 lines
Diff to previous 1.1 (colored) to selected 1.42 (colored)

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

Revision 1.1.2.2 / (download) - annotate - [select for diffs], Wed Aug 27 11:44:32 2003 UTC (20 years, 7 months ago) by jlam
Branch: pkgviews-mk
Changes since 1.1.2.1: +80 -0 lines
Diff to previous 1.1.2.1 (colored) to branchpoint 1.1 (colored) next main 1.2 (colored) to selected 1.42 (colored)

Sync to HEAD for subst.mk

Revision 1.1.2.1, Wed Aug 27 11:24:37 2003 UTC (20 years, 7 months ago) by jlam
Branch: pkgviews-mk
Changes since 1.1: +0 -80 lines
FILE REMOVED

file subst.mk was added on branch pkgviews-mk on 2003-08-27 11:24:37 +0000

Revision 1.1 / (download) - annotate - [select for diffs], Wed Aug 27 11:24:37 2003 UTC (20 years, 7 months ago) by jlam
Branch: MAIN
CVS Tags: pkgviews-mk-base
Branch point for: pkgviews-mk
Diff to selected 1.42 (colored)

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.

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.




CVSweb <webmaster@jp.NetBSD.org>