Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 Dec 2004 16:03:55 +0100
From:      Herve Quiroz <herve.quiroz@esil.univ-mrs.fr>
To:        "David O'Brien" <obrien@FreeBSD.org>
Cc:        ports-committers@FreeBSD.org
Subject:   Re: cvs commit: ports/Mk bsd.port.mk bsd.port.subdir.mk
Message-ID:  <20041220150355.GA24591@arabica.esil.univ-mrs.fr>
In-Reply-To: <20041219220959.GA49369@dragon.nuxi.com>
References:  <200412092144.iB9LimTj092202@repoman.freebsd.org> <20041219220959.GA49369@dragon.nuxi.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20041220150355.GA24591>