Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
parseable representation of portage tree
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
_Razorblade_
n00b
n00b


Joined: 01 Jan 2004
Posts: 33

PostPosted: Sat Jan 18, 2025 3:12 pm    Post subject: parseable representation of portage tree Reply with quote

I'm looking for a parseable representation of the portage tree, ideally as json. The goal is to parse it using renovate custom datasource to find version changes when running renovate as bot.

If there is no export yet, which (portage or 3rd party) tool could be used to easily generate such a representation?

I looked at soko (which generates packages.gentoo.org) and it seems to be doing a great job of parsing ebuilds and updating a backend database - it just has no usable output for me.
Back to top
View user's profile Send private message
Genone
Retired Dev
Retired Dev


Joined: 14 Mar 2003
Posts: 9625
Location: beyond the rim

PostPosted: Sat Jan 18, 2025 3:47 pm    Post subject: Reply with quote

Well, if I understand you correctly you just need an adapter to make the soko database available via HTTPS so it can be accessed by renovate (disclaimer: I'm not familiar with any of those tools).
Soko seems to use a PostgreSQL database, so there is a chance that something like that already exists in some form. And postgreSQL itself seems to have some support to format query results as JSON output. So shouldn't be too difficult to build such an adapter yourself if you have some basic knowledge of SQL.
Back to top
View user's profile Send private message
_Razorblade_
n00b
n00b


Joined: 01 Jan 2004
Posts: 33

PostPosted: Mon Jan 20, 2025 3:15 pm    Post subject: Reply with quote

I'm looking for a source that can be queried as part of a CI pipeline, i.e. a daily check if the available version of a specific application has changed. Setting up an (always running) Postgres server for this purpose seems to be a bit of an overkill. Maybe looking at soko was misleading - I was just asking myelf what is being used to serve packages.gentoo.org, because that basically contains the information I need. Maybe I'll look into parsing the html response if no other idea comes up.
Back to top
View user's profile Send private message
logrusx
Advocate
Advocate


Joined: 22 Feb 2018
Posts: 2675

PostPosted: Mon Jan 20, 2025 3:29 pm    Post subject: Reply with quote

I think eix can check for available updates but I'm missing the syntax for that. I glanced at its man page and found --upgrade or -u which sounds like that. Further more you can alter its default output to something more convenient for further processing.

Best Regards,
Georgi
Back to top
View user's profile Send private message
Ralphred
l33t
l33t


Joined: 31 Dec 2013
Posts: 711

PostPosted: Mon Jan 20, 2025 5:25 pm    Post subject: Reply with quote

logrusx wrote:
I think eix can check for available updates

Eix is an amazing piece of software, and yes it can. I've already written an output parser for eix in python (it doesn't output json, just creates pyqt objects for display), it's very well documented in it's man page and very flexible
If you are only looking at one package though emerge -pu --nodeps <atom> is an easier starting point.

BUT, using eix --upgrade and the emerge command above are both predicated on you having that piece of software installed to produce that output.
Back to top
View user's profile Send private message
logrusx
Advocate
Advocate


Joined: 22 Feb 2018
Posts: 2675

PostPosted: Mon Jan 20, 2025 5:40 pm    Post subject: Reply with quote

Ralphred wrote:

BUT, using eix --upgrade and the emerge command above are both predicated on you having that piece of software installed to produce that output.


eix-update prints a nice report what's new. It's also part of eix-sync, so you can get the report on sync.

Best Regards,
Georgi
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