pkgng/pkgng — pull request #137 by yuripankov (2012-02-05 01:09:16+00:00)
Title: Fix post-deinstall scripts

- Turn check in sbuf_get into assertion and make sure we don't pass NULL sbuf to sbuf_get in pkg_vget. This
makes sure that we know where and why sbuf can be NULL.
- Fix a braino in libpkg/pkg.c - sbuf_done is only used to check if sbuf is finished, we obviously want
sbuf_finish there. This was breaking post-deinstall scripts registration, adding junk to them. Simple
testcase:
pkg-plist:
@unexec echo uninstall
@unexec /usr/local/bin/gtk-update-icon-cache -q -f /usr/local/share/icons/hicolor 2>/dev/null || /usr/bin/true
$ pkg query %S testport
echo uninstall
/usr/local/bin/gtk-update-icon-cache -q -f /usr/local/share/icons/hicolor 2>/dev/null || /usr/bin/true
▒▒▒▒▒▒▒▒▒▒x
$