Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 05 Jun 2011 23:07:21 -0700
From:      Doug Barton <dougb@FreeBSD.org>
To:        Baptiste Daroussin <bapt@FreeBSD.org>
Cc:        cvs-ports@FreeBSD.org, cvs-all@FreeBSD.org, ports-committers@FreeBSD.org
Subject:   Re: cvs commit: ports/Mk bsd.port.mk
Message-ID:  <4DEC6E99.7020400@FreeBSD.org>
In-Reply-To: <201106060553.p565rpOi094889@repoman.freebsd.org>
References:  <201106060553.p565rpOi094889@repoman.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
I think the following is a nice optimization, but I'm confused as to why 
we need to check this at all:

  check-categories:
  .for cat in ${CATEGORIES}
-	@if ${ECHO_CMD} ${VALID_CATEGORIES} | ${GREP} -wq ${cat}; then \
-		${TRUE}; \
-	else \
-		${ECHO_MSG} "${PKGNAME}: Makefile error: category ${cat} not in list 
of valid categories."; \
-		${FALSE}; \
-	fi
+.	if empty(VALID_CATEGORIES:M${cat})
+		@${ECHO_MSG} "${PKGNAME}: Makefile error: category ${cat} not in list 
of valid categories."; \
+		${FALSE};
+.	endif
  .endfor
  .endif

On the one hand, I don't think bsd.port.mk is the place for this. The 
other problem is that if you're creating local ports (e.g., 
/usr/ports/local/foo) you then have to play silly buggers in the port's 
Makefile, adding "VALID_CATEGORIES+= local" which just seems pointless 
to me.

Is this such a huge problem that we need to check this on every port build?


Doug


On 06/05/2011 22:53, Baptiste Daroussin wrote:
> bapt        2011-06-06 05:53:51 UTC
>
>    FreeBSD ports repository
>
>    Modified files:
>      Mk                   bsd.port.mk
>    Log:
>    - remove some old code (unsused on supported OS) [1]
>    - prevent some useless external program call (based on [2])
>    - simplify (in)valid category detection
>
>    PR:             ports/155629 [1],  ports/65804 [2], ports/157273 [3]  http://www.FreeBSD.org/cgi/query-pr.cgi?pr=155629
>    Submitted by:   Eitan Adler<lists@eitanadler.com>  [1], green@ [2], bapt@ (myself) [2]
>    Exp-runs by:    pav@
>
>    Revision  Changes    Path
>    1.684     +13 -28    ports/Mk/bsd.port.mk
>
> http://www.FreeBSD.org/cgi/cvsweb.cgi/ports/Mk/bsd.port.mk.diff?&r1=1.683&r2=1.684&f=h
>



-- 

	Nothin' ever doesn't change, but nothin' changes much.
			-- OK Go

	Breadth of IT experience, and depth of knowledge in the DNS.
	Yours for the right price.  :)  http://SupersetSolutions.com/




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4DEC6E99.7020400>