Skip to content

Print json#113

Draft
Artturin wants to merge 2 commits intotrofi:mainfrom
Artturin:jsonprint
Draft

Print json#113
Artturin wants to merge 2 commits intotrofi:mainfrom
Artturin:jsonprint

Conversation

@Artturin
Copy link
Copy Markdown
Contributor

@Artturin Artturin commented Sep 8, 2024

Looks like this

{"attribute":["adwaita-icon-theme"],"nixpkgs_version":["46.0"],"repology_name":"adwaita-icon-theme","repology_version":"46.2"}
{"attribute":["alex","haskellPackages.alex"],"nixpkgs_version":["3.4.0.1"],"repology_name":"alex","repology_version":"3.5.1.0"}
{"attribute":["alsa-lib","alsa-lib-with-plugins"],"nixpkgs_version":["1.2.11"],"repology_name":"alsa-lib","repology_version":"1.2.12"}
{"attribute":["alsa-ucm-conf"],"nixpkgs_version":["1.2.11"],"repology_name":"alsa-ucm-conf","repology_version":"1.2.12"}
{"attribute":["libaom"],"nixpkgs_version":["3.9.1"],"repology_name":"aom","repology_version":"3.10.0"}
{"attribute":["libapparmor"],"nixpkgs_version":["4.0.1"],"repology_name":"apparmor","repology_version":"4.0.3"}
{"attribute":["appstream-glib"],"nixpkgs_version":["0.8.2"],"repology_name":"appstream-glib","repology_version":"0.8.3"}
{"attribute":["apr"],"nixpkgs_version":["1.7.4"],"repology_name":"apr","repology_version":"1.7.5"}
{"attribute":["audit"],"nixpkgs_version":["4.0"],"repology_name":"audit","repology_version":"4.0.2"}
{"attribute":["python312Packages.autopep8"],"nixpkgs_version":["2.0.4-unstable-2023-10-27"],"repology_name":"autopep8","repology_version":"2.3.1"}
{"attribute":["aws-c-auth"],"nixpkgs_version":["0.7.25"],"repology_name":"aws-c-auth","repology_version":"0.7.29"}
{"attribute":["aws-c-cal"],"nixpkgs_version":["0.6.15"],"repology_name":"aws-c-cal","repology_version":"0.7.4"}
{"attribute":["aws-c-common"],"nixpkgs_version":["0.9.27"],"repology_name":"aws-c-common","repology_version":"0.9.28"}
{"attribute":["aws-c-http"],"nixpkgs_version":["0.8.2"],"repology_name":"aws-c-http","repology_version":"0.8.8"}

Just quick one, this can be improved with a dedicated struct.
@Artturin
Copy link
Copy Markdown
Contributor Author

Artturin commented Sep 8, 2024

Submitting this easy way first in case I don't come up with a better way to do it

@trofi
Copy link
Copy Markdown
Owner

trofi commented Sep 8, 2024

My suggestions are:

  • enable json output based on a commandline flag, say --output=json / --output-tty (existing output)
  • consider dumping the output as a single json object: that way it might be easier to dissect with jq and to add things like unhandled attributes as separate fields. it might require slightly rearranging top-level loop that gathers the results and outputs them

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants