Bug 2688 - apt-native 0.7.14: file name too long error when run (tmpdir length)
Summary: apt-native 0.7.14: file name too long error when run (tmpdir length)
Status: VERIFIED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: devtools / tool chain (show other bugs)
Version: 1.3
Hardware: x86 Multiple
: Medium normal
Target Milestone: 1.3 M4
Assignee: Robert Yang
QA Contact:
URL:
Whiteboard: (QA Testing Completed)(Done)
Depends on:
Blocks: 2434
  Show dependency tree
 
Reported: 2012-07-04 02:51 UTC by Robert Yang
Modified: 2012-07-19 08:08 UTC (History)
7 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Yang 2012-07-04 02:51:21 UTC
when the tmpdir dir is longer than 220, there is no files saved in tmp/sysroots/x86_64-linux/var/lib/apt/lists/ after run apt-get update, this is because apt-get uses the path as the file name, but the file name can't be longer than 255 according to /usr/include/linux/limits.h, here is the related from apt-pkg/contrib/strutl.cc:

string URItoFileName(const string &URI)
{
   // Nuke 'sensitive' items
   ::URI U(URI);
   U.User.clear();
   U.Password.clear();
   U.Access.clear();

   // "\x00-\x20{}|\\\\^\\[\\]<>\"\x7F-\xFF";
   string NewURI = QuoteString(U,"\\|{}[]<>\"^~_=!@#$%^&*");
   replace(NewURI.begin(),NewURI.end(),'/','_');
   return NewURI;
}

Limit the NewURI length to 255 would fix the problem.
Comment 2 liang li 2012-07-19 08:01:43 UTC
the build dir is "/home/yocto/test_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto/test_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto" ,which length equals 400.
run "bitbake core-image-minimal", no error during build and files are saved in "tmp/sysroots/x86_64-linux/var/lib/apt/lists/".
Comment 3 liang li 2012-07-19 08:08:22 UTC
test env :
host :Fedora 17 x86_64

git info : eb0cb7e8234f5d2e5623406e9660be91cf52f65e
git branch: poky/master