utils/generate-db-build.sh: improve error reporting and restructure code a bit.
utils/generate-db-build.sh: initial support for split packages.

Symlinks are created in build tree for each split package name, pointing to the package base directory.