[bitbake-devel] [PATCH 1/1] fetch2/__init__.py: remove broken sysmlink

Robert Yang liezhi.yang at windriver.com
Tue Aug 19 09:07:41 UTC 2014


Fixed:
(Simulate mirror the tarball from PREMIRRORS)
$ ln -sf /path/to/local/PREMIRROR/bzip2 bzip2-1.0.6.tar.gz
(Simulate the PREMIRRORS are gone)
$ rm -f /path/to/local/PREMIRROR/bzip2-1.0.6.tar.gz
$ bitbake bzip2 -ccleansstate && bitbake bzip2 -cfetch

Then the newly get bzip2-1.0.6.tar.gz will be saved to
/path/to/local/PREMIRROR/bzip2-1.0.6.tar.gz rather than then the DL_DIR,
or get error if we don't have the write permission on to the mirror.
This is because wget uses "lstat()" to follow the symlink for FTP (but
fstat() for HTTP, so http doesn't have this issue), and we can't fix
wget (this might be intended by wget) since it is one of
SANITY_REQUIRED_UTILITIES.

Remove the broken sysmlink in DL_DIR will fix the problem.

Signed-off-by: Robert Yang <liezhi.yang at windriver.com>
---
 bitbake/lib/bb/fetch2/__init__.py |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py
index df2f2b0..c95f177 100644
--- a/bitbake/lib/bb/fetch2/__init__.py
+++ b/bitbake/lib/bb/fetch2/__init__.py
@@ -1081,6 +1081,11 @@ class FetchData(object):
         self.donestamp = basepath + '.done'
         self.lockfile = basepath + '.lock'
 
+        # Remove the broken sysmlink
+        if self.localpath and not os.path.exists(self.localpath) and \
+                os.path.islink(self.localpath):
+            os.unlink(self.localpath)
+
     def setup_revisons(self, d):
         self.revisions = {}
         for name in self.names:
-- 
1.7.9.5




More information about the bitbake-devel mailing list