pkgsrc-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: CVS commit: pkgsrc/databases/ldb
On Tue, 19 May 2020 at 09:05:35 +0200, Roland Illig wrote:
> To me, this change seems to be unnecessary. To double-check, I added
> the
> following lines to sysutils/checkperms/Makefile:
>
> post-configure:
> :; type sed
> :; type mv
>
> $ bmake configure
>
> :; type sed
> sed is
> /home/rillig/tmp/pkgsrc.work/sysutils/checkperms/work/.tools/bin/sed
> :; type mv
> mv is
> /home/rillig/tmp/pkgsrc.work/sysutils/checkperms/work/.tools/bin/mv
>
> The targets
> {pre,do,post}-{extract,patch,configure,build,install,package} can use
> the tools by their simple names. They are taken from ${TOOLS_DIR} and
> should be the preferred tools, as specified in USE_TOOLS.
>
> While here, you could as well use the SUBST framework to do these
> replacements. If you had written both "mv" and "sed" in the same
> Makefile line, pkglint would have suggested:
>
> NOTE: options.mk:18--20: Please use the SUBST framework instead of
> ${SED} and ${MV}.
>
> Using the SUBST framework instead of explicit commands is
> easier to
> understand, since all the complexity of using sed and mv is
> hidden
> behind the scenes.
>
> Run "bmake help topic=subst" for more information.
Hi Roland,
I stand corrected, then. I'm used to seeing tools expressed as
variables in targets (as well as elsewhere in the infrastructure, of
course). I have no idea offhand what the incidence is one way vs. the
other, it's just quite common to use variables, and I'd assumed there
was a practical reason for this. (Rather than it just being done for
consistency of style.) I hadn't looked closely enough at how links are
generated for specific tools here.
(Really my starting point there was noticing that that invocation used
"-E", which historically wasn't necessarily portable, which had me
thinking about platforms that would require nbsed rather than their
native sed. Though, that's probably not relevant to the vast majority
of platforms pkgsrc supports these days, anyway. But I digress.)
Regarding the SUBST framework, yes, one reason I didn't change it was
simply that I try to keep to the original committer's style when making
a tweak to something. (Another random example would be: if someone else
used echo to write to a file, instead of patching it, I may stick to
that approach. Whereas I'd probably patch it if I was doing it from
scratch.)
Cheers,
Dave
Home |
Main Index |
Thread Index |
Old Index