X Tutup
Skip to content

Commit 04f032d

Browse files
committed
Rename spack.db -> spack.repo
Making distinction between install database and package repositories clearer.
1 parent e6d232b commit 04f032d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+103
-103
lines changed

lib/spack/spack/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@
5858
_repo_paths = spack.config.get_repos_config()
5959
if not _repo_paths:
6060
tty.die("Spack configuration contains no package repositories.")
61-
db = spack.repository.RepoPath(*_repo_paths)
62-
sys.meta_path.append(db)
61+
repo = spack.repository.RepoPath(*_repo_paths)
62+
sys.meta_path.append(repo)
6363

6464
#
6565
# Set up the installed packages database
@@ -146,7 +146,7 @@
146146
# When packages call 'from spack import *', this extra stuff is brought in.
147147
#
148148
# Spack internal code should call 'import spack' and accesses other
149-
# variables (spack.db, paths, etc.) directly.
149+
# variables (spack.repo, paths, etc.) directly.
150150
#
151151
# TODO: maybe this should be separated out and should go in build_environment.py?
152152
# TODO: it's not clear where all the stuff that needs to be included in packages

lib/spack/spack/cmd/checksum.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def get_checksums(versions, urls, **kwargs):
8181

8282
def checksum(parser, args):
8383
# get the package we're going to generate checksums for
84-
pkg = spack.db.get(args.package)
84+
pkg = spack.repo.get(args.package)
8585

8686
# If the user asked for specific versions, use those.
8787
if args.versions:

lib/spack/spack/cmd/clean.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,5 @@ def clean(parser, args):
4242

4343
specs = spack.cmd.parse_specs(args.packages, concretize=True)
4444
for spec in specs:
45-
package = spack.db.get(spec)
45+
package = spack.repo.get(spec)
4646
package.do_clean()

lib/spack/spack/cmd/create.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ def create(parser, args):
172172
tty.msg("Creating template for package %s" % name)
173173

174174
# Create a directory for the new package.
175-
pkg_path = spack.db.filename_for_package_name(name, package_repo)
175+
pkg_path = spack.repo.filename_for_package_name(name, package_repo)
176176
if os.path.exists(pkg_path) and not args.force:
177177
tty.die("%s already exists." % pkg_path)
178178
else:
@@ -214,7 +214,7 @@ def create(parser, args):
214214
name = 'py-%s' % name
215215

216216
# Create a directory for the new package.
217-
pkg_path = spack.db.filename_for_package_name(name)
217+
pkg_path = spack.repo.filename_for_package_name(name)
218218
if os.path.exists(pkg_path) and not args.force:
219219
tty.die("%s already exists." % pkg_path)
220220
else:

lib/spack/spack/cmd/diy.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def diy(self, args):
6161
# Take a write lock before checking for existence.
6262
with spack.installed_db.write_transaction():
6363
spec = specs[0]
64-
if not spack.db.exists(spec.name):
64+
if not spack.repo.exists(spec.name):
6565
tty.warn("No such package: %s" % spec.name)
6666
create = tty.get_yes_or_no("Create this package?", default=False)
6767
if not create:
@@ -76,7 +76,7 @@ def diy(self, args):
7676
tty.die("spack diy spec must have a single, concrete version.")
7777

7878
spec.concretize()
79-
package = spack.db.get(spec)
79+
package = spack.repo.get(spec)
8080

8181
if package.installed:
8282
tty.error("Already installed in %s" % package.prefix)

lib/spack/spack/cmd/edit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def install(self, spec, prefix):
5454

5555

5656
def edit_package(name, force=False):
57-
path = spack.db.filename_for_package_name(name)
57+
path = spack.repo.filename_for_package_name(name)
5858

5959
if os.path.exists(path):
6060
if not os.path.isfile(path):

lib/spack/spack/cmd/extensions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def extensions(parser, args):
7171
args.mode = 'short'
7272

7373
# List package names of extensions
74-
extensions = spack.db.extensions_for(spec)
74+
extensions = spack.repo.extensions_for(spec)
7575
if not extensions:
7676
tty.msg("%s has no extensions." % spec.cshort_spec)
7777
return

lib/spack/spack/cmd/fetch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,5 @@ def fetch(parser, args):
4646

4747
specs = spack.cmd.parse_specs(args.packages, concretize=True)
4848
for spec in specs:
49-
package = spack.db.get(spec)
49+
package = spack.repo.get(spec)
5050
package.do_fetch()

lib/spack/spack/cmd/find.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def find(parser, args):
137137
# Filter out specs that don't exist.
138138
query_specs = spack.cmd.parse_specs(args.query_specs)
139139
query_specs, nonexisting = partition_list(
140-
query_specs, lambda s: spack.db.exists(s.name))
140+
query_specs, lambda s: spack.repo.exists(s.name))
141141

142142
if nonexisting:
143143
msg = "No such package%s: " % ('s' if len(nonexisting) > 1 else '')

lib/spack/spack/cmd/info.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,5 +105,5 @@ def print_text_info(pkg):
105105

106106

107107
def info(parser, args):
108-
pkg = spack.db.get(args.name)
108+
pkg = spack.repo.get(args.name)
109109
print_text_info(pkg)

0 commit comments

Comments
 (0)
X Tutup