pkg icon indicating copy to clipboard operation
pkg copied to clipboard

EVENT_PIPE emits bad json on INFO_INSTALL_FINISHED

Open einsibjarni opened this issue 2 years ago • 2 comments

We use EVENT_PIPE in an ansible module when upgrading packages. Recently we got an error and tracked it down to this json snippet:

{ "type": "INFO_INSTALL_FINISHED", "data": { "pkgname": "php81-sysvsem", "pkgversion": "8.1.17", "message": "[{"message":"This file has been added to automatically load the installed extension:\n/usr/local/etc/php/ext-20-sysvsem.ini","type":"install"}]"}}

Info:

$ freebsd-version
13.1-RELEASE

$ pkg -v
1.19.1

einsibjarni avatar Mar 28 '23 23:03 einsibjarni

Removing the quotes around the array in "message" like so:

{ "type": "INFO_INSTALL_FINISHED", "data": { "pkgname": "php81-sysvsem", "pkgversion": "8.1.17", "message": [{"message":"This file has been added to automatically load the installed extension:\n/usr/local/etc/php/ext-20-sysvsem.ini","type":"install"}]}}

makes the json legal

einsibjarni avatar Mar 28 '23 23:03 einsibjarni