From owner-svn-src-head@freebsd.org Tue Mar 12 11:48:18 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7E9D152E3F6; Tue, 12 Mar 2019 11:48:17 +0000 (UTC) (envelope-from freebsd@omnilan.de) Received: from mx0.gentlemail.de (mx0.gentlemail.de [IPv6:2a00:e10:2800::a130]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 54AD98B052; Tue, 12 Mar 2019 11:48:17 +0000 (UTC) (envelope-from freebsd@omnilan.de) Received: from mh0.gentlemail.de (mh0.gentlemail.de [78.138.80.135]) by mx0.gentlemail.de (8.14.5/8.14.5) with ESMTP id x2CBmFBQ064345; Tue, 12 Mar 2019 12:48:15 +0100 (CET) (envelope-from freebsd@omnilan.de) Received: from titan.inop.mo1.omnilan.net (s1.omnilan.de [217.91.127.234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mh0.gentlemail.de (Postfix) with ESMTPSA id 0449D40F; Tue, 12 Mar 2019 12:48:14 +0100 (CET) Subject: Re: svn commit: r345057 - head/share/man/man7 To: Alexey Dokuchaev Cc: Mateusz Piotrowski <0mp@freebsd.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201903120927.x2C9Rc1B017630@repo.freebsd.org> <79a9c91f-72c2-ef18-e341-4ed471fb787c@omnilan.de> <20190312105025.GA54467@FreeBSD.org> From: Harry Schmalzbauer Organization: OmniLAN Message-ID: Date: Tue, 12 Mar 2019 12:48:14 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20190312105025.GA54467@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Greylist: ACL 130 matched, not delayed by milter-greylist-4.2.7 (mx0.gentlemail.de [78.138.80.130]); Tue, 12 Mar 2019 12:48:15 +0100 (CET) X-Milter: Spamilter (Reciever: mx0.gentlemail.de; Sender-ip: 78.138.80.135; Sender-helo: mh0.gentlemail.de; ) X-Rspamd-Queue-Id: 54AD98B052 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.95)[-0.955,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Mar 2019 11:48:18 -0000 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