bitbake: fetcher: use os.path.splitext() instead of string.split()

(Bitbake rev: 1689edd35477a126bfbf4bd3257c4f1f9e16f20d)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Ross Burton
2015-01-16 17:53:23 +00:00
committed by Richard Purdie
parent f0d5edc91e
commit 9a51fb39db

View File

@@ -1201,9 +1201,9 @@ class FetchMethod(object):
bb.fatal("Invalid value for 'unpack' parameter for %s: %s" %
(file, urldata.parm.get('unpack')))
dots = file.split(".")
if dots[-1] in ['gz', 'bz2', 'Z', 'xz', 'lz']:
efile = os.path.join(rootdir, os.path.basename('.'.join(dots[0:-1])))
base, ext = os.path.splitext(file)
if ext in ['.gz', '.bz2', '.Z', '.xz', '.lz']:
efile = os.path.join(rootdir, os.path.basename(base))
else:
efile = file
cmd = None