summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPatrick Gartung <gartung@fnal.gov>2019-06-04 14:39:04 -0500
committerGitHub <noreply@github.com>2019-06-04 14:39:04 -0500
commit964a1d59970b27105ca61684228f5b3309e00cdd (patch)
treed5c40127486f6ba381a632b85fe8e07da0357a95 /lib
parenta7776972ad365367aadfbf2a826000006c66c76b (diff)
downloadspack-964a1d59970b27105ca61684228f5b3309e00cdd.tar.gz
spack-964a1d59970b27105ca61684228f5b3309e00cdd.tar.bz2
spack-964a1d59970b27105ca61684228f5b3309e00cdd.tar.xz
spack-964a1d59970b27105ca61684228f5b3309e00cdd.zip
Buildcache relocate.py error fix (#11616)
* Add a trailing / if file --mime does not return a mimetype with a / in it * Flake8
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/relocate.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/spack/spack/relocate.py b/lib/spack/spack/relocate.py
index fc653e825d..8277cca068 100644
--- a/lib/spack/spack/relocate.py
+++ b/lib/spack/spack/relocate.py
@@ -594,4 +594,6 @@ def mime_type(file):
file_cmd = Executable('file')
output = file_cmd('-b', '-h', '--mime-type', file, output=str, error=str)
tty.debug('[MIME_TYPE] {0} -> {1}'.format(file, output.strip()))
+ if '/' not in output:
+ output += '/'
return tuple(output.strip().split('/'))