fixes #31627 spack.mirror.get_all_versions now uses the package class instead of the package object in its implementation. Ensure spec is concrete before staging for mirrors