atom feed32 messages in org.freebsd.freebsd-portsPass variable to pkg-install
FromSent OnAttachments
Kris KennawayNov 22, 2004 9:35 am 
Kris KennawayNov 23, 2004 3:33 am 
Kris KennawayNov 23, 2004 5:29 am 
Kris KennawayNov 23, 2004 7:33 am 
A. NooitgedagtNov 23, 2004 9:04 am 
Kris KennawayNov 23, 2004 9:31 am 
A. NooitgedagtNov 23, 2004 10:44 am 
Kris KennawayNov 23, 2004 11:33 am 
Kris KennawayNov 23, 2004 1:30 pm 
Kris KennawayNov 23, 2004 3:34 pm 
Kris KennawayNov 23, 2004 5:29 pm 
Kris KennawayNov 23, 2004 6:06 pm 
Conrad J. SabatierNov 23, 2004 6:54 pm 
Kirill PonomarewNov 23, 2004 7:00 pm 
Kris KennawayNov 23, 2004 7:43 pm 
A. NooitgedagtNov 23, 2004 8:27 pm 
Kris KennawayNov 27, 2004 3:46 pm 
Pav LucistnikNov 27, 2004 3:59 pm 
Kris KennawayNov 27, 2004 6:52 pm 
Kris KennawayNov 28, 2004 7:53 am 
Norikatsu ShigemuraNov 28, 2004 9:53 am 
Ion-Mihai TetcuNov 28, 2004 12:01 pm 
Kris KennawayNov 30, 2004 3:42 pm 
Kris KennawayNov 30, 2004 5:38 pm 
Edwin GroothuisNov 30, 2004 5:52 pm 
Robin SchoonoverNov 30, 2004 7:11 pm 
Edwin GroothuisNov 30, 2004 7:33 pm 
Kris KennawayNov 30, 2004 7:41 pm 
Robin SchoonoverNov 30, 2004 8:15 pm 
Kris KennawayNov 30, 2004 9:39 pm 
Lars KöllerNov 30, 2004 11:37 pm 
Kris KennawayNov 30, 2004 11:47 pm 
Subject:Pass variable to pkg-install
From:A. Nooitgedagt (a.no@12move.nl)
Date:Nov 23, 2004 8:27:32 pm
List:org.freebsd.freebsd-ports

-----Original Message----- From: owne@freebsd.org [mailto:owne@freebsd.org]On Behalf Of Kris Kennaway Sent: dinsdag 23 november 2004 19:11 To: A. Nooitgedagt Cc: free@freebsd.org Subject: Re: Pass variable to pkg-install

On Tue, Nov 23, 2004 at 11:44:22AM +0100, A. Nooitgedagt wrote:

Actually,

It does work to set variables in SCRIPTS_ENV ! I just shouldn't manipulate them in pkg-install I guess. I'm still not sure how it works.

This is what I have as a test in Makefile:

" pre-fetch: @ ${SETENV} PKG_PREFIX=${PREFIX} \ ${SCRIPTS_ENV} USER=${USER} PG_USER=${PG_USER} GROUP=${GROUP} UID=${UID} GID=${GID} \ ${SH} ${PKGINSTALL} ${PORTNAME} PRE-INSTALL "

I didn't find good docs about how a statement like that gets translate or did I miss something. Any pointer?

Be careful what you do here, because the pkg-install script is also run when someone adds (or removes) your package with pkg_add, so it needs to work properly in that case too (and it will not if you customize the way that pkg-install is called)

Ouch, pkg_add doesn't read the makefile variables.... That complicates things even more.

Would it be an option to create a config.sh on the fly while processing the Makefile (no interactive configure): http://www.freebsd.org/cgi/cvsweb.cgi/ports/net/cvsup-mirror/scripts/configu re

script:

--------------------------------- #! /bin/sh

variables="USER GROUP UID GID"

echo "" echo -n "Building the \"config.sh\" file ... " for var in ${variables}; do eval echo ${var}=\\\"\${${var}}\\\" done > ${WRKSRC}/config.sh echo "Done."

---------------------------------

pkg-install:

--------------------------------- . ${base}/config.sh || exit

---------------------------------

Or something like that....

Would that be a good option or is there a less complicated example that would also work for pkg_add?

Aldert