Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 7 Mar 2003 10:01:51 +0200
From:      Ruslan Ermilov <ru@FreeBSD.org>
To:        John Baldwin <jhb@FreeBSD.org>
Cc:        src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   SCRIPTS vs FILES (was: Re: cvs commit: src/usr.bin/less Makefile lesspipe.sh)
Message-ID:  <20030307080151.GA4072@sunbay.com>
In-Reply-To: <XFMail.20030306171511.jhb@FreeBSD.org>
References:  <20030306215832.GB95318@sunbay.com> <XFMail.20030306171511.jhb@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
On Thu, Mar 06, 2003 at 05:15:11PM -0500, John Baldwin wrote:
> 
> On 06-Mar-2003 Ruslan Ermilov wrote:
> > On Thu, Mar 06, 2003 at 03:25:21PM -0500, John Baldwin wrote:
> >> 
> >> On 06-Mar-2003 David O'Brien wrote:
> >> >> 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.
> >> 
> >> The SCRIPTSNAME stuff seems to be intentional.  I use some hokey magic
> >> like so to deal with compiled python scripts:
> >> 
> >> # Special rules to handle installing Python scripts
> >> .if defined(PYSRCS) && !empty(PYSRCS)
> >> PYOBJS=         ${PYSRCS:S/$/c/}
> >> SCRIPTS+=       ${PYOBJS}
> >> CLEANFILES+=    ${PYOBJS}
> >> .ifdef PYDIR
> >> SCRIPTSDIR=     ${PYDIR}
> >> .endif
> >> SCRIPTSMODE=    444
> >> .for script in ${PYOBJS}
> >> SCRIPTSNAME_${script:T}?=       ${script}
> >> .endfor
> >> .endif
> >> 
> >> Then I just have 'PYSRCS=foo.py bar.py' and the compiled versions get
> >> installed as foo.pyc and bar.pyc.
> >> 
> > You'd better s/SCRIPTS/FILES/ then, and remove most
> > of your hokey.  :-)
> 
> I thought about adding a new type but that looked to be a lot
> more work than just messing with SCRIPTS.
> 
Why add new type?  FILES is already supported, and it smells
like what you actually need here.  Untested:

# Special rules to handle installing Python scripts
.if defined(PYSRCS) && !empty(PYSRCS)
PYOBJS=		${PYSRCS:S/$/c/}
FILES+=		${PYOBJS}
CLEANFILES+=	${PYOBJS}
.ifdef PYDIR
FILESDIR=	${PYDIR}
.endif
.endif


Cheers,
-- 
Ruslan Ermilov		Sysadmin and DBA,
ru@sunbay.com		Sunbay Software AG,
ru@FreeBSD.org		FreeBSD committer,
+380.652.512.251	Simferopol, Ukraine

http://www.FreeBSD.org	The Power To Serve
http://www.oracle.com	Enabling The Information Age

[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (FreeBSD)

iD8DBQE+aFHuUkv4P6juNwoRAmeFAJwIlgCrjyXXs4fQ+IjtNCdeLkb9gwCfaXwW
jfsybINXTYznbxTud7B1FDM=
=bDPD
-----END PGP SIGNATURE-----

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