Hello,

It seems that Local fetcher in bitbake doesn't bother to check for file
existence under some conditions. This will result in obscure build
failures, like:

NOTE: package bluez-cups-backend-3.23-r0: task do_unpack: started
NOTE: Unpacking /usr/portage/distfiles/bluez-utils-3.23.tar.gz
to 
/home/pfalcon/linux-ppc/build-oe-angstrom/tmp/work/armv5te-angstrom-linux-gnueabi/bluez-cups-backend-3.23-r0/
NOTE:
Unpacking 
/home/pfalcon/linux-ppc/build-oe-angstrom/tmp/work/armv5te-angstrom-linux-gnueabi/bluez-cups-backend-3.23-r0
to 
/home/pfalcon/linux-ppc/build-oe-angstrom/tmp/work/armv5te-angstrom-linux-gnueabi/bluez-cups-backend-3.23-r0/
cp: cannot copy a directory,
`/home/pfalcon/linux-ppc/build-oe-angstrom/tmp/work/armv5te-angstrom-linux-gnueabi/bluez-cups-backend-3.23-r0',
into itself,
`/home/pfalcon/linux-ppc/build-oe-angstrom/tmp/work/armv5te-angstrom-linux-gnueabi/bluez-cups-backend-3.23-r0/./bluez-cups-backend-3.23-r0'
NOTE: Task failed: NOTE: package bluez-cups-backend-3.23-r0: task
do_unpack: failed

(Here Local.localpath() returned "").

I made a patch to catch this. It really needs more testing (who knows,
maybe lack of validation is by design, and it should be put
elsewhere ;-) ), so here's for review. Note the relevant context dumped
in error - it's very important to improve bitbake's diagnostics which
is by now mostly useless from outsider's point of view (and for
non-outsiders it may take hours to debug a problem), if we want to bring
more people to OE.


--- local.py    (revision 1009)
+++ local.py    (working copy)
@@ -33,7 +33,7 @@
 class Local(Fetch):
     def supports(self, url, urldata, d):
         """
-        Check to see if a given url can be fetched with cvs.
+        Check to see if a given url can be fetched.
         """
         return urldata.type in ['file','patch']
 
@@ -41,18 +41,24 @@
         """
         Return the local filename of a given url assuming a successful
fetch. """
+        filespath = "<unused>"
+        filesdir = "<unused>"
         path = url.split("://")[1]
         path = path.split(";")[0]
         newpath = path
         if path[0] != "/":
             filespath = data.getVar('FILESPATH', d, 1)
             if filespath:
+                bb.note("fetching stuff in %s" % filespath)
                 newpath = bb.which(filespath, path)
             if not newpath:
                 filesdir = data.getVar('FILESDIR', d, 1)
                 if filesdir:
                     newpath = os.path.join(filesdir, path)
         # We don't set localfile as for this fetcher the file is
already local!
+        bb.note("final path: %s" % newpath)
+        if not os.path.exists(newpath):
+            bb.fatal('Cannot fetch local file: %s, FILESPATH="%s",
FILESDIR="%s"' % (url, filespath, filesdir)) return newpath
 
     def go(self, url, urldata, d):


-- 
Best regards,
 Paul                          mailto:[EMAIL PROTECTED]
_______________________________________________
Bitbake-dev mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/bitbake-dev

Reply via email to