package : removed do_clean()

This commit is contained in:
alalazo
2016-03-02 17:19:27 +01:00
parent 4d63544fe9
commit ca41909ec5
6 changed files with 17 additions and 43 deletions

View File

@@ -43,4 +43,4 @@ def clean(parser, args):
specs = spack.cmd.parse_specs(args.packages, concretize=True) specs = spack.cmd.parse_specs(args.packages, concretize=True)
for spec in specs: for spec in specs:
package = spack.repo.get(spec) package = spack.repo.get(spec)
package.do_clean() package.stage.destroy()

View File

@@ -1138,13 +1138,6 @@ def do_restage(self):
"""Reverts expanded/checked out source to a pristine state.""" """Reverts expanded/checked out source to a pristine state."""
self.stage.restage() self.stage.restage()
def do_clean(self):
"""Removes the package's build stage and source tarball."""
if os.path.exists(self.stage.path):
self.stage.destroy()
def format_doc(self, **kwargs): def format_doc(self, **kwargs):
"""Wrap doc string at 72 characters and format nicely""" """Wrap doc string at 72 characters and format nicely"""
indent = kwargs.get('indent', 0) indent = kwargs.get('indent', 0)
@@ -1181,7 +1174,7 @@ def fetch_remote_versions(self):
try: try:
return spack.util.web.find_versions_of_archive( return spack.util.web.find_versions_of_archive(
*self.all_urls, list_url=self.list_url, list_depth=self.list_depth) *self.all_urls, list_url=self.list_url, list_depth=self.list_depth)
except spack.error.NoNetworkConnectionError, e: except spack.error.NoNetworkConnectionError as e:
tty.die("Package.fetch_versions couldn't connect to:", tty.die("Package.fetch_versions couldn't connect to:",
e.url, e.message) e.url, e.message)

View File

@@ -52,19 +52,15 @@ def setUp(self):
spec.concretize() spec.concretize()
self.pkg = spack.repo.get(spec, new=True) self.pkg = spack.repo.get(spec, new=True)
def tearDown(self): def tearDown(self):
"""Destroy the stage space used by this test.""" """Destroy the stage space used by this test."""
super(GitFetchTest, self).tearDown() super(GitFetchTest, self).tearDown()
self.repo.destroy() self.repo.destroy()
self.pkg.do_clean()
def assert_rev(self, rev): def assert_rev(self, rev):
"""Check that the current git revision is equal to the supplied rev.""" """Check that the current git revision is equal to the supplied rev."""
self.assertEqual(self.repo.rev_hash('HEAD'), self.repo.rev_hash(rev)) self.assertEqual(self.repo.rev_hash('HEAD'), self.repo.rev_hash(rev))
def try_fetch(self, rev, test_file, args): def try_fetch(self, rev, test_file, args):
"""Tries to: """Tries to:
1. Fetch the repo using a fetch strategy constructed with 1. Fetch the repo using a fetch strategy constructed with

View File

@@ -49,13 +49,10 @@ def setUp(self):
spec.concretize() spec.concretize()
self.pkg = spack.repo.get(spec, new=True) self.pkg = spack.repo.get(spec, new=True)
def tearDown(self): def tearDown(self):
"""Destroy the stage space used by this test.""" """Destroy the stage space used by this test."""
super(HgFetchTest, self).tearDown() super(HgFetchTest, self).tearDown()
self.repo.destroy() self.repo.destroy()
self.pkg.do_clean()
def try_fetch(self, rev, test_file, args): def try_fetch(self, rev, test_file, args):
"""Tries to: """Tries to:

View File

@@ -104,29 +104,21 @@ def check_mirror(self):
saved_checksum_setting = spack.do_checksum saved_checksum_setting = spack.do_checksum
with pkg.stage: with pkg.stage:
try: # Stage the archive from the mirror and cd to it.
# Stage the archive from the mirror and cd to it. spack.do_checksum = False
spack.do_checksum = False pkg.do_stage(mirror_only=True)
pkg.do_stage(mirror_only=True) # Compare the original repo with the expanded archive
original_path = mock_repo.path
# Compare the original repo with the expanded archive if 'svn' in name:
original_path = mock_repo.path # have to check out the svn repo to compare.
if 'svn' in name: original_path = join_path(mock_repo.path, 'checked_out')
# have to check out the svn repo to compare. svn('checkout', mock_repo.url, original_path)
original_path = join_path(mock_repo.path, 'checked_out') dcmp = dircmp(original_path, pkg.stage.source_path)
svn('checkout', mock_repo.url, original_path) # make sure there are no new files in the expanded tarball
self.assertFalse(dcmp.right_only)
dcmp = dircmp(original_path, pkg.stage.source_path) # and that all original files are present.
self.assertTrue(all(l in exclude for l in dcmp.left_only))
# make sure there are no new files in the expanded tarball spack.do_checksum = saved_checksum_setting
self.assertFalse(dcmp.right_only)
# and that all original files are present.
self.assertTrue(all(l in exclude for l in dcmp.left_only))
finally:
spack.do_checksum = saved_checksum_setting
pkg.do_clean()
def test_git_mirror(self): def test_git_mirror(self):

View File

@@ -51,13 +51,10 @@ def setUp(self):
spec.concretize() spec.concretize()
self.pkg = spack.repo.get(spec, new=True) self.pkg = spack.repo.get(spec, new=True)
def tearDown(self): def tearDown(self):
"""Destroy the stage space used by this test.""" """Destroy the stage space used by this test."""
super(SvnFetchTest, self).tearDown() super(SvnFetchTest, self).tearDown()
self.repo.destroy() self.repo.destroy()
self.pkg.do_clean()
def assert_rev(self, rev): def assert_rev(self, rev):
"""Check that the current revision is equal to the supplied rev.""" """Check that the current revision is equal to the supplied rev."""
@@ -70,7 +67,6 @@ def get_rev():
return match.group(1) return match.group(1)
self.assertEqual(get_rev(), rev) self.assertEqual(get_rev(), rev)
def try_fetch(self, rev, test_file, args): def try_fetch(self, rev, test_file, args):
"""Tries to: """Tries to:
1. Fetch the repo using a fetch strategy constructed with 1. Fetch the repo using a fetch strategy constructed with