Re: Can `pkg prime-origins` be "trained" to pick up flavors?

From: DutchDaemon - FreeBSD Forums Administrator <DutchDaemon_at_FreeBSD.org>
Date: Tue, 02 Jul 2024 12:55:54 UTC
On 2-7-2024 14:50, Tomoaki AOKI wrote:
> 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}" || \
>

No problem I caught that one pretty soon ;)