Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 May 2019 13:17:56 -0500
From:      Bob Willcox <bob@immure.com>
To:        "Matthew D. Fuller" <fullermd@over-yonder.net>
Cc:        freebsd-ports@freebsd.org
Subject:   Re: portupgrade + FLAVORS
Message-ID:  <20190506181756.GK44790@rancor.immure.com>
In-Reply-To: <20190408015157.GE6019@over-yonder.net>
References:  <20190408015157.GE6019@over-yonder.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Apr 07, 2019 at 08:51:57PM -0500, Matthew D. Fuller wrote:
> 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.

> --- 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
>  

> _______________________________________________
> freebsd-ports@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-ports
> To unsubscribe, send any mail to "freebsd-ports-unsubscribe@freebsd.org"

Hi Mathew,

Thanks for the flavors patch to portupgrade. As with some others here it is
still my preferred tool for keeping my ports up-to-date.

Any word on when/if your patch will be integraded into the port proper?

Thanks again,
Bob


-- 
Bob Willcox    | "The only way to get rid of temptation is to yield to it...
bob@immure.com | I can resist everything but temptation."
Austin, TX     |     - Oscar Wilde



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