Date: Mon, 26 Feb 2007 12:10:18 +0100 From: Fabian Keil <freebsd-listen@fabiankeil.de> To: Gabor Kovesdan <gabor@FreeBSD.org> Cc: ports@FreeBSD.org Subject: Re: Optionally depending on one of two ports (or none of them) Message-ID: <20070226121018.02411cc7@localhost> In-Reply-To: <45E2B779.9090109@FreeBSD.org> References: <20070222141301.007fee4f@localhost> <45DDA117.3050508@FreeBSD.org> <20070224163229.062bd234@localhost> <45E06810.1070704@FreeBSD.org> <20070225171729.41a050d6@localhost> <45E1C1B8.7030407@FreeBSD.org> <20070226112850.5ce2cb0b@localhost> <45E2B779.9090109@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--Sig_8ojYsxkZgggC20ltU=M9UZc Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable [CC'ing ports@ again] Gabor Kovesdan <gabor@FreeBSD.org> wrote: > Fabian Keil escribi=F3: > > Gabor Kovesdan <gabor@FreeBSD.org> wrote: > >> Fabian Keil schrieb: > >> =20 > >>> Gabor Kovesdan <gabor@FreeBSD.org> wrote: > >>> I added knobs and used pkg_info as suggested by Matthew > >>> to make sure PKG_DBDIR is honoured: [...] > >>> #HAVE_TOR_DEVEL!=3D if ls /var/db/pkg | grep ^tor-devel-[[:digit:]] >= /dev/null 2>&1 ; then echo YES; fi > >>> HAVE_TOR_DEVEL!=3D if pkg_info -I tor-devel\* >/dev/null 2>&1 ; then = ${ECHO} YES; fi > >>> .if (${HAVE_TOR_DEVEL} =3D=3D "YES") > >>> OPTIONS=3D TOR_DEVEL "Depend on tor-devel (already installed)" On > >>> .else > >>> #HAVE_TOR!=3D if ls /var/db/pkg | egrep ^tor-[[:digit:]] >/dev/null 2= >&1 ; then echo YES; fi > >>> HAVE_TOR_DEVEL!=3D if pkg_info -I tor-\* >/dev/null 2>&1 ; then ${ECH= O} YES; fi > >>> .endif > >>> .if (defined(HAVE_TOR) && ${HAVE_TOR} =3D=3D "YES") > >>> OPTIONS=3D TOR "Depend on tor (already installed)" On > >>> .endif > >>> > >>> .include <bsd.port.pre.mk> > >>> > >>> .if defined(WITH_TOR_DEVEL) [...] > >>> It happens to work, but causes two new portlint warnings: > >>> > >>> fk@TP51 /usr/ports/security/dns-proxy-tor $portlint . > >>> WARN: Makefile: [28]: possible direct use of command "pkg_info" found= . use ${PKG_INFO} instead. > >>> WARN: Makefile: [33]: possible direct use of command "pkg_info" found= . use ${PKG_INFO} instead. > >>> WARN: Makefile: using hyphen in PORTNAME. consider using PKGNAMEPREFI= X and/or PKGNAMESUFFIX. > >>> 0 fatal errors and 3 warnings found. > >>> > >>> Unfortunately the suggestion is bogus as ${PKG_INFO} isn't set that e= arly. > >>> Can I just ignore the warnings, or is there a way around this? > >> What if you include bsd.port.pre.mk before this check? Will that=20 > >> conflict with OPTIONS? I'm not sure about this. > >> =20 > > > > I doesn't seem to conflict with OPTIONS, but it doesn't work either. > > > > .include <bsd.port.pre.mk> > > HAVE_TOR_DEVEL!=3D if ${PKG_INFO} -I tor-devel\* >/dev/null 2>&1 ; then= ${ECHO} YES; fi > > > > still leads to "-I: not found". > > =20 > It works then, but it seems you cannot use make vars in the if statement= =20 > of !=3D expansions, I ran into the same. Does ECHO work? Please use=20 > ECHO_CMD instead, it should be used for command pipelineing, stream=20 > redirections, etc. while ECHO_MSG shoud be used to display informative=20 > output for the user. ${ECHO} works without problems, and I just noticed that ${PKG_INFO} works for "=3D", but seems to fail for "!=3D" in general: Using: IGNORE=3D ${ECHO_CMD} ${PKG_INFO} ${ECHO_CMD} leads to the expected: =3D=3D=3D> dns-proxy-tor-0.1.0 echo /usr/sbin/pkg_info echo. *** Error code 1 Whereas: IGNORE!=3D ${ECHO_CMD} ${PKG_INFO} ${ECHO_CMD} leads to: =3D=3D=3D> dns-proxy-tor-0.1.0 echo. *** Error code 1 Fabian --Sig_8ojYsxkZgggC20ltU=M9UZc Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (FreeBSD) iD8DBQFF4sAhBYqIVf93VJ0RAvYlAKCkVwUyJLHbfwLnOM4NaEe/PzxLZgCfZIrV 2z7Ol7T9Zf/oOAAGgD3ZRdc= =Ds26 -----END PGP SIGNATURE----- --Sig_8ojYsxkZgggC20ltU=M9UZc--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070226121018.02411cc7>