From owner-freebsd-ports@freebsd.org Mon Apr 8 01:52:08 2019 Return-Path: Delivered-To: freebsd-ports@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 6D67C1570D71 for ; Mon, 8 Apr 2019 01:52:08 +0000 (UTC) (envelope-from fullermd@over-yonder.net) Received: from mail.infocus-llc.com (mail.infocus-llc.com [IPv6:2604:3a00:2:1::2:13]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 50955824C0 for ; Mon, 8 Apr 2019 01:52:07 +0000 (UTC) (envelope-from fullermd@over-yonder.net) Received: from draco.over-yonder.net (tunnel180062-pt.tunnel.tserv8.dal1.ipv6.he.net [IPv6:2001:470:1f0e:11ae::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.tarragon.infocus-llc.com (Postfix) with ESMTPSA id 44cthG5QHQzSr3 for ; Sun, 7 Apr 2019 20:51:58 -0500 (CDT) Received: by draco.over-yonder.net (Postfix, from userid 100) id 44cthF5hZWzkPn; Sun, 7 Apr 2019 20:51:57 -0500 (CDT) Date: Sun, 7 Apr 2019 20:51:57 -0500 From: "Matthew D. Fuller" To: freebsd-ports@freebsd.org Subject: portupgrade + FLAVORS Message-ID: <20190408015157.GE6019@over-yonder.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="HlL+5n6rz5pIUxbD" Content-Disposition: inline X-Editor: vi X-OS: FreeBSD User-Agent: Mutt/1.11.4 (2019-03-13) X-Rspamd-Queue-Id: 50955824C0 X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of fullermd@over-yonder.net designates 2604:3a00:2:1::2:13 as permitted sender) smtp.mailfrom=fullermd@over-yonder.net X-Spamd-Result: default: False [-0.82 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-0.57)[-0.573,0]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; TO_MATCH_ENVRCPT_ALL(0.00)[]; HAS_ATTACHMENT(0.00)[]; MIME_GOOD(-0.10)[multipart/mixed,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-ports@freebsd.org]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-0.99)[-0.995,0]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_NONE(0.00)[]; NEURAL_SPAM_SHORT(0.07)[0.068,0]; MX_GOOD(-0.01)[mail.infocus-llc.com,lyra.over-yonder.net]; CTYPE_MIXED_BOGUS(1.00)[]; DMARC_NA(0.00)[over-yonder.net]; RCVD_TLS_LAST(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:+]; ASN(0.00)[asn:33069, ipnet:2604:3a00::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; IP_SCORE(-0.01)[country: US(-0.06)] X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Apr 2019 01:52:08 -0000 --HlL+5n6rz5pIUxbD Content-Type: text/plain; charset=us-ascii Content-Disposition: inline For any portupgrade users still out there wishing for FLAVOR support, I have patches to add it. I've been running them here locally for a few weeks without incident (apart from an extra upgrade or two actually working without manual intervention/resort to portmaster, that is). Dropping the attached patch into $PORTS/ports-mgmt/portupgrade/files/patch-flavors and rebuilding it is a simple shortcut to getting it in place. I haven't done any testing of using portupgrade with pre-built packages (is there even any reason to post-pkg?), or using portinstall (never saw the point), but it seems to handle the upgrading path just fine. Also sitting in a PR upstream at https://github.com/freebsd/portupgrade/pull/72 -- Matthew Fuller (MF4839) | fullermd@over-yonder.net Systems/Network Administrator | http://www.over-yonder.net/~fullermd/ On the Internet, nobody can hear you scream. --HlL+5n6rz5pIUxbD Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=patch-flavors --- bin/portupgrade.orig 2018-03-09 18:59:29 UTC +++ bin/portupgrade @@ -1147,6 +1147,11 @@ def get_make_args(origin, pkgname = nil) else args = $make_args.split(' ') end + + if flavor = origin[/@(.+)$/, 1] + args << 'FLAVOR=' + flavor + end + quoted = 0 n = 0 is_quoted = false --- lib/pkgtools/pkgdb.rb.orig 2018-03-09 18:59:29 UTC +++ lib/pkgtools/pkgdb.rb @@ -425,10 +425,20 @@ class PkgDB @installed_pkgs = [] @installed_ports = [] @db = {} + + flavors = {} + pkg_flavors = xbackquote(PkgDB::command(:pkg), 'annotate', '-Sa', + 'flavor').split("\n") + pkg_flavors.each do |line| + pkg, flavor = line.sub(/: Tag: flavor Value: /, ':').split(':') + flavors[pkg] = flavor + end + pkg_origins = xbackquote(PkgDB::command(:pkg), 'query', '%n-%v %o').split("\n") pkg_origins.each do |line| pkg, origin = line.split(' ') @installed_pkgs << pkg + origin << '@' + flavors[pkg] if flavors[pkg] add_origin(pkg, origin) end @installed_pkgs.freeze --- lib/pkgtools/portsdb.rb.orig 2018-03-09 18:59:29 UTC +++ lib/pkgtools/portsdb.rb @@ -325,6 +325,7 @@ class PortsDB end def portdir(port) + port = port.sub(/@.*$/, '') File.join(ports_dir, port) end --HlL+5n6rz5pIUxbD--