From 9a51fb39dbde61baae5bf9094bbb1924bcfffd0a Mon Sep 17 00:00:00 2001 From: Ross Burton Date: Fri, 16 Jan 2015 17:53:23 +0000 Subject: bitbake: fetcher: use os.path.splitext() instead of string.split() (Bitbake rev: 1689edd35477a126bfbf4bd3257c4f1f9e16f20d) Signed-off-by: Ross Burton Signed-off-by: Richard Purdie --- bitbake/lib/bb/fetch2/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'bitbake') diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py index f97eaf4399..599ea8c822 100644 --- a/bitbake/lib/bb/fetch2/__init__.py +++ b/bitbake/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 -- cgit v1.2.3-54-g00ecf