fetcher: use os.path.splitext() instead of string.split()
PATCH v2 1/1 fetcher: use os.path.splitext() instead of string.split()
Signed-off-by Ross Burton <[email protected]>
--- bitbake/lib/bb/fetch2/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
bitbake/lib/bb/fetch2/__init__.py +3 -3
@@ -1199,9 +1199,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
Signature · 1 line
1.7.10.4