Patchwork [bitbake-devel,PATCHv2] git: remove symling before updating mirror tarball

mail settings
Submitter Martin Jansa
Date May 3, 2013, 3:58 p.m.
Message ID <>
Download mbox | patch
Permalink /patch/49313/
State Accepted, archived
Headers show


Martin Jansa - May 3, 2013, 3:58 p.m.
* with read-only PREMIRROR (e.g. mounted over NFS or CIFS
  and referenced as file:///mnt/premirror) we cannot use
  BB_GENERATE_MIRROR_TARBALLS because all git2_abc.git.tar.gz
  files later became just symlinks to read-only location in PREMIRROR
  (it works fine on first build and for new components, because
  at that time there isn't tarball on PREMIRROR yet).

  ERROR: Fetcher failure: Fetch command failed with exit code 141, output:
  tar (child): /build/downloads/git2_abc.git.tar.gz: Cannot open: Read-only file system
  tar (child): Error is not recoverable: exiting now

Signed-off-by: Martin Jansa <>
 lib/bb/fetch2/ | 4 ++++
 1 file changed, 4 insertions(+)


diff --git a/lib/bb/fetch2/ b/lib/bb/fetch2/
index 052802e..1ec8908 100644
--- a/lib/bb/fetch2/
+++ b/lib/bb/fetch2/
@@ -217,6 +217,10 @@  class Git(FetchMethod):
     def build_mirror_data(self, url, ud, d):
         # Generate a mirror tarball if needed
         if ud.write_tarballs and (ud.repochanged or not os.path.exists(ud.fullmirror)):
+            # it's possible that this symlink points to read-only filesystem with PREMIRROR
+            if os.path.islink(ud.fullmirror):
+                os.unlink(origud.localpath)
   "Creating tarball of git repository")
             runfetchcmd("tar -czf %s %s" % (ud.fullmirror, os.path.join(".") ), d)