base.bbclass: bugfix in oe_unpack_file
authorChris Larson <clarson@kergoth.com>
Fri, 28 Jul 2006 08:07:58 +0000 (08:07 +0000)
committerChris Larson <clarson@kergoth.com>
Fri, 28 Jul 2006 08:07:58 +0000 (08:07 +0000)
  * Fix an issue with file:// urls in SRC_URI which reside in WORKDIR.  With
    this issue fixed, patches within tarballs can be successfully applied to
    ${S}.

classes/base.bbclass

index 49d6260..85756ed 100644 (file)
@@ -398,8 +398,15 @@ def oe_unpack_file(file, data, url = None):
                                destdir = "."
                        bb.mkdirhier("%s/%s" % (os.getcwd(), destdir))
                        cmd = 'cp %s %s/%s/' % (file, os.getcwd(), destdir)
+
        if not cmd:
                return True
+
+       dest = os.path.join(os.getcwd(), os.path.basename(file))
+       if os.path.exists(dest):
+               if os.path.samefile(file, dest):
+                       return True
+
        cmd = "PATH=\"%s\" %s" % (bb.data.getVar('PATH', data, 1), cmd)
        bb.note("Unpacking %s to %s/" % (file, os.getcwd()))
        ret = os.system(cmd)