[bitbake-devel] [PATCH] fetcher: use os.path.splitext() instead of string.split()
Ross Burton
ross.burton at intel.com
Fri Jan 16 17:48:12 UTC 2015
Signed-off-by: Ross Burton <ross.burton at intel.com>
---
bitbake/lib/bb/fetch2/__init__.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py
index c0a4763..ed7c59c 100644
--- a/bitbake/lib/bb/fetch2/__init__.py
+++ b/bitbake/lib/bb/fetch2/__init__.py
@@ -1197,9 +1197,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']:
- 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']:
+ efile = os.path.join(rootdir, os.path.basename(base))
else:
efile = file
cmd = None
--
1.7.10.4
More information about the bitbake-devel
mailing list