Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Solved how to get a list of installed pkgs w highest vers#
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
Waterdevil
n00b
n00b


Joined: 15 Aug 2017
Posts: 61

PostPosted: Wed Dec 06, 2017 4:33 pm    Post subject: Solved how to get a list of installed pkgs w highest vers# Reply with quote

Hello World,

how can I get a list of all installed (unstable) packages with the highest stable version number?

many thanks
_________________
_____________________
Aut semper aut numquam

Main-Sys: LianLi modded Big Cube 8000,AsrockZ97,i7,MEM:32G,LSI 9305,HDD:102TB(16x3T,8x6T,4x1T,1x0,5Tm.2,4x0,5TSSD),nVidia GTX1060,NIC:2x10GbSFP+,Fans:20,PSU:1200W+500W,UPS:APC1500VA,FibreChan,Tandberg LTO-6


Last edited by Waterdevil on Thu Dec 07, 2017 12:32 pm; edited 1 time in total
Back to top
View user's profile Send private message
helecho
Apprentice
Apprentice


Joined: 26 Dec 2016
Posts: 236

PostPosted: Thu Dec 07, 2017 7:54 am    Post subject: Reply with quote

I'm not sure I understood the question correctly. I suppose you are looking the latest stable versions for unstable packages installed on your system.

We could probably get a result using tools (packages.gentoo.org) or methods. I tried using the search utility of pkgcore but I failed (feature not implemented or maybe the ignorance).
I do not have enough experience but I will have used eix. Sets (man portage "sets.conf" - man emerge) could be a solution?

Edit: eix --installed-unstable # eix -c --installed-unstable

helecho
Back to top
View user's profile Send private message
Waterdevil
n00b
n00b


Joined: 15 Aug 2017
Posts: 61

PostPosted: Thu Dec 07, 2017 9:39 am    Post subject: Reply with quote

Thank you - this command gives the stable version in green if there is one.

[?] dev-libs/d0_blind_id (1.0{tbz2}@06.12.2017 -> 0.5): Blind-ID library for user identification using RSA blind signatures
_________________
_____________________
Aut semper aut numquam

Main-Sys: LianLi modded Big Cube 8000,AsrockZ97,i7,MEM:32G,LSI 9305,HDD:102TB(16x3T,8x6T,4x1T,1x0,5Tm.2,4x0,5TSSD),nVidia GTX1060,NIC:2x10GbSFP+,Fans:20,PSU:1200W+500W,UPS:APC1500VA,FibreChan,Tandberg LTO-6
Back to top
View user's profile Send private message
helecho
Apprentice
Apprentice


Joined: 26 Dec 2016
Posts: 236

PostPosted: Thu Dec 07, 2017 11:52 am    Post subject: Reply with quote

Finally, I've found an incomplete solution using pkgcore. Edit: the proposed solution is not suitable!

upkg:
#!/bin/bash                                                                     

pquery -I --attr keywords --attr category --attr package --attr fullver |
    sed -rn -e '/~amd64 +/ s/.* (category=.*)/\1/p' |
    sed -rn -e 's/category="(.*)" package="(.*)" fullver="(.*)"/=\1\/\2\-\3/p' |
    tr '\n' ' ' > /tmp/pkg.tmp

pquery -v --color y --attr keywords $(cat /tmp/pkg.tmp) > /tmp/pkg
rm /tmp/pkg.tmp
less /tmp/pkg


Code:
chmod +x upkg ; mv upkg /usr/local/bin
upkg


We got a result like eix -c --installed-testing but I notice that the execution using upkg seems faster. It's more tricky because of sed.

Edit: qgrep is faster than upkg ... qgrep -Jl -e "~amd64 \+"

I also notice a wrong "keyworded package" reading the output produced by the pkgcore utilities but I do not know the reason (answer in this topic).
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming 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