From owner-cvs-src Fri Mar 7 0: 2: 8 2003 Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0FFC837B401; Fri, 7 Mar 2003 00:02:03 -0800 (PST) Received: from whale.sunbay.crimea.ua (whale.sunbay.crimea.ua [212.110.138.65]) by mx1.FreeBSD.org (Postfix) with ESMTP id 09CA243FDD; Fri, 7 Mar 2003 00:01:59 -0800 (PST) (envelope-from ru@whale.sunbay.crimea.ua) Received: from whale.sunbay.crimea.ua (ru@localhost [127.0.0.1]) by whale.sunbay.crimea.ua (8.12.8/8.12.8/Sunbay) with ESMTP id h2781pUC005038 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Fri, 7 Mar 2003 10:01:54 +0200 (EET) (envelope-from ru@whale.sunbay.crimea.ua) Received: (from ru@localhost) by whale.sunbay.crimea.ua (8.12.8/8.12.8/Submit) id h2781pfq005033; Fri, 7 Mar 2003 10:01:51 +0200 (EET) (envelope-from ru) Date: Fri, 7 Mar 2003 10:01:51 +0200 From: Ruslan Ermilov To: John Baldwin 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> References: <20030306215832.GB95318@sunbay.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="n8g4imXOkfNTN/H1" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.3i Sender: owner-cvs-src@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --n8g4imXOkfNTN/H1 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Mar 06, 2003 at 05:15:11PM -0500, John Baldwin wrote: >=20 > On 06-Mar-2003 Ruslan Ermilov wrote: > > On Thu, Mar 06, 2003 at 03:25:21PM -0500, John Baldwin wrote: > >>=20 > >> 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. > >> >=20 > >> > Huh?? SCRIPTSNAME is only used when you need to over ride the defau= lt > >> > 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: > >> >=20 > >> > .for script in ${SCRIPTS} > >> > .if defined(SCRIPTSNAME) > >> > SCRIPTSNAME_${script:T}?=3D ${SCRIPTSNAME} > >> > .else > >> > SCRIPTSNAME_${script:T}?=3D ${script:T:R} > >> > .endif > >> >=20 > >> > So what we have is SCRIPTS is a list, but SCRIPTSNAME name isn't. > >> > So what happens with > >> > ... > >> > SCRIPTS=3Dfoo.sh bar.sh > >> > SCRIPTSNAME=3Dbaz > >> > .include > >> >=20 > >> > 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. > >>=20 > >> The SCRIPTSNAME stuff seems to be intentional. I use some hokey magic > >> like so to deal with compiled python scripts: > >>=20 > >> # Special rules to handle installing Python scripts > >> .if defined(PYSRCS) && !empty(PYSRCS) > >> PYOBJS=3D ${PYSRCS:S/$/c/} > >> SCRIPTS+=3D ${PYOBJS} > >> CLEANFILES+=3D ${PYOBJS} > >> .ifdef PYDIR > >> SCRIPTSDIR=3D ${PYDIR} > >> .endif > >> SCRIPTSMODE=3D 444 > >> .for script in ${PYOBJS} > >> SCRIPTSNAME_${script:T}?=3D ${script} > >> .endfor > >> .endif > >>=20 > >> Then I just have 'PYSRCS=3Dfoo.py bar.py' and the compiled versions get > >> installed as foo.pyc and bar.pyc. > >>=20 > > You'd better s/SCRIPTS/FILES/ then, and remove most > > of your hokey. :-) >=20 > I thought about adding a new type but that looked to be a lot > more work than just messing with SCRIPTS. >=20 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 =2Eif defined(PYSRCS) && !empty(PYSRCS) PYOBJS=3D ${PYSRCS:S/$/c/} FILES+=3D ${PYOBJS} CLEANFILES+=3D ${PYOBJS} =2Eifdef PYDIR FILESDIR=3D ${PYDIR} =2Eendif =2Eendif Cheers, --=20 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 --n8g4imXOkfNTN/H1 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (FreeBSD) iD8DBQE+aFHuUkv4P6juNwoRAmeFAJwIlgCrjyXXs4fQ+IjtNCdeLkb9gwCfaXwW jfsybINXTYznbxTud7B1FDM= =bDPD -----END PGP SIGNATURE----- --n8g4imXOkfNTN/H1-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-src" in the body of the message