summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/spack/spack/cmd/mirror.py9
-rw-r--r--lib/spack/spack/concretize.py1
-rw-r--r--lib/spack/spack/fetch_strategy.py24
-rw-r--r--lib/spack/spack/mirror.py2
-rw-r--r--lib/spack/spack/stage.py23
-rw-r--r--var/spack/packages/libmonitor/package.py3
-rw-r--r--var/spack/packages/paraver/package.py4
-rw-r--r--var/spack/packages/stat/package.py2
8 files changed, 41 insertions, 27 deletions
diff --git a/lib/spack/spack/cmd/mirror.py b/lib/spack/spack/cmd/mirror.py
index 6e2e4dfb24..22838e1344 100644
--- a/lib/spack/spack/cmd/mirror.py
+++ b/lib/spack/spack/cmd/mirror.py
@@ -71,8 +71,12 @@ def setup_parser(subparser):
def mirror_add(args):
"""Add a mirror to Spack."""
+ url = args.url
+ if url.startswith('/'):
+ url = 'file://' + url
+
config = spack.config.get_config('user')
- config.set_value('mirror', args.name, 'url', args.url)
+ config.set_value('mirror', args.name, 'url', url)
config.write()
@@ -158,6 +162,9 @@ def mirror_create(args):
" %-4d already present" % p,
" %-4d added" % m,
" %-4d failed to fetch." % e)
+ if error:
+ tty.error("Failed downloads:")
+ colify(s.format("$_$@") for s in error)
def mirror(parser, args):
diff --git a/lib/spack/spack/concretize.py b/lib/spack/spack/concretize.py
index e603806af9..eee8cb7fde 100644
--- a/lib/spack/spack/concretize.py
+++ b/lib/spack/spack/concretize.py
@@ -70,6 +70,7 @@ class DefaultConcretizer(object):
pkg = spec.package
valid_versions = [v for v in pkg.available_versions
if any(v.satisfies(sv) for sv in spec.versions)]
+
if valid_versions:
spec.versions = ver([valid_versions[-1]])
else:
diff --git a/lib/spack/spack/fetch_strategy.py b/lib/spack/spack/fetch_strategy.py
index 2b574eaba7..5a508b130c 100644
--- a/lib/spack/spack/fetch_strategy.py
+++ b/lib/spack/spack/fetch_strategy.py
@@ -559,7 +559,7 @@ def for_package_version(pkg, version):
url = pkg.url_for_verison(version)
if not url:
raise InvalidArgsError(pkg, version)
- return URLFetchStrategy()
+ return URLFetchStrategy(url)
# Grab a dict of args out of the package version dict
args = pkg.versions[version]
@@ -574,6 +574,8 @@ def for_package_version(pkg, version):
for fetcher in all_strategies:
attrs = dict((attr, getattr(pkg, attr, None))
for attr in fetcher.required_attributes)
+ if 'url' in attrs:
+ attrs['url'] = pkg.url_for_version(version)
attrs.update(args)
if fetcher.matches(attrs):
return fetcher(**attrs)
@@ -581,12 +583,12 @@ def for_package_version(pkg, version):
raise InvalidArgsError(pkg, version)
-class FetchStrategyError(spack.error.SpackError):
+class FetchError(spack.error.SpackError):
def __init__(self, msg, long_msg):
- super(FetchStrategyError, self).__init__(msg, long_msg)
+ super(FetchError, self).__init__(msg, long_msg)
-class FailedDownloadError(FetchStrategyError):
+class FailedDownloadError(FetchError):
"""Raised wen a download fails."""
def __init__(self, url, msg=""):
super(FailedDownloadError, self).__init__(
@@ -594,18 +596,26 @@ class FailedDownloadError(FetchStrategyError):
self.url = url
-class NoArchiveFileError(FetchStrategyError):
+class NoArchiveFileError(FetchError):
def __init__(self, msg, long_msg):
super(NoArchiveFileError, self).__init__(msg, long_msg)
-class NoDigestError(FetchStrategyError):
+class NoDigestError(FetchError):
def __init__(self, msg, long_msg):
super(NoDigestError, self).__init__(msg, long_msg)
-class InvalidArgsError(FetchStrategyError):
+class InvalidArgsError(FetchError):
def __init__(self, pkg, version):
msg = "Could not construct a fetch strategy for package %s at version %s"
msg %= (pkg.name, version)
super(InvalidArgsError, self).__init__(msg)
+
+
+class ChecksumError(FetchError):
+ """Raised when archive fails to checksum."""
+ def __init__(self, message, long_msg=None):
+ super(ChecksumError, self).__init__(message, long_msg)
+
+
diff --git a/lib/spack/spack/mirror.py b/lib/spack/spack/mirror.py
index f7bbb3f840..2f822b13ab 100644
--- a/lib/spack/spack/mirror.py
+++ b/lib/spack/spack/mirror.py
@@ -146,7 +146,7 @@ def create(path, specs, **kwargs):
archive_file = mirror_archive_filename(spec)
archive_path = join_path(subdir, archive_file)
- if os.path.exists(archive_file):
+ if os.path.exists(archive_path):
tty.msg("%s is already present. Skipping." % spec.format("$_$@"))
present.append(spec)
continue
diff --git a/lib/spack/spack/stage.py b/lib/spack/spack/stage.py
index 0d684df92d..b371761785 100644
--- a/lib/spack/spack/stage.py
+++ b/lib/spack/spack/stage.py
@@ -32,7 +32,7 @@ from llnl.util.filesystem import *
import spack
import spack.config
-import spack.fetch_strategy as fetch_strategy
+import spack.fetch_strategy as fs
import spack.error
@@ -83,8 +83,8 @@ class Stage(object):
stage will be given a unique name automatically.
"""
if isinstance(url_or_fetch_strategy, basestring):
- self.fetcher = fetch_strategy.from_url(url_or_fetch_strategy)
- elif isinstance(url_or_fetch_strategy, fetch_strategy.FetchStrategy):
+ self.fetcher = fs.from_url(url_or_fetch_strategy)
+ elif isinstance(url_or_fetch_strategy, fs.FetchStrategy):
self.fetcher = url_or_fetch_strategy
else:
raise ValueError("Can't construct Stage without url or fetch strategy")
@@ -198,7 +198,10 @@ class Stage(object):
@property
def archive_file(self):
"""Path to the source archive within this stage directory."""
- paths = [os.path.join(self.path, os.path.basename(self.url))]
+ if not isinstance(self.fetcher, fs.URLFetchStrategy):
+ return None
+
+ paths = [os.path.join(self.path, os.path.basename(self.fetcher.url))]
if self.mirror_path:
paths.append(os.path.join(self.path, os.path.basename(self.mirror_path)))
@@ -242,9 +245,9 @@ class Stage(object):
urls = ["%s/%s" % (m, self.mirror_path) for m in _get_mirrors()]
digest = None
- if isinstance(self.fetcher, fetch_strategy.URLFetchStrategy):
+ if isinstance(self.fetcher, fs.URLFetchStrategy):
digest = self.fetcher.digest
- fetchers = [fetch_strategy.URLFetchStrategy(url, digest)
+ fetchers = [fs.URLFetchStrategy(url, digest)
for url in urls] + fetchers
for f in fetchers:
f.set_stage(self)
@@ -365,12 +368,6 @@ class StageError(spack.error.SpackError):
super(self, StageError).__init__(message, long_message)
-class ChecksumError(StageError):
- """Raised when archive fails to checksum."""
- def __init__(self, message, long_msg=None):
- super(ChecksumError, self).__init__(message, long_msg)
-
-
class RestageError(StageError):
def __init__(self, message, long_msg=None):
super(RestageError, self).__init__(message, long_msg)
@@ -382,4 +379,4 @@ class ChdirError(StageError):
# Keep this in namespace for convenience
-FailedDownloadError = spack.fetch_strategy.FailedDownloadError
+FailedDownloadError = fs.FailedDownloadError
diff --git a/var/spack/packages/libmonitor/package.py b/var/spack/packages/libmonitor/package.py
index 210712436a..ed619e4cce 100644
--- a/var/spack/packages/libmonitor/package.py
+++ b/var/spack/packages/libmonitor/package.py
@@ -27,9 +27,8 @@ from spack import *
class Libmonitor(Package):
"""Libmonitor is a library for process and thread control."""
homepage = "http://hpctoolkit.org"
- url = "file:///g/g0/legendre/tools/oss/openspeedshop-release-2.1/SOURCES/libmonitor-20130218.tar.gz"
- version('20130218', 'aa85c2c580e2dafb823cc47b09374279')
+ version('20130218', svn='https://outreach.scidac.gov/svn/libmonitor/trunk', revision=146)
def install(self, spec, prefix):
configure("--prefix=" + prefix)
diff --git a/var/spack/packages/paraver/package.py b/var/spack/packages/paraver/package.py
index 45bac95b28..5f8a153d4c 100644
--- a/var/spack/packages/paraver/package.py
+++ b/var/spack/packages/paraver/package.py
@@ -7,9 +7,9 @@ class Paraver(Package):
is expressed on its input trace format. Traces for parallel MPI,
OpenMP and other programs can be genereated with Extrae."""
homepage = "http://www.bsc.es/computer-sciences/performance-tools/paraver"
- url = "http://www.bsc.es/ssl/apps/performanceTools/files/paraver-sources-4.5.2.tar.gz"
+ url = "http://www.bsc.es/ssl/apps/performanceTools/files/paraver-sources-4.5.3.tar.gz"
- version('4.5.2', 'ea463dd494519395c99ebae294edee17')
+ version('4.5.3', '625de9ec0d639acd18d1aaa644b38f72')
depends_on("boost")
#depends_on("extrae")
diff --git a/var/spack/packages/stat/package.py b/var/spack/packages/stat/package.py
index 956b0dcc8c..fbd1418d41 100644
--- a/var/spack/packages/stat/package.py
+++ b/var/spack/packages/stat/package.py
@@ -5,8 +5,8 @@ class Stat(Package):
homepage = "http://paradyn.org/STAT/STAT.html"
url = "https://github.com/lee218llnl/stat/archive/v2.0.0.tar.gz"
- version('2.0.0', 'c7494210b0ba26b577171b92838e1a9b')
version('2.1.0', 'ece26beaf057aa9134d62adcdda1ba91')
+ version('2.0.0', 'c7494210b0ba26b577171b92838e1a9b')
depends_on('libdwarf')
depends_on('dyninst')