Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Find which layman overlays you're actually using
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
salfter
Tux's lil' helper
Tux's lil' helper


Joined: 02 Jan 2003
Posts: 89

PostPosted: Tue Mar 12, 2019 5:43 pm    Post subject: Find which layman overlays you're actually using Reply with quote

Sometimes you add an overlay to grab something that's not in Portage. Time goes on...either you remove the package, it finds its way into Portage, or whatever...you're still pulling updates to an overlay you don't know that you're not using anymore.

This little bit of shell script will show how many ebuilds you're currently using in each overlay:

Code:
for i in `(cd /var/lib/layman/ && find -maxdepth 1 -type d | sed "s/.\///;s/\.//" | grep -v ^\$)`; do echo -n $i\ ; equery list -F \$repo \* | grep $i | wc -l; done
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 31355
Location: here

PostPosted: Tue Mar 12, 2019 5:53 pm    Post subject: Reply with quote

With eix
Code:
$ eix --installed-from-overlay <overlay_name>

_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 6920

PostPosted: Tue Mar 12, 2019 9:53 pm    Post subject: Reply with quote

More primitively:
Code:
grep -v gentoo /var/db/pkg/*/*/repository
Back to top
View user's profile Send private message
Tony0945
Watchman
Watchman


Joined: 25 Jul 2006
Posts: 5127
Location: Illinois, USA

PostPosted: Tue Mar 12, 2019 10:04 pm    Post subject: Reply with quote

Ah! But the OP's script gives counts!
Code:
tony@MSI ~ $ for i in `(cd /var/lib/layman/ && find -maxdepth 1 -type d | sed "s/.\///;s/\.//" | grep -v ^\$)`; do echo -n $i\ ; equery list -F \$repo \* | grep $i | wc -l; done
oldgentoo 34
mybuilds 8
redhat-free 2
nosystemd-overlay 4
bobwya 7
np-hardass-overlay 0
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22871

PostPosted: Wed Mar 13, 2019 2:12 am    Post subject: Re: Find which layman overlays you're actually using Reply with quote

salfter wrote:
Code:
for i in `(cd /var/lib/layman/ && find -maxdepth 1 -type d | sed "s/.\///;s/\.//" | grep -v ^\$)`; do echo -n $i\ ; equery list -F \$repo \* | grep $i | wc -l; done
You don't need grep -v. You can make sed delete the unwanted entries, or you could tell find not to generate them.
Code:
find /var/lib/layman/ -mindepth 1 -maxdepth 1 -type d -printf '%P\n' | grep -F -x -f - <( equery list -o -F '$repo' '*' ) | sort | uniq -c
Back to top
View user's profile Send private message
proteusx
Guru
Guru


Joined: 21 Jan 2008
Posts: 340

PostPosted: Wed Mar 13, 2019 11:04 am    Post subject: Reply with quote

Code:
for i in $(layman -l | cut -d\  -f3); do echo $i $(qlist -R $i| wc -l); done

EDIT.
One may include the local overlay too.
Code:
for i in $(layman -l | cut -d\  -f3) my-overlays; do echo $i $(equery a repository $i| wc -l); done
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20523

PostPosted: Fri Mar 15, 2019 3:28 am    Post subject: Reply with quote

One more for the pile...

It doesn't deliniate layman, but it is much faster for me than either equery or eix.
Code:
qlist -R |cut -d: -f3- |sort |uniq -c


And for details (category, package name, version, slot) about a particular repository:
Code:
qlist -RSv |grep '::example_repository'


man qlist wrote:
-S, --slots
Display installed packages with slots (use twice for subslots).

-R, --repo
Display installed packages with repository the ebuild originated from. This flag implies -I.

-v, --verbose
When used with -I, print the package version next to name. When listing the package contents, a single -v displays symlinks with
an arrow (->) to their target. Two or more -v adds colour to the entries and prints like -I before the listing.
Code:
$ qfile /usr/bin/qlist
app-portage/portage-utils (/usr/bin/qlist)

_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
proteusx
Guru
Guru


Joined: 21 Jan 2008
Posts: 340

PostPosted: Fri Mar 15, 2019 8:04 am    Post subject: Reply with quote

pjp wrote:

It doesn't deliniate layman, but it is much faster for me than either equery or eix.
Code:
qlist -R |cut -d: -f3- |sort |uniq -c

This trumps them all. Excellent.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum