Fix gen-tarball.sh for local/remote repos
We have to set the properties of a package in a second step so that
passing a repo URL/path instead of a package name to the script works.
(cherry picked from commit ee6e565679b6671da057439c68531dd240358f87)