Re: cvs commit: src/usr.bin/less Makefile lesspipe.sh

[ Available lists | Index of cvs-all | Month of Mar 2003 | Week of 6 Mar 2003 | Raw email | View thread | Wrap long lines | Reply | Tag ]
From
David O'Brien <obrien@FreeBSD.org>
Date
6 Mar 2003 12:09:04
Subject
Re: cvs commit: src/usr.bin/less Makefile lesspipe.sh
Message-ID
20030306200858.GA41375@dragon.nuxi.com


[ Hide this part ]
On Thu, Mar 06, 2003 at 08:58:24PM +0200, Ruslan Ermilov wrote:
> The "documented" name is an example only, it is not the default --
> one still needs to set the LESSOPEN environment variable.

Yeah, so? I'd much rather use the example than be HIH.

> The example script from the manpage can't even handle the `-' as
> the first character in the name.

*shrug* I've used exactly what I committed since Sep 9 1998.
It's worked great for me. If you have improvements to the script itself,
email me a patch.

> How do you expect people to know that we provide lesspipe.sh and
> they should set to LESSOPEN=/usr/bin/lesspipe.sh to explore it?

I am doing this in steps. I need to poll people to see if it should be
committed to the sample dot files, or in /etc/login.conf.

> The answer is to document this (hint: this can easily be done by
> compile-time adding the FreeBSD-specific section to the otherwise
> stock vendor file), where you can document the fact that FreeBSD
> provides /usr/bin/lesspipe (without .sh) suitable for LESSOPEN.

Hint, I *like* the name and don't plan on changing. Plus based on the
man page, I feel more people are likely to have "lesspipe.sh" than
"lesspipe" on their non-FreeBSD systems.

> In any case, it's not _stupid_, as the default behavior of
> SCRIPTSNAME of stripping extensions fits 99% of cases, and
> it was designed bearing this in mind.

Huh?? SCRIPTSNAME is only used when you need to over ride the default
behavior. Perhaps you are talking about "SCRIPTS". What I think is
stupid is that if I do use SCRIPTSNAME I still have to use SCRIPTS. Also
as written, bsd.prog.mk doesn't handle this well:

.for script in ${SCRIPTS}
.if defined(SCRIPTSNAME)
SCRIPTSNAME_${script:T}?= ${SCRIPTSNAME}
.else
SCRIPTSNAME_${script:T}?= ${script:T:R}
.endif

So what we have is SCRIPTS is a list, but SCRIPTSNAME name isn't.
So what happens with
...
SCRIPTS=foo.sh bar.sh
SCRIPTSNAME=baz
.include <bsd.prog.mk>

both get installed as baz. SCRIPTS and SCRIPTSNAME should be treated
separately. I'd fix it, but anytime I touch bsd.*.mk you pop up and I
have a federal case on my hands -- thus I now try hard to never touch
them.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message



Elapsed time: 0.111 seconds