We need new feature for pkg_create?

Florent Thoumie flz at xbsd.org
Mon Feb 7 08:18:36 PST 2005


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 at xbsd.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-ports/attachments/20050207/e5f27716/signature.bin


More information about the freebsd-ports mailing list