Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 02 Nov 2020 11:28:15 +0000
From:      Mike Clarke <jmc-freebsd2@milibyte.co.uk>
To:        freebsd-questions@freebsd.org
Cc:        Morten Bo Johansen <listmail@mbjnet.dk>
Subject:   Re: Xorg broken after upgrade to 12.2
Message-ID:  <4985203.ppSauYnzuk@curlew>
In-Reply-To: <slrnrpvbc9.13u.listmail@smtp.mbjnet.dk>
References:  <slrnrpu43n.qkd.mbj@smtp.mbjnet.dk> <CAM8r67BaJr%2Bik7G_fUEFqoavPiS17ocwEnBQu_cQu_4Qk1uO2w@mail.gmail.com> <slrnrpvbc9.13u.listmail@smtp.mbjnet.dk>

next in thread | previous in thread | raw e-mail | index | archive | help
On Monday, 2 November 2020 06:56:09 GMT Morten Bo Johansen via freebsd-
questions wrote:

> Is there a command that will show me which packages I have
> installed from the ports collection?

You can run 'pkg info --annotations pkg-name'. If a package has been 
installed from a repository it will be indicated there. E.g. for firefox 
installed from packages I have:

curlew:/home/mike% pkg info --annotations firefox 
firefox-81.0_2,2: 
       FreeBSD_version: 1201000 
       cpe            : cpe:2.3:a:mozilla:firefox:81.0:::::freebsd12:x64:2 
       no_provide_shlib: yes 
       repo_type      : binary 
       repository     : FreeBSD

But for lame installed from ports I have:

curlew:/home/mike% pkg info --annotations lame 
lame-3.100_2: 
       FreeBSD_version: 1200086

With a bit of scripting you could iterate through all your packages testing 
for the presence or absence of a 'repository' line in the 'Annotations' 
sections. Something like this might do what you need.

#!/bin/sh 
for pkg in `pkg info -a | awk '{print $1}'` 
do 
       pkg info -A $pkg | grep -q repository 
       if [ 0 -ne $? ] 
       then 
               echo $pkg built from ports 
       fi 
done

-- 
Mike Clarke







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