From owner-freebsd-ports@FreeBSD.ORG Mon Feb 7 16:18:36 2005 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 69B8F16A4CE for ; Mon, 7 Feb 2005 16:18:36 +0000 (GMT) Received: from gate.xbsd.org (xbsd.org [82.233.2.192]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9ECBC43D31 for ; Mon, 7 Feb 2005 16:18:35 +0000 (GMT) (envelope-from flz@xbsd.org) Received: from localhost (localhost.xbsd.org [127.0.0.1]) by gate.xbsd.org (Postfix) with ESMTP id 59CE4119E9; Mon, 7 Feb 2005 17:21:15 +0100 (CET) Received: from gate.xbsd.org ([127.0.0.1]) by localhost (gate.xbsd.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 99722-02; Mon, 7 Feb 2005 17:21:08 +0100 (CET) Received: from [192.168.20.107] (ALagny-109-1-26-203.w81-49.abo.wanadoo.fr [81.49.53.203]) by gate.xbsd.org (Postfix) with ESMTP id 63F5C1197D; Mon, 7 Feb 2005 17:21:06 +0100 (CET) Message-ID: <420794CC.1070604@xbsd.org> Date: Mon, 07 Feb 2005 17:18:20 +0100 From: Florent Thoumie User-Agent: Mozilla Thunderbird 1.0 (X11/20050107) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Yar Tikhiy References: <42075175.20603@ntmk.ru> <20050207125420.GA85693@heechee.tobez.org> <20050207154456.GB65425@comp.chem.msu.su> In-Reply-To: <20050207154456.GB65425@comp.chem.msu.su> X-Enigmail-Version: 0.89.6.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig1F3E463EB810AB0CE0381D06" X-Virus-Scanned: amavisd-new at xbsd.org cc: Boris Kovalenko cc: freebsd-ports@freebsd.org Subject: Re: We need new feature for pkg_create? X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Feb 2005 16:18:36 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig1F3E463EB810AB0CE0381D06 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Yar Tikhiy wrote: > On Mon, Feb 07, 2005 at 01:54:20PM +0100, Anton Berezin wrote: > >>On Mon, Feb 07, 2005 at 04:31:01PM +0500, Boris Kovalenko wrote: >> >> >>> I'm net/quagga port maintainer. My port is installing some scripts >>> to /etc/rc.d. I know, this is bad, but I really need rcorder to be applied >>>to my scripts. So, to install scripts, I use next trick: >>> >>>@cwd %%RC_DIR%% >>>quagga%%RC_SUFX%% >>>watchquagga%%RC_SUFX%% >>>@cwd %%CWD_TRICK%% >>> >>>where %%RC_DR%% is set to /etc/rc.d and %%CWD_TRICK%% is set to >>>${PREFIX}. In most cases this works well, but not in case when pkg_add >>>is used with -p option. So, the question is - may be we really need new >>>feature for pkg_create like @pushwd and @popwd? So, the trick will look like >> >>Would not it just be easier to re-arrange the original plist to be: >> >>@cwd %%CWD_TRICK%% >>..... >>@cwd %%RC_DIR%% >>quagga%%RC_SUFX%% >>watchquagga%%RC_SUFX%% >> >>This should work fine, if me reading of pkg_* code is correct. the >>disadvantage is, of course, using a feature (-p = replace only the >>_first_ @cwd), which is not documented. > > > This won't work because some @exec lines using %D may be *appended* > to a packing list by bsd.port.mk. Putting "@cwd %%CWD_TRICK%%" at > the beginning will buy nothing at all. > > IMHO, what we need is a way to restore the initial prefix setting > in a packing list. The idea of @pushwd and @popwd looks really > neat to me. With those commands available, it would be possible > to append lines using %D or just assuming the current prefix is the > right one to the final packing list from bsd.port.mk without breaking > "pkg_add -p /foo". > > BTW, here's an example that the problem is rather general. Currently > using @cwd in port's pkg-plist and PORTDOCS in its Makefile results > precisely in broken "pkg_add -p /foo" because the build-time prefix > gets hardcoded in the packing list. I don't like the idea of a "working directory" stack because at most, you'll push one time (or your port is behaving weirdly). FWIW, I just sent a PR with a patch to address this issue [1]. Feel free to add comments in the audit trail. [1] http://www.freebsd.org/cgi/query-pr.cgi?pr=77212 -- Florent Thoumie flz@xbsd.org --------------enig1F3E463EB810AB0CE0381D06 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (FreeBSD) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFCB5TQMxEkbVFH3PQRArk6AJ9F2k4lJoyShnpK5Qmmps3qPUhiJwCfUDyr vEsZiuUkMiG/NetC3s7vSAw= =qQ3k -----END PGP SIGNATURE----- --------------enig1F3E463EB810AB0CE0381D06--