pkg
pkg copied to clipboard
EVENT_PIPE emits bad json on INFO_INSTALL_FINISHED
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
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