diff --git a/bin/spack b/bin/spack
index efa1ccc281bfeb6ad817329d1a5e04a3773e1a72..18fd1f0f34b7a397a5eef6d7e2540d25fc2fb552 100755
--- a/bin/spack
+++ b/bin/spack
@@ -113,8 +113,8 @@ def main():
 
     spack.spack_working_dir = working_dir
     if args.mock:
-        from spack.packages import PackageFinder
-        spack.db.swap(PackageFinder(spack.mock_packages_path))
+        from spack.repository import RepoPath
+        spack.repo.swap(RepoPath(spack.mock_packages_path))
 
     # If the user asked for it, don't check ssl certs.
     if args.insecure: