"return result ? PKGMGR_END_SUCCESS : PKGMGR_END_FAILURE;" can be in a separate aux function in a nameless namespace