cvs commit: ports/Mk bsd.port.mk bsd.port.subdir.mk

Herve Quiroz herve.quiroz at esil.univ-mrs.fr
Mon Dec 20 07:04:00 PST 2004


On Sun, Dec 19, 2004 at 02:09:59PM -0800, David O'Brien wrote:
> On Thu, Dec 09, 2004 at 09:44:48PM +0000, Kirill Ponomarew wrote:
> > krion       2004-12-09 21:44:48 UTC
> >   FreeBSD ports repository
> >   Modified files:
> >     Mk                   bsd.port.mk bsd.port.subdir.mk 
> >   Log:
> >   * Add new command macros: DATE, FMT, MKTEMP, OBJDUMP,
> >     and use command macro SORT. [1]
> 
> What is the use of all these macros?  Back when we first added them in
> the Satoshi day, they were actually useful.  'ls' vs. '${LS}' isn't.  We
> had MKDIR so that the '-p' option would be used.  We had TAR because we
> tried to support both {Open,Net}BSD and FreeBSD.
> 
> I think we've forgotten the purpose of macros like these and just keep
> adding them for command-line utils that have need to have them.

These macros ensure that when building or running a port, you use
exactly the executable you intend to. I think this reduces the amount of
error reports due to some misconfiguration from the user.

I find these macros quite useful myself, when patching a launcher shell
script for instance (through sed magic or the nice new SUB_FILES
feature). Indeed, it allows to enforce the use of an absolute path with
no asumptions on the end-user configuration or PATH settings.

That said, I admit there must be some cost to everything. Here I think
of the CPU time cost to test if a macro is defined and then affect a
value. And I don't know exactly whether this is cheap or not so I can't
tell if these macros are worth it. My guess is that  it's quite
expensive when building INDEX file but probably not too much when
building/installing a single port.

Herve


More information about the cvs-ports mailing list