Whilst the existing Packages index file may make sense for the current portage codebase, it's not the friendliest interchange format for searching/filtering. Formatting into a JSON or YAML struct should make for much easier/quicker parsing with python Dictionaries, and in other tools/languages. This could make filtering/indexing using such tools as emaint much faster (eg. for cleaning functions), especially when binpkg-multi-instance is in use, and multiple versions of a pkg-version may be present.
JSON/YAML would make it really painful for shell parsing.
(In reply to Fedja Beader from comment #1) > JSON/YAML would make it really painful for shell parsing. The idea wouldn't necessarily be to replace the existing format (since we all know how much people love their shell scripts .. ;) ]
Created attachment 603842 [details] script to convert ${PKGDIR}/Packages file to JSON $ python ./packages-to-json.py -h usage: packages-to-json.py [-h] [input_file] convert ${PKGDIR}/Packages file to JSON positional arguments: input_file default is stdin optional arguments: -h, --help show this help message and exit
(In reply to Zac Medico from comment #3) > Created attachment 603842 [details] > script to convert ${PKGDIR}/Packages file to JSON > That's ..uh .. beautiful. Merge pl0x ?! :P