Structure of versions_json

kristian

Verified User
Joined
Nov 4, 2005
Messages
442
Location
Norway
Hi!

I'm looking to integrate the output of ./build versions_json into a script to perform some automatic handling and reporting of available updates. At first glance, the structure looks fairly simple, e.g.

JSON:
# ./build versions_json
{
    "exim_conf": {
        "name": "exim.conf",
        "current": "4.5.33",
        "offered": "4.5.35"
    }
}

So I could expect the key exim_conf to be one available update, and similar if there were more entries.

However, on one of my older servers, I noticed this output:

JSON:
# ./build versions_json
{
    "exim_conf": {
        "name": "exim.conf",
        "current": "4.5.33",
        "offered": "4.5.35"
    },
    "security": {
        "MariaDB EOL": {
            "name": "MariaDB is EOL",
            "description": "MariaDB version on the system is end of life, please upgrade",
            "url": "https://endoflife.software/applications/databases"
        }
    }
}

At this point, my logic fails, since security isn't a piece of software that can be updated.

So my question is: Is there any documentation describing this json output, and all the different things it might contain, so that I can take them into account when parsing it?
 
"security" is the only exception there, just skip that element.
 
Thanks for that confirmation. For any future additions to this data structure, I think it might be a good idea to define this structure better, so we don't end up with a long list of exceptions. Perhaps move the available upgrades into subelements of "upgrades" or similar?
 
Thanks for that confirmation. For any future additions to this data structure, I think it might be a good idea to define this structure better, so we don't end up with a long list of exceptions. Perhaps move the available upgrades into subelements of "upgrades" or similar?
Yes, we did not want to change it as we don’t know how many users use the current structure.
 
To avoid issues during a transition period, maybe add a versions_json_v2 with the new structure, and leave the old one as-is. That should give people enough time to test and update any tools they may use.
 
Back
Top