All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1 RFC] fetch2/git.py: fix the filename too long error
@ 2013-11-08 16:31 Robert Yang
  2013-11-08 16:31 ` [PATCH 1/1 " Robert Yang
  0 siblings, 1 reply; 2+ messages in thread
From: Robert Yang @ 2013-11-08 16:31 UTC (permalink / raw)
  To: bitbake-devel

The following changes since commit d6cc7c8ed76c8b1117cf03c7bd4b0742f98f79b3:

  toolchain-scripts/meta-environment: Further cleanup code duplication (2013-11-06 11:02:27 +0000)

are available in the git repository at:

  git://git.pokylinux.org/poky-contrib rbt/toolong
  http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=rbt/toolong

Robert Yang (1):
  fetch2/git.py: fix the filename too long error

 bitbake/lib/bb/fetch2/git.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

-- 
1.8.3.1



^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH 1/1 RFC] fetch2/git.py: fix the filename too long error
  2013-11-08 16:31 [PATCH 0/1 RFC] fetch2/git.py: fix the filename too long error Robert Yang
@ 2013-11-08 16:31 ` Robert Yang
  0 siblings, 0 replies; 2+ messages in thread
From: Robert Yang @ 2013-11-08 16:31 UTC (permalink / raw)
  To: bitbake-devel

When we use the PREMIRROR/MIRROR from the local disk, and if it is in a
deep directory, for example, when len(path) > 255 (The NAME_MAX), we
will get the "filename too long error".

This is becuase we use ud.path.replace('/', '.') to change the path to
the filename. We seldom see such a long url, but it is easy to produce
it on the local machine.

Another problem is that:

file:///local/path

will be converted into .local.path whichi is a hidden file by default.

Don't convert the name when ud.proto == "file" will fix the problem.

PS:
- This is only for git, other fetchers also have the similar problem,
  will send the patch for others if this is fine.

- Another solution might be: use the md5sum(path) as part of the
  filename, I'm not sure whether it is worth.

[YOCTO #5389]

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

diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py
index 6175e4c..53fd2f5 100644
--- a/bitbake/lib/bb/fetch2/git.py
+++ b/bitbake/lib/bb/fetch2/git.py
@@ -127,7 +127,10 @@ class Git(FetchMethod):
                     ud.branches[name] = ud.revisions[name]
                 ud.revisions[name] = self.latest_revision(ud.url, ud, d, name)
 
-        gitsrcname = '%s%s' % (ud.host.replace(':','.'), ud.path.replace('/', '.').replace('*', '.'))
+        if ud.proto == "file":
+            gitsrcname = '%s%s' % ("file...", os.path.basename(ud.path))
+        else:
+            gitsrcname = '%s%s' % (ud.host.replace(':','.'), ud.path.replace('/', '.').replace('*', '.'))
         # for rebaseable git repo, it is necessary to keep mirror tar ball
         # per revision, so that even the revision disappears from the
         # upstream repo in the future, the mirror will remain intact and still
-- 
1.8.3.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-11-08  8:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-08 16:31 [PATCH 0/1 RFC] fetch2/git.py: fix the filename too long error Robert Yang
2013-11-08 16:31 ` [PATCH 1/1 " Robert Yang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.