packages/pkgbuild: add _pkgbuild_vcs_get_legacy, remove similar code pieces.

_pkgbuild_vcs_get_legacy: get legacy repo name if it exists, otherwise return 1.
packages/pkgbuild: pkgbuild_update_vcs: improve code (use $pkgname instead of basename trickery).
packages/pkgbuild: pkgbuild_sanitize: change API, $1 is now full path to the working directory.
packages/pkgbuild: pkgbuild_sources: improve naming, also report legacy-style repositories.