Subject: Re: "xargs: A: No such file or directory"
To: der Mouse <mouse@Rodents.Montreal.QC.CA>
From: Alistair Crooks <agc@pkgsrc.org>
List: tech-userlevel
Date: 03/31/2005 12:17:41
On Wed, Mar 30, 2005 at 06:43:30PM -0500, der Mouse wrote:
> Why is ${LS} used rather than a simple "ls"?  What is that trying to
> accomplish?  I wonder if that goal could be better met some other way,
> or something, because it looks to me as though the current scheme is
> rather fragile because it depends on a whole raft of environment
> variables either not existing or naming what the makefiles expect them
> to name.

The reason "LS" is defined and used as an abstraction is so that
pkgsrc can rely, on different platforms, on known behaviour.  So, in
Solaris, you get the xpg4 commands, on NetBSD the standard ones, and
the same for the other platforms that are supported.

In general, we usually use a leading underscore on an environment
variable to denote that it's a private (to pkgsrc) definition, and
so that there's no conflict with environment variables.

"Fragile"? Perhaps. But you're the first person I've heard of who
uses a definition like "LS". For everyone else, it seems to be fine.

We could go through pkgsrc and privatise all of our definitions, but
this is the first occurrence I've heard of in nearly 8 years of pkgsrc,
and I've yet to be convinced of the benefits of such a move. All CBA
gratefully received.

Please note that I'm open to all kinds of persuasion, even (it is
rumoured) chocolate.

Regards,
Alistair