Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 2 Jul 2024 21:50:28 +0900
From:      Tomoaki AOKI <junchoon@dec.sakura.ne.jp>
To:        DutchDaemon - FreeBSD Forums Administrator <DutchDaemon@FreeBSD.org>
Cc:        ports@freebsd.org
Subject:   Re: Can `pkg prime-origins` be "trained" to pick up flavors?
Message-ID:  <20240702215028.c9038518cef1d323a8042c5a@dec.sakura.ne.jp>
In-Reply-To: <1144fd28-c9d5-43be-b3ce-77a8e0051634@FreeBSD.org>
References:  <d5795604-0255-4992-8ba2-189fe6318134@FreeBSD.org> <20240702022215.86f678352bf5d7c6bf3dea4d@dec.sakura.ne.jp> <748eaf90-6c2d-41e3-8334-88458c21b7c3@FreeBSD.org> <20240702064448.1072c2a31ba44ed483730d0b@dec.sakura.ne.jp> <20240702075204.2c10d58cb4402523a8af9732@dec.sakura.ne.jp> <1144fd28-c9d5-43be-b3ce-77a8e0051634@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 2 Jul 2024 13:21:30 +0200
DutchDaemon - FreeBSD Forums Administrator <DutchDaemon@FreeBSD.org>
wrote:

> On 2-7-2024 00:52, Tomoaki AOKI wrote:
> > Script below would work for you.
> > for port in $( /usr/local/sbin/pkg prime-origins | sort -u )
> > do
> > flavor=$( /usr/local/sbin/pkg info -A "${port}" | \
> > /usr/bin/grep "flavor" | /usr/bin/awk '{print $NF}' | \
> > /usr/bin/grep -v "default" )
> > [ "x${flavor}" = "x" ] && echo "${port}" || \
> >    for flvr in ${flavor}
> >    do
> >      echo -n ${flvr} ; [ "x${flvr}" = "x" ] && echo "${port}" || \
> >      echo "${port}@${flvr}"
> >    done
> > done
> 
> 
> I don't think I have anything multi-flavored anywhere, but good catch. 
> Thanks!

Ah, sorry! Forgot to remove debug echo.

echo -n ${flvr} ; [ "x${flvr}" = "x" ] && echo "${port}" || \

should be as below.

[ "x${flvr}" = "x" ] && echo "${port}" || \


-- 
Tomoaki AOKI    <junchoon@dec.sakura.ne.jp>



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