| Summary: | Issue with package_rpm : can't install files named "%name..." | ||
|---|---|---|---|
| Product: | [Runtime] Package Management Issues | Reporter: | Sébastien MENNETRIER <s.mennetrier> |
| Component: | RPM | Assignee: | Ross Burton - Disabled <ross> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | minor | ||
| Priority: | Medium | CC: | bluelightning, mburtin, n3npq, richard.purdie, ross.burton, sgw |
| Version: | unspecified | ||
| Target Milestone: | 1.9 M3 | ||
| Hardware: | All | ||
| OS: | Multiple | ||
| Whiteboard: | |||
| OS type for building Yocto: | --- | Type of Regression: | --- |
| Verified: | Documentation change: | Don't know | |
|
Description
Sébastien MENNETRIER
2013-10-28 15:36:14 UTC
I tried to create a patch to fix this issue : http://lists.openembedded.org/pipermail/openembedded-core/2013-October/085689.html The correct fix should be to replace "%" with "%%" in a name. The later is a literal, the former indicates part of a variable will be coming next. [%] might work, but it invokes the globbing mechanism which is not necessary. I tried to replace "%" with "%%" and with "\%" but it doesn't work. I also tried to replace "%name" by "%%name" and it doesn't work. "[%]" is the only solution that I found that fix the issue... Have you an other suggestion Mark to fix this issues ? any filename that includes a '%', should be automatically turned into '%%'
%%name is valid RPM syntax and should result in finding the file name literal '%name'.
If that isn't working, then the globbing mechanism may be the only other approach that can be used. It should be fairly easy to add a routine that does a search/replace of '%' in the contents of:
file_list = []
walk_files(root, file_list, conffiles)
if not file_list and localdata.getVar('ALLOW_EMPTY') != "1":
bb.note("Not creating empty RPM package for %s" % splitname)
else:
bb.note("Creating RPM package for %s" % splitname)
spec_files_top.append('%files')
spec_files_top.append('%defattr(-,-,-,-)')
if file_list:
bb.note("Creating RPM package for %s" % splitname)
spec_files_top.extend(file_list)
else:
bb.note("Creating EMPTY RPM Package for %s" % splitname)
spec_files_top.append('')
iterate file_list, and replace with either the '%%' or '[%]' as necessary.
I think that you cannot modify 'file_list'. This list contains items that begin by "%dir" or by "%config" and these "%" must not be replaced. I created a patch that escapes "%" in "walk_files" function (http://lists.openembedded.org/pipermail/openembedded-core/2013-October/085689.html) I use the globbing mechanism because I tried with '%%' and this didn't work. Maybe is an issue with rpm5 (used by yocto)... (http://rpm5.org/) rpm5 expands file paths twice, once while building, another time while installing. So %%%%name (i.e. four % characters) is needed for a literal "%name" Meanwhile you almost certainly going to be happier patching to remove the need for escaping '%' ... dunno if this is possible. New patch submitted, replacing "%" in file/dir with "%%%%%%%%": http://lists.openembedded.org/pipermail/openembedded-core/2015-May/105143.html |