Skip to contentSkip to conversation

base.bbclass: re-add backward compatibility with bitbake w.r.t decodeurl fix in bitbake

PATCH In review Khem Raj 5 participants 5 messages Jul 6, 2010 – Jul 15, 2010

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH v2 1/1 base.bbclass: re-add backward compatibility with bitbake w.r.t decodeurl fix in bitbake

This patch seems to work with both bitbakes

---
 classes/base.bbclass |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)
classes/base.bbclass +13 -2
index 2da0b7a..b30310d 100644
@@ -219,14 +219,25 @@ def oe_unpack_file(file, data, url = None):
 			# The "destdir" handling was specifically done for FILESPATH
 			# items.  So, only do so for file:// entries.
 			if type == "file":
-				dest = os.path.dirname(path) or "."
+				if not host:
+					dest = os.path.dirname(path) or "."
+				else:
+				# this case is for backward compatiblity with older version
+				# of bitbake which do not have the fix
+				# http://cgit.openembedded.org/cgit.cgi/bitbake/commit/?id=ca257adc587bb0937ea76d8b32b654fdbf4192b8
+				# this should not be needed once all releases of bitbake has this fix
+				# applied/backported
+					dest = host + os.path.dirname(path) or "."
 			else:
 				dest = "."
 			bb.mkdirhier("%s" % os.path.join(os.getcwd(),dest))
 			cmd = 'cp %s %s' % (file, os.path.join(os.getcwd(), dest))
 	if not cmd:
 		return True
-	dest = os.path.join(os.getcwd(), path)
+	if not host:
+		dest = os.path.join(os.getcwd(), path)
+	else:
+		dest = os.path.join(os.getcwd(), os.path.join(host, path))
 	if os.path.exists(dest):
 		if os.path.samefile(file, dest):
 			return True
Signature · 1 line
1.7.1
#1 lore raw
Quoted 8 lines · Khem Raj <raj.khem <at> gmail.com> writes:

This patch seems to work with both bitbakes

Signed-off-by Khem Raj <raj.khem <at> gmail.com>
---
 classes/base.bbclass |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

This patch works for me using bitbake 1.8.18.

#2 lore raw

Works for me. I'm also using bitbake 1.8.18

Regards and thanks,

Jan

Quoted 19 lines · Samuel Sieb
Quoted 8 lines · Khem Raj <raj.khem <at> gmail.com> writes:

This patch seems to work with both bitbakes

Signed-off-by Khem Raj <raj.khem <at> gmail.com>

---
 classes/base.bbclass |   15 +++++++++++++--

 1 files changed, 13 insertions(+), 2 deletions(-)

This patch works for me using bitbake 1.8.18.

_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel

Acked-by on v2 1/1
#3 lore raw
In reply to Khem Raj

2010/7/7 Khem Raj <[email protected]>:

Quoted 34 lines

This patch seems to work with both bitbakes

---
 classes/base.bbclass |   15 +++++++++++++--

 1 files changed, 13 insertions(+), 2 deletions(-)
classes/base.bbclass +0 -0
index 2da0b7a..b30310d 100644
@@ -219,14 +219,25 @@ def oe_unpack_file(file, data, url = None):
                        # The "destdir" handling was specifically done for FILESPATH
                        # items.  So, only do so for file:// entries.

                       if type == "file":
-                               dest = os.path.dirname(path) or "."
+                               if not host:
+                                       dest = os.path.dirname(path) or "."
+                               else:
+                               # this case is for backward compatiblity with older version
+                               # of bitbake which do not have the fix
+                               # http://cgit.openembedded.org/cgit.cgi/bitbake/commit/?id=ca257adc587bb0937ea76d8b32b654fdbf4192b8
+                               # this should not be needed once all releases of bitbake has this fix
+                               # applied/backported
+                                       dest = host + os.path.dirname(path) or "."
                       else:
                               dest = "."
                       bb.mkdirhier("%s" % os.path.join(os.getcwd(),dest))
                       cmd = 'cp %s %s' % (file, os.path.join(os.getcwd(), dest))
       if not cmd:
               return True
-       dest = os.path.join(os.getcwd(), path)
+       if not host:

Quoted 9 lines

+               dest = os.path.join(os.getcwd(), path)
+       else:
+               dest = os.path.join(os.getcwd(), os.path.join(host, path)) if os.path.exists(dest):
               if os.path.samefile(file, dest):
                       return True
--
1.7.1

This fixes things for me so:

#4 lore raw
Quoted 46 lines · Frans Meulenbroeks

2010/7/7 Khem Raj <[email protected]>:

Quoted 34 lines

This patch seems to work with both bitbakes

---
 classes/base.bbclass |   15 +++++++++++++--

 1 files changed, 13 insertions(+), 2 deletions(-)
classes/base.bbclass +0 -0
index 2da0b7a..b30310d 100644
@@ -219,14 +219,25 @@ def oe_unpack_file(file, data, url = None):
                        # The "destdir" handling was specifically done for FILESPATH
                        # items.  So, only do so for file:// entries.

                       if type == "file":
-                               dest = os.path.dirname(path) or "."
+                               if not host:
+                                       dest = os.path.dirname(path) or "."
+                               else:
+                               # this case is for backward compatiblity with older version
+                               # of bitbake which do not have the fix
+                               # http://cgit.openembedded.org/cgit.cgi/bitbake/commit/?id=ca257adc587bb0937ea76d8b32b654fdbf4192b8
+                               # this should not be needed once all releases of bitbake has this fix
+                               # applied/backported
+                                       dest = host + os.path.dirname(path) or "."
                       else:
                               dest = "."
                       bb.mkdirhier("%s" % os.path.join(os.getcwd(),dest))
                       cmd = 'cp %s %s' % (file, os.path.join(os.getcwd(), dest))
       if not cmd:
               return True
-       dest = os.path.join(os.getcwd(), path)
+       if not host:

Quoted 9 lines

+               dest = os.path.join(os.getcwd(), path)
+       else:
+               dest = os.path.join(os.getcwd(), os.path.join(host, path)) if os.path.exists(dest):
               if os.path.samefile(file, dest):
                       return True
--
1.7.1

This fixes things for me so:

Quoted 2 lines

This change appears to have broken lsof_4.83.bb.

lsof has a weird tar within a tar, and thus a custom do_unpack(). The result is that the inner tar is not extracted, and do_configure fails to find a configure script.

-Graham