Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Mar 2019 12:48:14 +0100
From:      Harry Schmalzbauer <freebsd@omnilan.de>
To:        Alexey Dokuchaev <danfe@freebsd.org>
Cc:        Mateusz Piotrowski <0mp@freebsd.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r345057 - head/share/man/man7
Message-ID:  <a66d6e12-d4d7-9a4a-1dfa-0dd7db6a000b@omnilan.de>
In-Reply-To: <20190312105025.GA54467@FreeBSD.org>
References:  <201903120927.x2C9Rc1B017630@repo.freebsd.org> <79a9c91f-72c2-ef18-e341-4ed471fb787c@omnilan.de> <20190312105025.GA54467@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Am 12.03.2019 um 11:50 schrieb Alexey Dokuchaev:
> On Tue, Mar 12, 2019 at 11:17:58AM +0100, Harry Schmalzbauer wrote:
>> Am 12.03.2019 um 10:27 schrieb Mateusz Piotrowski:
>>> New Revision: 345057
>>> URL: https://svnweb.freebsd.org/changeset/base/345057
>>>
>>> Log:
>>>     ports.7: Add an example of how to use flavors
>>
>> Since cem and dim seem to stumbled over the missing FLAVOR
>> documentation, I see my main objection against current FLAVOR
>> implementation confirmed: build stage must'nt silently chose a
>> default FLAVOR, but an OPTIONS-like dialog must inform the user
>> and she _must_ choose one.
>>
>> FLAVOR is a severe regression for ports usage to all FreeBSD
>> users imho.  Users can't see if a port makes use of FLAVOR or not.
>> User won't get informed that default FLAVOR is in use. [...]
> 
> Users who install packages that are built from a flavorized port
> are well informed which flavor they're about to install, I don't
> see how flavors cause a problem -- they must have unique PKGNAMEs.
> 
> For users that are building ports by themselves, looking into a
> Makefile can be helpful, but then again -- don't we always do that?
> It might slip when building the dependencies, so yeah, some extra
> care is in order.  I don't see what's a big deal here, and flavors
> are certainly less annoying and more flexible than slave ports.
> 
> If you really want an OPTIONS-like dialog popup then perhaps you
> should've attached some patches to your complaints. :-)

You are right, I missed the patches...

Here's my local diff which works around some more recent regressions 
which were breaking local ports tree usage.
Abusing IGNORE is not a solution, but helps my avoiding unexpected 
results.  I see no easy way to patch FLAVOR, so I preferred spending 
time working around USE_PACKAGE_DEPENDS shortcomings.  Unfortunately 
very limited time, but I'm able to smart-compile packages.

I don't support teaching users using packages in favour of ports.
Ports is great for the ambitious users etc. and often the first 
"isnsight" for newbies.
But it's much more time consuming (wasting) than using packages, due to 
the brute force compile approach widley used.
USE_PACKAGE_DEPENDS virtually always leads to inconsitencies, since only 
the first dependency is resolved with the ports tree, subsequent 
dependencys are resolved by pkg - hence, if not 
in-sync-brute-force-compiled, it's likely that previous built packages 
have different dependency versions than your fresh built.

My tool handles that and generates a _consistent_ iso image repository.
Personally need/want that to maintain production environments with 
sensible ammount of effort (my production environments don't have 
compilers).
I still have to iron out bugs of all categories during usage, but it's 
in use and saving me really a lot of time.
(It also handles OPTIONS mismatches between possibly existing packages 
and current ports options settings – which can also save a lot of time 
and points out possibly unwanted current settinges etc..)

I was also missing the ability to batch-package everything already 
compiled in WRKDIRPREFIX, so I wrote a small Makefile, which acts as a 
harvester.  Simly to be called in the wanted PACKAGES directory.  Happy 
to share on request.


Index: /usr/ports/Mk/bsd.port.mk
===================================================================
--- /usr/ports/Mk/bsd.port.mk	(revision 495299)
+++ /usr/ports/Mk/bsd.port.mk	(working copy)
@@ -1051,8 +1051,8 @@
  .if empty(FLAVOR) && !empty(.MAKEOVERRIDES:MFLAVOR)
  .error FLAVOR may not be passed empty as a make argument.
  .endif
-# Store env FLAVOR for later
-.if !defined(_FLAVOR)
+# Store cli FLAVOR for later
+.if !defined(_FLAVOR) && defined(.MAKEOVERRIDES) && 
!empty(.MAKEOVERRIDES:MFLAVOR)
  _FLAVOR:=	${FLAVOR}
  .endif
  PORTS_FEATURES+=	FLAVORS
@@ -1492,9 +1492,13 @@
  .  endif
  .endif

-.if !empty(FLAVORS) && empty(FLAVOR)
-FLAVOR=	${FLAVORS:[1]}
+.if !empty(FLAVORS) && empty(_FLAVOR)
+.if empty(PY_FLAVOR)
+IGNORE= Missing FLAVOR definition! Possible flavors: ${FLAVORS} (Usage: 
'make FLAVOR=${FLAVORS:[1]} ${.TARGETS}' e.g.)
+.else
+_FLAVOR:=${PY_FLAVOR}
  .endif
+.endif

  # Reorder FLAVORS so the default is first if set by the port.
  .if empty(_FLAVOR) && !empty(FLAVORS) && !empty(FLAVOR)
@@ -1675,10 +1679,14 @@
  .endif

  .if empty(FLAVOR)
-_WRKDIR=	work
+.ifdef WRKDIRPREFIX
+WRKDIR=${WRKDIRPREFIX}${.CURDIR:S,${PORTSDIR},,}/work
+.endif
  .else
-_WRKDIR=	work-${FLAVOR}
+.ifdef WRKDIRPREFIX
+WRKDIR=${WRKDIRPREFIX}${.CURDIR:S,${PORTSDIR},,}/work-${FLAVOR}
  .endif
+.endif

  WRKDIR?=		${WRKDIRPREFIX}${.CURDIR}/${_WRKDIR}
  BINARY_LINKDIR=	${WRKDIR}/.bin
@@ -2578,7 +2586,6 @@
  PKGREPOSITORYSUBDIR?=	All
  PKGREPOSITORY?=		${PACKAGES}/${PKGREPOSITORYSUBDIR}
  .if exists(${PACKAGES})
-PACKAGES:=	${PACKAGES:S/:/\:/g}
  _HAVE_PACKAGES=	yes
  PKGFILE?=		${PKGREPOSITORY}/${PKGNAME}${PKG_SUFX}
  .else
@@ -3363,19 +3370,19 @@
  # Package

  .if defined(_HAVE_PACKAGES)
-_EXTRA_PACKAGE_TARGET_DEP+= ${PKGFILE}
-_PORTS_DIRECTORIES+=	${PKGREPOSITORY}
+_EXTRA_PACKAGE_TARGET_DEP+= ${PKGFILE:S/:/\:/g}
+_PORTS_DIRECTORIES+=	${PKGREPOSITORY:S/:/\:/g}

-${PKGFILE}: ${WRKDIR_PKGFILE} ${PKGREPOSITORY}
+${PKGFILE:S/:/\:/g}: ${WRKDIR_PKGFILE} ${PKGREPOSITORY:S/:/\:/g}
  	@${LN} -f ${WRKDIR_PKGFILE} ${PKGFILE} 2>/dev/null \
  			|| ${CP} -f ${WRKDIR_PKGFILE} ${PKGFILE}

  .  if ${PKGORIGIN} == "ports-mgmt/pkg" || ${PKGORIGIN} == 
"ports-mgmt/pkg-devel"
-_EXTRA_PACKAGE_TARGET_DEP+=	${PKGLATESTREPOSITORY}
-_PORTS_DIRECTORIES+=	${PKGLATESTREPOSITORY}
-_EXTRA_PACKAGE_TARGET_DEP+=	${PKGLATESTFILE}
+_EXTRA_PACKAGE_TARGET_DEP+=	${PKGLATESTREPOSITORY:S/:/\:/g}
+_PORTS_DIRECTORIES+=	${PKGLATESTREPOSITORY:S/:/\:/g}
+_EXTRA_PACKAGE_TARGET_DEP+=	${PKGLATESTFILE:S/:/\:/g}

-${PKGLATESTFILE}: ${PKGFILE} ${PKGLATESTREPOSITORY}
+${PKGLATESTFILE:S/:/\:/g}: ${PKGFILE:S/:/\:/g} 
${PKGLATESTREPOSITORY:S/:/\:/g}
  	${INSTALL} -l rs ${PKGFILE} ${PKGLATESTFILE}
  .  endif



Thanks,

-harry



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?a66d6e12-d4d7-9a4a-1dfa-0dd7db6a000b>