match build_database function in smartos-live

joyent/smartos-live#339 alters the build_database function
which was copied into create-smf-repo

This commit keeps the two versions in sync.

This should only be merged if/when joyent/smartos-live#339 gets merged or otherwise implemented.