Fix installation of packages with dots in pkg name

This commit fixes a regression which caused packages with dots in the
package name to fail to install. Resolves #8614.
Merge pull request #8921 from terminalmage/issue8614

Fix installation of packages with dots in pkg name