diff options
author | Ross Burton <ross.burton@intel.com> | 2015-01-16 17:53:23 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-01-21 14:20:30 +0000 |
commit | 1689edd35477a126bfbf4bd3257c4f1f9e16f20d (patch) | |
tree | e70dee33c229c9877711d5e9f95f014de6a1345e /lib/bb/fetch2/__init__.py | |
parent | 7a87ca9518f7239a2dfeb4576c59ea7b1f8d3071 (diff) | |
download | bitbake-1689edd35477a126bfbf4bd3257c4f1f9e16f20d.tar.gz |
fetcher: use os.path.splitext() instead of string.split()
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/fetch2/__init__.py')
-rw-r--r-- | lib/bb/fetch2/__init__.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/bb/fetch2/__init__.py b/lib/bb/fetch2/__init__.py index f97eaf439..599ea8c82 100644 --- a/lib/bb/fetch2/__init__.py +++ b/lib/bb/fetch2/__init__.py @@ -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 |