From: Chris Larson Date: Sat, 24 Apr 2010 16:42:17 +0000 (-0700) Subject: base.bbclass: unbork oe_unpack_file X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=757ec3d76d258c15828de2d85dd8ce9abb4c1323;p=openembedded.git base.bbclass: unbork oe_unpack_file I accidentally messed up the merge, sorry about that. Signed-off-by: Chris Larson --- diff --git a/classes/base.bbclass b/classes/base.bbclass index 50bcc30af9..e48cbacc07 100644 --- a/classes/base.bbclass +++ b/classes/base.bbclass @@ -161,15 +161,14 @@ python base_do_fetch() { raise bb.build.FuncFailed("Checksum of '%s' failed" % uri) } -def oe_unpack_file(file, data, url = None): - import subprocess - if not url: - url = "file://%s" % file - dots = file.split(".") - if dots[-1] in ['gz', 'bz2', 'Z']: - efile = os.path.join(bb.data.getVar('WORKDIR', data, 1),os.path.basename('.'.join(dots[0:-1]))) - else: - efile = file +def oe_unpack_file(file, destdir, **options): + import subprocess, shutil + + dest = os.path.join(destdir, os.path.basename(file)) + if os.path.exists(dest): + if os.path.samefile(file, dest): + return True + cmd = None if file.endswith('.tar'): cmd = 'tar x --no-same-owner -f %s' % file