View previous topic :: View next topic |
Author |
Message |
_Razorblade_ n00b
Joined: 01 Jan 2004 Posts: 33
|
Posted: Sat Jan 18, 2025 3:12 pm Post subject: parseable representation of portage tree |
|
|
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 |
|
|
Genone Retired Dev
Joined: 14 Mar 2003 Posts: 9625 Location: beyond the rim
|
Posted: Sat Jan 18, 2025 3:47 pm Post subject: |
|
|
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 |
|
|
_Razorblade_ n00b
Joined: 01 Jan 2004 Posts: 33
|
Posted: Mon Jan 20, 2025 3:15 pm Post subject: |
|
|
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 |
|
|
logrusx Advocate
Joined: 22 Feb 2018 Posts: 2675
|
Posted: Mon Jan 20, 2025 3:29 pm Post subject: |
|
|
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 |
|
|
Ralphred l33t
Joined: 31 Dec 2013 Posts: 711
|
Posted: Mon Jan 20, 2025 5:25 pm Post subject: |
|
|
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 |
|
|
logrusx Advocate
Joined: 22 Feb 2018 Posts: 2675
|
Posted: Mon Jan 20, 2025 5:40 pm Post subject: |
|
|
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 |
|
|
|