Suggestions for improvements of portindex2json

Mojca Miklavec mojca at macports.org
Mon Mar 19 08:40:27 UTC 2018


Dear Joshua,

I would like to suggest making some improvements to portindex2json

1. Use a list for categories

Change
    "categories" : "aqua devel",
into
    "categories" : ["aqua", "devel"],

2. Improve representation of variants

At the moment it is a plain list:
    "variants" : "python27 qt4 qt5 debug universal",
It would be nice to make that a list and mark default ones, but that's
a lower priority.

3. When long_description is defined as
    long_description ${description}
then the braces in json file remain, but they should be removed. Example:

    "portdir"          : "aqua/ShiftIt",
    "description"      : "Managing windows size and position in OS X",
    "long_description" : "{Managing windows size and position in OS X}",

4. It would be nice to improve the field for maintainers.

At the moment it is a not-too-trivial-to-parse mixture of
    "{a @a} b {@c c} @d example.com:e openmaintainer"

Could we turn that into something like the example below?

    "maintainers": [
        {"github": "a", "name": "a", "domain": "macports.org"},
        {"name": "b", "domain": "macports.org"},
        {"github": "c", "name": "c", "domain": "exmaple.com"},
        {"github": "d"}
    ],
    "open_maintainer": "true",

and simply skip "nomaintainer" (just leave the array empty).

5. Dependencies and licences could be improved as well, but I'm not
yet sure how to properly encode the licences (sometimes it "one
licence or the other", sometimes it's a special keyword meaning "it's
ok to build despite the licence saying otherwise"). Fixing the list of
dependencies is a slightly lower priority, but it could be converted
into a list to start with.

6. There are some encoding/escaping problems that Aljaž had problems
with (maybe in cases where description contains quotation marks), but
I forgot where exactly that was.

We would like to use the json file at various places and it would help
a lot if it was slightly better structured without a need to parse
things in the program that's reading json input.


I have an additional feature request though. Would it be feasible to
get json output when running portindex just for the few ports that
were newly added to PortIndex? Or perhaps specify for which ports we
want to get the json file?

Thank you very much,
    Mojca

PS: I started playing with the code a bit, but I'm a total newbie with
respect to Tcl and I would like to get feedback / what we agree to
achieve before I start doing changes that won't be "accepted". I also
wouldn't mind if someone else would implement the changes :) :) :)


More information about the macports-dev mailing list