From: André Draszik Date: Tue, 30 Jul 2013 12:56:22 +0000 (+0000) Subject: bitbake: fetch2: fix unpack of .xz files X-Git-Tag: rev_ivi_2015_02_04~11619 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9514f4b798bba4c4ad33d03a74e0255a636257ca;p=scm%2Fbb%2Ftizen-distro.git bitbake: fetch2: fix unpack of .xz files If a file ends with .xz, it currently gets overwritten during unpack: The decompress command for .xz files is: 'xz -dc %s > %s' % (file, efile) and as efile == file, we end up overwriting file (the source). Fix this by adding .xz to the list of suffixes that that need to be removed from a file name for an extract command, leaving the bare file name. Now, for a given file foo.xz, file == foo.xz and efile == foo, similar to how .gz .bz2 and .Z files are treated. (Bitbake rev: 2cd2d0a48e12ab4358fb967eaf7a56c17993f48d) Signed-off-by: André Draszik Signed-off-by: Richard Purdie --- diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py index 6211cd7..451d104 100644 --- a/bitbake/lib/bb/fetch2/__init__.py +++ b/bitbake/lib/bb/fetch2/__init__.py @@ -1157,7 +1157,7 @@ class FetchMethod(object): (file, urldata.parm.get('unpack'))) dots = file.split(".") - if dots[-1] in ['gz', 'bz2', 'Z']: + if dots[-1] in ['gz', 'bz2', 'Z', 'xz']: efile = os.path.join(rootdir, os.path.basename('.'.join(dots[0:-1]))) else: efile = file